1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:30:04 +08:00
SpaceVim/syntax/SpaceVimTasksInfo.vim

26 lines
864 B
VimL
Raw Normal View History

2020-10-01 22:30:29 +08:00
if exists('b:current_syntax') && b:current_syntax ==# 'SpaceVimTasksInfo'
finish
endif
let b:current_syntax = 'SpaceVimTasksInfo'
syntax case ignore
syn match TaskName /^\[.*\]/
syn match TaskTitle /^Task\s\+Type\s\+Command/
" @question Why \zs does not work in syntax file?
" ref:
" https://github.com/vim/vim/issues/598
" https://stackoverflow.com/questions/49323753/vim-syntax-file-not-matching-with-zs
" https://stackoverflow.com/questions/64153655/why-taskinfo-syntax-file-does-not-work-as-expect
" syn match TaskType /^\[.*\]\s*\zs[a-z]*/
" syn match TaskDescription /^\[.*\]\s*[a-z]*\s\+\zs.*/
syn match TaskType /\(^\[.\+\]\s\+\)\@<=[a-z]*/
syn match TaskDescription /\(^\[.*\]\s\+[a-z]\+\s\+\)\@<=.*/
hi def link TaskTitle Title
hi def link TaskName String
hi def link TaskType Todo
hi def link TaskDescription Comment