Hi, I noticed that script
sed -e '\' -e '\' -e '\'
is displayed wrong. The syntax seems to think that you can escape the
single quote by backslash. This does not seem to be the case (I checked
with man pages of sh, bash and ksh). For csh I don't see it documented
clearly, but simple experiment shows that it behaves as other shells.
I'm using
:version
VIM - Vi IMproved 7.1 (2007 May 12, compiled May 31 2008 03:10:54)
Included patches: 1-305
...
:!head $VIMRUNTIME/syntax/sh.vim | grep Version
" Version: 90
I tried to hack'n'slash the syntax file, and I came to the attached
patch. But I have to admit that I'm not entirely sure what I'm doing, so
it's most probably wrong :)
Thank you
--
Vlad
--- /store/rcs/pkg/vim/share/vim/vim71/syntax/sh.vim st črn 4 00:48:49 2008
+++ /store/rcs/pkg/vim/share/vim/vim71/syntax/sh.vim.my st črn 4 00:50:59 2008
@@ -159,7 +159,6 @@
syn match shTestOpr contained '=' skipwhite
nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern
syn match shTestPattern contained '\w\+'
syn match shTestDoubleQuote contained '"[^"]*"'
-syn match shTestSingleQuote contained '\\.'
syn match shTestSingleQuote contained "'[^']*'"
if exists("b:is_kornshell") || exists("b:is_bash")
syn region shDblBrace matchgroup=Delimiter start="\[\[" skip=+\\\\\|\\$+
end="\]\]" [EMAIL PROTECTED]
@@ -205,10 +204,10 @@
endif
syn keyword shCaseIn contained skipwhite skipnl in
nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
if exists("b:is_bash")
- syn region shCaseExSingleQuote matchgroup=shOperator start=+\$'+
skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite
skipnl nextgroup=shCaseBar contained
+ syn region shCaseExSingleQuote matchgroup=shOperator start=+\$'+
end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl
nextgroup=shCaseBar contained
syn region shCaseExDoubleQuote matchgroup=shOperator start=+\$"+
skip=+\\\\\|\\.+ end=+"+
contains=shStringSpecial,shSpecial,shCommandSub,shDeref skipwhite skipnl
nextgroup=shCaseBar contained
else
- syn region shCaseExSingleQuote matchgroup=Error start=+\$'+
skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl
nextgroup=shCaseBar contained
+ syn region shCaseExSingleQuote matchgroup=Error start=+\$'+ end=+'+
contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar
contained
endif
syn region shCaseSingleQuote matchgroup=shOperator start=+'+ end=+'+
contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar
contained
syn region shCaseDoubleQuote matchgroup=shOperator start=+"+
skip=+\\\\\|\\.+ end=+"+ [EMAIL PROTECTED],shStringSpecial
skipwhite skipnl nextgroup=shCaseBar contained
@@ -260,12 +259,12 @@
syn match shSpecial "\\\o\o\o\|\\x\x\x\|\\c.\|\\[abefnrtv]" contained
endif
if exists("b:is_bash")
- syn region shExSingleQuote matchgroup=shOperator start=+\$'+
skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial
+ syn region shExSingleQuote matchgroup=shOperator start=+\$'+ end=+'+
contains=shStringSpecial,shSpecial
syn region shExDoubleQuote matchgroup=shOperator start=+\$"+
skip=+\\\\\|\\.+ end=+"+
contains=shStringSpecial,shSpecial,shCommandSub,shDeref
else
- syn region shExSingleQuote matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+
end=+'+ contains=shStringSpecial
+ syn region shExSingleQuote matchGroup=Error start=+\$'+ end=+'+
contains=shStringSpecial
endif
-syn region shSingleQuote matchgroup=shOperator start=+'+ end=+'+
contains=shStringSpecial,@Spell
+syn region shSingleQuote matchgroup=shOperator start=+'+ end=+'+
syn region shDoubleQuote matchgroup=shOperator start=+"+ skip=+\\"+
end=+"+ [EMAIL PROTECTED],shStringSpecial,@Spell
syn match shStringSpecial "[^[:print:]]" contained
syn match shStringSpecial "\%(\\\\\)*\\[\\"'`$()#]"
pgpTOinxG2Tvl.pgp
Description: PGP signature
