From 5c50a1c6696434c7c9d25a1e62036c7c66454135 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 12 Feb 2016 14:49:01 +0100 Subject: [PATCH] New highlight group: StartifyVar References #197. --- doc/startify.txt | 2 ++ syntax/startify.vim | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/startify.txt b/doc/startify.txt index 1126d32..e9f3382 100644 --- a/doc/startify.txt +++ b/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 | StartifySpecial | , | + StartifyVar | environment variables | linked to StartifyPath Example: (my terminal emulator supports 256 colors) > diff --git a/syntax/startify.vim b/syntax/startify.vim index 4343ba6..d3ea456 100644 --- a/syntax/startify.vim +++ b/syntax/startify.vim @@ -18,13 +18,14 @@ syntax match StartifyBracket /.*\%9c/ contains= syntax match StartifySpecial /\V\|/ 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'