@@ -31,37 +31,38 @@ elseif exists('b:current_syntax')
31
31
finish
32
32
endif
33
33
34
- syn region VimShellRcString start =+ '+ end =+ '+ oneline
35
- syn region VimShellRcString start =+ "+ end =+ "+ contains =VimShellQuoted oneline
36
- syn region VimShellRcString start =+ `+ end =+ `+ oneline
34
+ syn match VimShellRcCommand ' \% (^\|\s\) [[:alnum:]_.][[:alnum:]_.-]\+ [[:blank:]\n ]' contained
35
+ syn match VimShellRcVariable ' $\h\w *' contained
36
+ syn match VimShellRcVariable ' $$\h\w *' contained
37
+ syn region VimShellRcVariable start =+ ${+ end =+ }+ contained
38
+ syn region VimShellRcString start =+ '+ end =+ '+ oneline contained
39
+ syn region VimShellRcString start =+ "+ end =+ "+ contains =VimShellQuoted oneline contained
40
+ syn region VimShellRcString start =+ `+ end =+ `+ oneline contained
37
41
syn match VimShellRcString ' [''"`]$' contained
38
- syn match VimShellRcComment ' #.*$'
39
- syn match VimShellRcConstants ' [+-]\=\<\d\+\> '
40
- syn match VimShellRcConstants ' [+-]\=\< 0x\x\+\> '
41
- syn match VimShellRcConstants ' [+-]\=\< 0\o\+\> '
42
- syn match VimShellRcConstants ' [+-]\=\d\+ #[-+]\=\w\+\> '
43
- syn match VimShellRcConstants ' [+-]\=\d\+\.\d\+\( [eE][+-]\?\d\+\)\?\> '
44
- syn match VimShellRcArguments ' \s -\= -[[:alnum:]-]\+ =\= '
42
+ syn match VimShellRcComment ' #.*$' contained
43
+ syn match VimShellRcConstants ' [+-]\=\<\d\+\> ' contained
44
+ syn match VimShellRcConstants ' [+-]\=\< 0x\x\+\> ' contained
45
+ syn match VimShellRcConstants ' [+-]\=\< 0\o\+\> ' contained
46
+ syn match VimShellRcConstants ' [+-]\=\d\+ #[-+]\=\w\+\> ' contained
47
+ syn match VimShellRcConstants ' [+-]\=\d\+\.\d\+\( [eE][+-]\?\d\+\)\?\> ' contained
48
+ syn match VimShellRcArguments ' \s -\= -[[:alnum:]-]\+ =\= ' contained
45
49
syn match VimShellRcQuoted ' \\ .' contained
46
- syn match VimShellRcSpecial ' [|<>;&;]'
47
- syn match VimShellRcVariable ' $\h\w *'
48
- syn match VimShellRcVariable ' $$\h\w *'
49
- syn region VimShellRcVariable start =+ ${+ end =+ }+
50
- syn match VimShellRcCommand ' \% (^\|\s\) [[:alnum:]_.][[:alnum:]_.-]\+ [[:blank:]\n ]'
50
+ syn match VimShellRcSpecial ' [|<>;&;]' contained
51
51
if vimshell#iswin ()
52
52
syn match VimShellRcArguments ' \s /[?:,_[:alnum:]]\+\z e\% (\s\| $\) ' contained
53
53
syn match VimShellRcDirectory ' \% (\f\s\?\)\+ [/\\ ]\z e\% (\s\| $\) '
54
54
else
55
55
syn match VimShellRcDirectory ' \% (\f\s\?\)\+ /\z e\% (\s\| $\) '
56
56
endif
57
- let s: vim_syntax_path = split (globpath (&rtp , ' syntax/vim.vim' ), ' \n' )
58
- if ! empty (s: vim_syntax_path ) && filereadable (s: vim_syntax_path [0 ])
59
- unlet ! b: current_syntax
60
- execute ' syn include @VimShellRcVimScript' s: vim_syntax_path [0 ]
61
- syn region VimShellRcVimScriptRegion start =+ ^\s *vexe\s\+ "\z s$+ end =+ "\z s$+ contains =@VimShellRcVimScript
62
- syn region VimShellRcVimScriptRegion start =+ ^\s *vexe\s\+ '\z s$+ end =+ '\z s$+ contains =@VimShellRcVimScript
63
- endif
64
- unlet s: vim_syntax_path
57
+
58
+ syn region VimShellRcVimShellScriptRegion start =' \z s\<\f\+ ' end =' \z s$' contains =VimShellRcCommand,VimShellRcVariable,VimShellRcString,VimShellRcComment,VimShellRcConstants,VimShellRcArguments,VimShellRcQuoted,VimShellRcSpecial,VimShellRcDirectory
59
+ syn region VimShellRcCommentRegion start =' #' end =' \z s$'
60
+ syn cluster VimShellRcBodyList contains =VimShellRcVimShellScriptRegion,VimShellRcComment
61
+
62
+ unlet ! b: current_syntax
63
+ syn include @VimShellRcVimScript syntax/vim.vim
64
+ syn region VimShellRcVimScriptRegion start =- \< vexe\s\+\z (["']\)\z s$- end =+ \z 1\z s$+ contains =@VimShellRcVimScript
65
+ syn cluster VimShellRcBodyList add =VimShellRcVimScriptRegion
65
66
66
67
hi def link VimShellRcQuoted Special
67
68
hi def link VimShellRcString Constant
@@ -70,6 +71,7 @@ hi def link VimShellRcConstants Constant
70
71
hi def link VimShellRcSpecial PreProc
71
72
hi def link VimShellRcVariable Comment
72
73
hi def link VimShellRcComment Identifier
74
+ hi def link VimShellRcCommentRegion Identifier
73
75
hi def link VimShellRcNormal Normal
74
76
75
77
hi def link VimShellRcCommand Statement
0 commit comments