29533
|
1 " Vim syntax file
|
|
2 " Language: sway window manager config
|
|
3 " Original Author: James Eapen <james.eapen@vai.org>
|
|
4 " Maintainer: James Eapen <james.eapen@vai.org>
|
29756
|
5 " Version: 0.11.1
|
|
6 " Last Change: 2022 Aug 08
|
29533
|
7
|
|
8 " References:
|
|
9 " http://i3wm.org/docs/userguide.html#configuring
|
|
10 " https://github.com/swaywm/sway/blob/b69d637f7a34e239e48a4267ae94a5e7087b5834/sway/sway.5.scd
|
|
11 " http://vimdoc.sourceforge.net/htmldoc/syntax.html
|
|
12 "
|
|
13 "
|
|
14 " Quit when a syntax file was already loaded
|
|
15 if exists("b:current_syntax")
|
|
16 finish
|
|
17 endif
|
|
18
|
|
19 runtime! syntax/i3config.vim
|
|
20
|
|
21 scriptencoding utf-8
|
|
22
|
|
23 " Error
|
|
24 "syn match swayConfigError /.*/
|
|
25
|
|
26 " Group mode/bar
|
|
27 syn keyword swayConfigBlockKeyword set input contained
|
|
28 syn region swayConfigBlock start=+.*s\?{$+ end=+^}$+ contains=i3ConfigBlockKeyword,swayConfigBlockKeyword,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigFont,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
|
|
29
|
|
30 " binding
|
|
31 syn keyword swayConfigBindKeyword bindswitch bindgesture contained
|
|
32 syn match swayConfigBind /^\s*\(bindswitch\)\s\+.*$/ contains=i3ConfigVariable,i3ConfigBindKeyword,swayConfigBindKeyword,i3ConfigVariableAndModifier,i3ConfigNumber,i3ConfigUnit,i3ConfigUnitOr,i3ConfigBindArgument,i3ConfigModifier,i3ConfigAction,i3ConfigString,i3ConfigGapStyleKeyword,i3ConfigBorderStyleKeyword
|
|
33
|
|
34 " bindgestures
|
|
35 syn keyword swayConfigBindGestureCommand swipe pinch hold contained
|
|
36 syn keyword swayConfigBindGestureDirection up down left right next prev contained
|
|
37 syn keyword swayConfigBindGesturePinchDirection inward outward clockwise counterclockwise contained
|
|
38 syn match swayConfigBindGestureHold /^\s*\(bindgesture\)\s\+hold\(:[1-5]\)\?\s\+.*$/ contains=swayConfigBindKeyword,swayConfigBindGestureCommand,swayConfigBindGestureDirection,i3ConfigWorkspaceKeyword,i3ConfigAction
|
29756
|
39 syn match swayConfigBindGestureSwipe /^\s*\(bindgesture\)\s\+swipe\(:[3-5]\)\?:\(up\|down\|left\|right\)\s\+.*$/ contains=swayConfigBindKeyword,swayConfigBindGestureCommand,swayConfigBindGestureDirection,i3ConfigWorkspaceKeyword,i3ConfigAction
|
|
40 syn match swayConfigBindGesturePinch /^\s*\(bindgesture\)\s\+pinch\(:[2-5]\)\?:\(up\|down\|left\|right\|inward\|outward\|clockwise\|counterclockwise\)\(+\(up\|down\|left\|right\|inward\|outward\|clockwise\|counterclockwise\)\)\?.*$/ contains=swayConfigBindKeyword,swayConfigBindGestureCommand,swayConfigBindGestureDirection,swayConfigBindGesturePinchDirection,i3ConfigWorkspaceKeyword,i3ConfigAction
|
29533
|
41
|
|
42 " floating
|
|
43 syn keyword swayConfigFloatingKeyword floating contained
|
|
44 syn match swayConfigFloating /^\s*floating\s\+\(enable\|disable\|toggle\)\s*$/ contains=swayConfigFloatingKeyword
|
|
45
|
|
46 syn clear i3ConfigFloatingModifier
|
|
47 syn keyword swayConfigFloatingModifier floating_modifier contained
|
|
48 syn match swayConfigFloatingMouseAction /^\s\?.*floating_modifier\s.*\(normal\|inverted\)$/ contains=swayConfigFloatingModifier,i3ConfigVariable
|
|
49
|
|
50 " Gaps
|
|
51 syn clear i3ConfigSmartBorderKeyword
|
|
52 syn clear i3ConfigSmartBorder
|
|
53 syn keyword swayConfigSmartBorderKeyword on no_gaps off contained
|
|
54 syn match swayConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\|off\)\s\?$/ contains=swayConfigSmartBorderKeyword
|
|
55
|
|
56 " Changing colors
|
|
57 syn keyword swayConfigClientColorKeyword focused_tab_title contained
|
|
58 syn match swayConfigClientColor /^\s*client.\w\+\s\+.*$/ contains=i3ConfigClientColorKeyword,i3ConfigColor,i3ConfigVariable,i3ConfigClientColorKeyword,swayConfigClientColorKeyword
|
|
59
|
|
60 " set display outputs
|
|
61 syn match swayConfigOutput /^\s*output\s\+.*$/ contains=i3ConfigOutput
|
|
62
|
|
63 " set display focus
|
|
64 syn keyword swayConfigFocusKeyword focus contained
|
|
65 syn keyword swayConfigFocusType output contained
|
|
66 syn match swayConfigFocus /^\s*focus\soutput\s.*$/ contains=swayConfigFocusKeyword,swayConfigFocusType
|
|
67
|
|
68 " xwayland
|
|
69 syn keyword swayConfigXwaylandKeyword xwayland contained
|
|
70 syn match swayConfigXwaylandModifier /^\s*xwayland\s\+\(enable\|disable\|force\)\s\?$/ contains=swayConfigXwaylandKeyword
|
|
71
|
|
72 "hi def link swayConfigError Error
|
|
73 hi def link i3ConfigFloating Error
|
|
74 hi def link swayConfigFloating Type
|
|
75 hi def link swayConfigFloatingMouseAction Type
|
|
76 hi def link swayConfigFocusKeyword Type
|
|
77 hi def link swayConfigSmartBorderKeyword Type
|
|
78 hi def link swayConfigBindGestureCommand Identifier
|
|
79 hi def link swayConfigBindGestureDirection Constant
|
|
80 hi def link swayConfigBindGesturePinchDirection Constant
|
|
81 hi def link swayConfigBindKeyword Identifier
|
|
82 hi def link swayConfigBlockKeyword Identifier
|
|
83 hi def link swayConfigClientColorKeyword Identifier
|
|
84 hi def link swayConfigFloatingKeyword Identifier
|
|
85 hi def link swayConfigFloatingModifier Identifier
|
|
86 hi def link swayConfigFocusType Identifier
|
|
87 hi def link swayConfigSmartBorder Identifier
|
|
88 hi def link swayConfigXwaylandKeyword Identifier
|
|
89 hi def link swayConfigXwaylandModifier Type
|
|
90 hi def link swayConfigBindGesture PreProc
|
|
91
|
|
92 let b:current_syntax = "swayconfig"
|