├── ftdetect └── hypr.vim ├── ftplugin └── hypr.vim └── syntax └── hypr.vim /ftdetect/hypr.vim: -------------------------------------------------------------------------------- 1 | augroup hypr_ftdetect 2 | au! 3 | au BufRead,BufNewFile *hypr/*.conf,*hypr/*/*.conf set ft=hypr 4 | augroup END 5 | -------------------------------------------------------------------------------- /ftplugin/hypr.vim: -------------------------------------------------------------------------------- 1 | setlocal commentstring=#\ %s 2 | -------------------------------------------------------------------------------- /syntax/hypr.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: Hyprland config file 3 | " Maintainer: Gabriel Carneiro 4 | " Latest Revision: 26 October 2022 5 | 6 | if exists("b:current_syntax") 7 | finish 8 | endif 9 | 10 | " Strings 11 | syn match Path "\(\.\|\~\)\/.*" display 12 | syn match Symbol "=" skipwhite display nextgroup=Value 13 | syn match Str "[a-zA-Z _ .-\"\'?]\+$" contained display 14 | syn match Num "\d\+\(\.\d\+\)\?" contained display 15 | syn match Num "e[+-]\d\+" contained display 16 | syn match Num "[+-]\d\+\(\.\d\+\)\?" contained display 17 | syn match ShellVar "\$\w\+" contained display 18 | syn keyword Logical on off true false no yes contained display 19 | syn region HyprSimpleString keepend start='[^ \t]' end='$\|#' contained contains=HyprVar,HyprComment 20 | syn match HyprQuotedString '"[^"]\+"' contained 21 | syn cluster HyprString contains=HyprSimpleString,HyprQuotedString 22 | 23 | " Settings 24 | syn keyword Block input general animations decoration gestures misc dwindle master plugin binds group xwayland 25 | syn region OptBlock start="{" end="}" fold transparent display contains=HyprVar,Value,OptBlock,Num,Str,HyprComment,Disp,ShellVar 26 | syn match HyprVar '\s[a-z _ .]\+ ' skipwhite contained display nextgroup=Symbol 27 | syn region Value start="=" end="$\|," transparent display contains=Str,Num,Logical,ShellVar,Path,HyprComment,Disp,Dispatchers 28 | syn match Disp '[a-zA-Z][a-zA-Z0-9 _.]\+,' contained display contains=Num 29 | syn match N ', [a-zA-Z][a-zA-Z0-9 _.]\+,' contained skipwhite 30 | 31 | " Commands 32 | syn region Command start='^[a-zA-Z][a-zA-Z_. -]\+ =' end='$' skipwhite transparent contains=HyprKeyModifier,ShellVar,HyprConfigCommand,Dispatchers,HyprComment,Str,Disp,Path,Num 33 | syn keyword HyprKeyModifier SUPER SHIFT CTRL ALT Mod1 Mod2 Mod3 Mod4 Mod5 Mode_switch nextgroup=N 34 | syn keyword HyprConfigCommand bind bindm monitor source windowrule nextgroup=Symbol contained 35 | 36 | " Comments 37 | syn keyword HyprTodo contained TODO FIXME XXX NOTE 38 | syn match HyprComment "\(#\|\/\/\).*$" contains=HyprTodo 39 | 40 | 41 | highlight link Dispatchers Special 42 | highlight link Windowrules Special 43 | highlight link Disp Special 44 | 45 | highlight link Num Constant 46 | highlight link NumRule Constant 47 | 48 | highlight link HyprVar Identifier 49 | highlight link HyprConfigCommand Identifier 50 | 51 | highlight link HyprKeyModifier Constant 52 | highlight link KeyBind Constant 53 | highlight link Logical Constant 54 | 55 | highlight link Str String 56 | highlight link BindCmd String 57 | highlight link Path String 58 | highlight link HyprSimpleString String 59 | highlight link HyprQuotedString String 60 | 61 | highlight link Block Define 62 | 63 | highlight link ShellVar Define 64 | 65 | highlight link HyprTodo Todo 66 | highlight link HyprComment Comment 67 | --------------------------------------------------------------------------------