Skip to content

Instantly share code, notes, and snippets.

@mattn
Created June 26, 2013 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/5867028 to your computer and use it in GitHub Desktop.
Save mattn/5867028 to your computer and use it in GitHub Desktop.
diff -r b314c98a48d4 runtime/syntax/vim.vim
--- a/runtime/syntax/vim.vim Wed Jun 26 14:04:47 2013 +0200
+++ b/runtime/syntax/vim.vim Wed Jun 26 21:31:25 2013 +0900
@@ -104,7 +104,7 @@
" All vimCommands are contained by vimIsCommands. {{{2
syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
syn match vimIsCommand "\<\h\w*\>" contains=vimCommand
-syn match vimVar contained "\<\h\w*\>"
+syn match vimVar contained "\<\h[a-zA-Z0-9:#_]*\>"
syn match vimVar "\<[bwglsav]:\h\w*\>"
syn match vimFBVar contained "\<[bwglsav]:\h\w*\>"
syn keyword vimCommand contained in
@@ -246,9 +246,9 @@
syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
syn cluster vimSubstList add=vimCollection
syn match vimSubst "\(:\+\s*\|^\s*\||\s*\)\<\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[:[:alpha:]]\@!" nextgroup=vimSubstPat
-syn match vimSubst "s\%[ubstitute][:#[:alpha:]]\@!" nextgroup=vimSubstPat contained
+syn match vimSubst "\W\?\zss\%[ubstitute][:#[:alpha:]]\@!" nextgroup=vimSubstPat contained
syn match vimSubst "/\zss\%[ubstitute]\ze/" nextgroup=vimSubstPat
-syn match vimSubst1 contained "s\%[ubstitute]\>" nextgroup=vimSubstPat
+syn match vimSubst1 contained "\<s\%[ubstitute]\>" nextgroup=vimSubstPat
syn region vimSubstPat contained matchgroup=vimSubstDelim start="\z([^a-zA-Z( \t[\]&]\)"rs=s+1 skip="\\\\\|\\\z1" end="\z1"re=e-1,me=e-1 contains=@vimSubstList nextgroup=vimSubstRep4 oneline
syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline
syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment