summaryrefslogtreecommitdiffstats
path: root/syntax/sxhkdrc.vim
blob: b72b8600139dc61938423d575f37f461873748b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
if polyglot#init#is_disabled(expand('<sfile>:p'), 'sxhkd', 'syntax/sxhkdrc.vim')
  finish
endif

if exists("b:current_syntax")
    finish
endif

syntax include @Shell syntax/sh.vim

syn match sxComment "^#.*$"
syn match sxHotkey "[^ #].*" contains=sxKeysym,sxModifier,sxHotkeySep,sxSequence
syn match sxCommand "^\s.*$" containedin=ALL contains=@Shell,sxSequenceShell
syn keyword sxModifier super hyper meta alt control ctrl shift mode_switch lock mod1 mod2 mod3 mod4 mod5 any contained
syn match sxKeysym "[^ :;{,}+-]\+" contained contains=sxAction
syn match sxAction "[@~/]" contained
syn match sxHotkeySep "[;:+]" contained
syn match sxSequenceSep "[,-]" contained
syn region sxSequence matchgroup=sxBrace start=/{/ end=/}/ contained keepend oneline contains=sxKeysym,sxModifier,sxHotkeySep,sxSequenceSep
syn region sxSequenceShell matchgroup=sxBrace start=/{/ end=/}/ contained keepend oneline contains=sxKeysym,sxSequenceSep

hi def link sxComment Comment
hi def link sxModifier Keyword
hi def link sxKeysym Identifier
hi def link sxAction Special
hi def link sxBrace Special
hi def link sxHotkeySep Delimiter
hi def link sxSequenceSep Delimiter

let b:current_syntax = "sxhkdrc"