sxhkd.vim 819 B

123456789101112131415161718192021222324252627
  1. if exists("b:current_syntax")
  2. finish
  3. endif
  4. let b:current_syntax = "sxhkd"
  5. syntax match sxhkd_binding "\v^.*$" contains=sxhkd_on_release,sxhkd_binding_pass
  6. syntax match sxhkd_on_release "\v^\@" contained
  7. syntax match sxhkd_binding_pass "\v^\~" contained
  8. syntax match sxhkd_exec "\v^\s+.*" contains=@sxhkd_shell
  9. syntax match sxhkd_comment "\v#.*$"
  10. highlight link sxhkd_comment Comment
  11. highlight link sxhkd_binding Identifier
  12. highlight link sxhkd_binding_on_release Conditional
  13. highlight link sxhkd_binding_pass Constant
  14. highlight link sxhkd_exec Macro
  15. " match shell command
  16. let s:current_syntax = b:current_syntax
  17. unlet b:current_syntax
  18. syntax include @sxhkd_shell syntax/sh.vim
  19. let b:current_syntax = s:current_syntax
  20. syntax region shLine matchgroup=sxhkd_exec start=/\v^\s+\s/ end=/\v$/ contains=@sxhkd_shell