You are not logged in.

#1 2010-05-16 22:18:23

Sadface
Member
From: Germany
Registered: 2009-12-09
Posts: 47

"Working" Bash highlight for VIM?

I wonder, has anyone found a "real" bash/zsh/sh/<insert bash compatible shell here> highlighting?

Mine's behaving weird. Absolutely correct stuff like "$(cat file.txt)" ist highlighted as an error, at least the "$(" and ")" parts are white on red background - which is annoying.
Also parameter expansion "${FILE//thumb/full}" - the whole "//thumb/full" part is again white on red background, error - but it's completely legal and correct to do so.

It is really disturbing having all these useless red spots inside my file - it's distracting.
What can I do?

Offline

#2 2010-05-16 22:20:32

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: "Working" Bash highlight for VIM?

What is your shebang?  If you are using /bin/sh and not /bin/bash, you will get errors for bash syntax as it tests for sh syntax.  $(..) is not valid sh syntax.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#3 2010-05-16 22:22:27

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: "Working" Bash highlight for VIM?

Not according to the people over at http://bbs.archlinux.org/viewtopic.php?id=97103.  But I'm still willing to be proven right! wink

Offline

#4 2010-05-16 22:29:04

Sadface
Member
From: Germany
Registered: 2009-12-09
Posts: 47

Re: "Working" Bash highlight for VIM?

Actually, my shebang reads "#!/bin/zsh" smile

Putting /bin/bash in there, the highlighting is gone, but how could I make it work with my beloved ZSH?
If I need to hack around it, by god, I will!

Last edited by Sadface (2010-05-16 22:30:07)

Offline

#5 2010-05-16 22:52:17

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: "Working" Bash highlight for VIM?

Afaik the red marked $() is not "error" but just sort of "command substitution block", to make you see where it starts and stops.
Dunno, that's just how i interpreted it, could be wrong.

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#6 2010-05-16 23:10:23

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: "Working" Bash highlight for VIM?

The red markers are errors because $() is not bourne-compatible.

Offline

#7 2010-05-16 23:12:21

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: "Working" Bash highlight for VIM?

Oh alright. (Hm i just saw that vim automatically uses sh-syntax even though a script has the zsh-shebang line; when i manually tell it to use zsh-syntax the red marking disappears..)

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

Board footer

Powered by FluxBB