Jelajahi Sumber

New highlight group: StartifyVar

References #197.
Marco Hinz 10 tahun lalu
induk
melakukan
5c50a1c669
2 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 2 0
      doc/startify.txt
  2. 3 1
      syntax/startify.vim

+ 2 - 0
doc/startify.txt

@@ -478,6 +478,7 @@ relative by nature.
     let g:startify_use_env = 0
     let g:startify_use_env = 0
 <
 <
 Show environment variables in path, if their name is shorter than their value.
 Show environment variables in path, if their name is shorter than their value.
+See |startify-colors| for highlighting them.
 
 
 $PWD and $OLDPWD are ignored.
 $PWD and $OLDPWD are ignored.
 
 
@@ -593,6 +594,7 @@ these groups:
     StartifySelect   |  selected entries        |  linked to Title
     StartifySelect   |  selected entries        |  linked to Title
     StartifySlash    |  slashes in paths        |  <none>
     StartifySlash    |  slashes in paths        |  <none>
     StartifySpecial  |  <empty buffer>,<quit>   |  <none>
     StartifySpecial  |  <empty buffer>,<quit>   |  <none>
+    StartifyVar      |  environment variables   |  linked to StartifyPath
 
 
 Example: (my terminal emulator supports 256 colors)
 Example: (my terminal emulator supports 256 colors)
 >
 >

+ 3 - 1
syntax/startify.vim

@@ -18,13 +18,14 @@ syntax match StartifyBracket /.*\%9c/ contains=
 syntax match StartifySpecial /\V<empty buffer>\|<quit>/
 syntax match StartifySpecial /\V<empty buffer>\|<quit>/
 syntax match StartifyNumber  /^\s*\[\zs[^BSVT]\{-}\ze\]/
 syntax match StartifyNumber  /^\s*\[\zs[^BSVT]\{-}\ze\]/
 syntax match StartifySelect  /^\s*\[\zs[BSVT]\{-}\ze\]/
 syntax match StartifySelect  /^\s*\[\zs[BSVT]\{-}\ze\]/
+syntax match StartifyVar     /\$[^\/]\+/
 syntax match StartifyFile    /.*/ contains=
 syntax match StartifyFile    /.*/ contains=
       \ StartifyBracket,
       \ StartifyBracket,
       \ StartifyPath,
       \ StartifyPath,
       \ StartifySpecial,
       \ StartifySpecial,
 
 
 execute 'syntax match StartifySlash /\'. s:sep .'/'
 execute 'syntax match StartifySlash /\'. s:sep .'/'
-execute 'syntax match StartifyPath /\%9c.*\'. s:sep .'/ contains=StartifySlash'
+execute 'syntax match StartifyPath /\%9c.*\'. s:sep .'/ contains=StartifySlash,StartifyVar'
 
 
 if exists('g:startify_custom_header')
 if exists('g:startify_custom_header')
   execute 'syntax region StartifyHeader start=/\%1l/ end=/\%'. (len(g:startify_custom_header) + 2) .'l/'
   execute 'syntax region StartifyHeader start=/\%1l/ end=/\%'. (len(g:startify_custom_header) + 2) .'l/'
@@ -50,5 +51,6 @@ highlight default link StartifySection Statement
 highlight default link StartifySelect  Title
 highlight default link StartifySelect  Title
 highlight default link StartifySlash   Delimiter
 highlight default link StartifySlash   Delimiter
 highlight default link StartifySpecial Comment
 highlight default link StartifySpecial Comment
+highlight default link StartifyVar     StartifyPath
 
 
 let b:current_syntax = 'startify'
 let b:current_syntax = 'startify'