mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 07:20:04 +08:00
Add highlight of SpaceVimLayerManager buffer
This commit is contained in:
parent
cd0b47f769
commit
3a8d59e93a
@ -41,8 +41,16 @@ function! s:find_layers() abort
|
||||
if layer =~# pattern
|
||||
let name = layer[matchend(layer, pattern):-5]
|
||||
let status = index(g:spacevim_plugin_groups, substitute(name, '/', '#','g')) ? 'loaded' : 'not loaded'
|
||||
let website = 'https://spacevim.org/layers/' . name
|
||||
call add(rst, name . repeat(' ', 25 - len(name)) . status . repeat(' ', 10) . website)
|
||||
if filereadable(expand('~/.SpaceVim/docs/layers/' . name . '.md'))
|
||||
let website = 'https://spacevim.org/layers/' . name
|
||||
else
|
||||
let website = 'no exists'
|
||||
endif
|
||||
if status == 'loaded'
|
||||
call add(rst, '+ ' . name . ':' . repeat(' ', 25 - len(name)) . status . repeat(' ', 10) . website)
|
||||
else
|
||||
call add(rst, '- ' . name . ':' . repeat(' ', 25 - len(name)) . status . repeat(' ', 10) . website)
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
return rst
|
||||
|
49
syntax/SpaceVimLayerManager.vim
Normal file
49
syntax/SpaceVimLayerManager.vim
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user