From d21d6be59ebfeb55d67a7df6fb73744f83024559 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Thu, 6 Apr 2017 22:10:53 +0800 Subject: [PATCH] Fix highlight --- autoload/SpaceVim/plugins/manager.vim | 57 +-------------------------- syntax/SpaceVimPlugManager.vim | 49 +++++++++++++++++++++++ 2 files changed, 50 insertions(+), 56 deletions(-) create mode 100644 syntax/SpaceVimPlugManager.vim diff --git a/autoload/SpaceVim/plugins/manager.vim b/autoload/SpaceVim/plugins/manager.vim index 9d6a17a35..d63773df5 100644 --- a/autoload/SpaceVim/plugins/manager.vim +++ b/autoload/SpaceVim/plugins/manager.vim @@ -111,10 +111,7 @@ function! SpaceVim#plugins#manager#update(...) abort call s:new_window() let s:plugin_manager_buffer = bufnr('%') setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nomodifiable nospell - setf spacevim - if exists('g:syntax_on') - call s:syntax() - endif + setf SpaceVimPlugManager nnoremap q :bd let s:pct = 0 let s:plugins = a:0 == 0 ? keys(dein#get()) : copy(a:1) @@ -207,58 +204,6 @@ function! s:new_window() abort execute get(g:, 'spacevim_window', 'vertical topleft new') endfunction -function! s:syntax() abort - syntax clear - syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber - syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX - syn match plugNumber /[0-9]\+[0-9.]*/ contained - syn match plugBracket /[[\]]/ contained - syn match plugX /x/ contained - syn match plugDash /^-/ - syn match plugPlus /^+/ - syn match plugStar /^*/ - syn match plugMessage /\(^- \)\@<=.*/ - syn match plugName /\(^- \)\@<=[^ ]*:/ - syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ - syn match plugTag /(tag: [^)]\+)/ - syn match plugInstall /\(^+ \)\@<=[^:]*/ - syn match plugUpdate /\(^* \)\@<=[^:]*/ - syn match plugCommit /^ \X*[0-9a-f]\{7,9} .*/ contains=plugRelDate,plugEdge,plugTag - syn match plugEdge /^ \X\+$/ - syn match plugEdge /^ \X*/ contained nextgroup=plugSha - syn match plugSha /[0-9a-f]\{7,9}/ contained - syn match plugRelDate /([^)]*)$/ contained - syn match plugNotLoaded /(not loaded)$/ - syn match plugError /^x.*/ - syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ - syn match plugH2 /^.*:\n-\+$/ - syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean - hi def link plug1 Title - hi def link plug2 Repeat - hi def link plugH2 Type - hi def link plugX Exception - hi def link plugBracket Structure - hi def link plugNumber Number - - hi def link plugDash Special - hi def link plugPlus Constant - hi def link plugStar Boolean - - hi def link plugMessage Function - hi def link plugName Label - hi def link plugInstall Function - hi def link plugUpdate Type - - hi def link plugError Error - hi def link plugDeleted Ignore - hi def link plugRelDate Comment - hi def link plugEdge PreProc - hi def link plugSha Identifier - hi def link plugTag Constant - - hi def link plugNotLoaded Comment -endfunction - " change modifiable before setline if has('nvim') function! s:set_buf_line(bufnr, nr, line) abort diff --git a/syntax/SpaceVimPlugManager.vim b/syntax/SpaceVimPlugManager.vim new file mode 100644 index 000000000..81f090446 --- /dev/null +++ b/syntax/SpaceVimPlugManager.vim @@ -0,0 +1,49 @@ +syntax clear +syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber +syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX +syn match plugNumber /[0-9]\+[0-9.]*/ contained +syn match plugBracket /[[\]]/ contained +syn match plugX /x/ contained +syn match plugDash /^-/ +syn match plugPlus /^+/ +syn match plugStar /^*/ +syn match plugMessage /\(^- \)\@<=.*/ +syn match plugName /\(^- \)\@<=[^ ]*:/ +syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ +syn match plugTag /(tag: [^)]\+)/ +syn match plugInstall /\(^+ \)\@<=[^:]*/ +syn match plugUpdate /\(^* \)\@<=[^:]*/ +syn match plugCommit /^ \X*[0-9a-f]\{7,9} .*/ contains=plugRelDate,plugEdge,plugTag +syn match plugEdge /^ \X\+$/ +syn match plugEdge /^ \X*/ contained nextgroup=plugSha +syn match plugSha /[0-9a-f]\{7,9}/ contained +syn match plugRelDate /([^)]*)$/ contained +syn match plugNotLoaded /(not loaded)$/ +syn match plugError /^x.*/ +syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ +syn match plugH2 /^.*:\n-\+$/ +syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean +hi def link plug1 Title +hi def link plug2 Repeat +hi def link plugH2 Type +hi def link plugX Exception +hi def link plugBracket Structure +hi def link plugNumber Number + +hi def link plugDash Special +hi def link plugPlus Constant +hi def link plugStar Boolean + +hi def link plugMessage Function +hi def link plugName Label +hi def link plugInstall Function +hi def link plugUpdate Type + +hi def link plugError Error +hi def link plugDeleted Ignore +hi def link plugRelDate Comment +hi def link plugEdge PreProc +hi def link plugSha Identifier +hi def link plugTag Constant + +hi def link plugNotLoaded Comment