Browse Source

New highlight group: StartifyVar

References #197.
Marco Hinz 10 years ago
parent
commit
5c50a1c669
2 changed files with 5 additions and 1 deletions
  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
 <
 Show environment variables in path, if their name is shorter than their value.
+See |startify-colors| for highlighting them.
 
 $PWD and $OLDPWD are ignored.
 
@@ -593,6 +594,7 @@ these groups:
     StartifySelect   |  selected entries        |  linked to Title
     StartifySlash    |  slashes in paths        |  <none>
     StartifySpecial  |  <empty buffer>,<quit>   |  <none>
+    StartifyVar      |  environment variables   |  linked to StartifyPath
 
 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 StartifyNumber  /^\s*\[\zs[^BSVT]\{-}\ze\]/
 syntax match StartifySelect  /^\s*\[\zs[BSVT]\{-}\ze\]/
+syntax match StartifyVar     /\$[^\/]\+/
 syntax match StartifyFile    /.*/ contains=
       \ StartifyBracket,
       \ StartifyPath,
       \ StartifySpecial,
 
 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')
   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 StartifySlash   Delimiter
 highlight default link StartifySpecial Comment
+highlight default link StartifyVar     StartifyPath
 
 let b:current_syntax = 'startify'