Skip to content

Commit 20e78ee

Browse files
qwertviopchrisbra
authored andcommitted
runtime(swayconfig): support new config options in syntax script
From sway(5): - allow_tearing - primary_selection - swaybg_command - swaynag_command From sway-output(5): - color_profile - allow_tearing From sway-input(5): - clickfinger_button_map - rotation_angle - scroll_button_lock closes: #18293 Signed-off-by: Felix Pehla <[email protected]> Signed-off-by: James Eapen <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 24f0dbb commit 20e78ee

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

runtime/syntax/swayconfig.vim

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
" Maintainer: James Eapen <[email protected]>
55
" Version: 1.2.4
66
" Last Change: 2024 Oct 17
7+
" 2025 Sep 23 by Vim Project update swayconfig syntax #18293
78

89
" References:
910
" http://i3wm.org/docs/userguide.html#configuring
@@ -60,6 +61,14 @@ syn keyword i3ConfigKeyword xwayland contained skipwhite nextgroup=swayConfigXOp
6061
syn keyword swayConfigInhibitOpts focus fullscreen open none visible contained
6162
syn keyword i3ConfigActionKeyword inhibit_idle contained skipwhite nextgroup=swayConfigInhibitOpts
6263

64+
" Primary selection
65+
" Allow tearing
66+
syn keyword i3ConfigKeyword primary_selection allow_tearing contained skipwhite nextgroup=i3ConfigBoolean
67+
68+
" Swaybg command
69+
" Swaynag command
70+
syn keyword i3ConfigKeyword swaybg_command swaynag_command contained nextgroup=i3ConfigExec
71+
6372
" Bindswitch
6473
syn match swayConfigBindswitchArgument /--\(locked\|no-warn\|reload\) / contained nextgroup=swayConfigBindswitchArgument,swayConfigBindswitchType
6574
syn keyword swayConfigBindswitchType lid tablet contained nextgroup=swayConfigBindswitchCombo
@@ -88,14 +97,16 @@ syn match i3ConfigKeyword /titlebar_padding \(\d\+\|\$\S\+\)\( \d\+\)\?$/ contai
8897
syn match swayConfigDeviceOper /[*:;!]/ contained
8998

9099
" Input devices
91-
syn keyword swayConfigInputOpts xkb_variant xkb_rules xkb_switch_layout xkb_numlock xkb_file xkb_capslock xkb_model repeat_delay repeat_rate map_to_output map_to_region map_from_region tool_mode accel_profile dwt dwtp drag_lock drag click_method middle_emulation tap events calibration_matrix natural_scroll left_handed pointer_accel scroll_button scroll_factor scroll_method tap_button_map contained skipwhite nextgroup=swayConfigInputOptVals,@i3ConfigValue
100+
syn keyword swayConfigInputOpts xkb_variant xkb_rules xkb_switch_layout xkb_numlock xkb_file xkb_capslock xkb_model repeat_delay repeat_rate map_to_output map_to_region map_from_region tool_mode accel_profile dwt dwtp drag_lock drag click_method clickfinger_button_map middle_emulation tap events calibration_matrix natural_scroll left_handed pointer_accel scroll_button scroll_button_lock scroll_factor scroll_method tap_button_map contained skipwhite nextgroup=swayConfigInputOptVals,@i3ConfigValue
92101
syn keyword swayConfigInputOptVals absolute relative adaptive flat none button_areas clickfinger toggle two_finger edge on_button_down lrm lmr next prev pen eraser brush pencil airbrush disabled_on_external_mouse disable enable contained skipwhite nextgroup=swayConfigInputOpts,@i3ConfigValue,swayConfigDeviceOper
93102
syn match swayConfigDeviceOper /,/ contained nextgroup=swayConfigXkbOptsPair,swayConfigXkbLayout
94103
syn match swayConfigXkbLayout /[a-z]\+/ contained nextgroup=swayConfigDeviceOper
95104
syn keyword swayConfigInputOpts xkb_layout contained skipwhite nextgroup=swayConfigXkbLayout
96105
syn match swayConfigXkbOptsPairVal /[0-9a-z_-]\+/ contained contains=i3ConfigNumber skipwhite nextgroup=swayConfigDeviceOper,swayConfigInputOpts
97106
syn match swayConfigXkbOptsPair /[a-z]\+:/ contained contains=i3ConfigColonOperator nextgroup=swayConfigXkbOptsPairVal
98107
syn keyword swayConfigInputOpts xkb_options contained skipwhite nextgroup=swayConfigXkbOptsPair
108+
syn match swayConfigInputAngle /\(3[0-5][0-9]\|[1-2]\?[0-9]\{1,2\}\)\(\.[0-9]\+\)\?/ skipwhite nextgroup=swayConfigInputOpts
109+
syn keyword swayConfigInputOpts rotation_angle contained skipwhite nextgroup=swayConfigInputAngle
99110

100111
syn region swayConfigInput start=/\s/ skip=/\\$/ end=/\ze[,;]\|$/ contained contains=swayConfigInputOpts,@i3ConfigValue keepend
101112
syn region swayConfigInput matchgroup=i3ConfigParen start=/ {$/ end=/^\s*}$/ contained contains=swayConfigInputOpts,@i3ConfigValue,i3ConfigComment keepend extend
@@ -118,8 +129,8 @@ syn match swayConfigSeatIdent /[^ ]\+/ contained contains=i3ConfigOutputIdent sk
118129
syn keyword i3ConfigKeyword seat contained skipwhite nextgroup=swayConfigSeatIdent
119130

120131
" Output monitors
121-
syn keyword swayConfigOutputOpts mode resolution res modeline position pos scale scale_filter subpixel transform disable enable power dpms max_render_time adaptive_sync render_bit_depth contained skipwhite nextgroup=swayConfigOutputOptVals,@i3ConfigValue,swayConfigOutputMode
122-
syn keyword swayConfigOutputOptVals linear nearest smart rgb bgr vrgb vbgr none clockwise anticlockwise toggle contained skipwhite nextgroup=swayConfigOutputOptVals,@i3ConfigValue
132+
syn keyword swayConfigOutputOpts mode resolution res modeline position pos scale scale_filter subpixel transform disable enable power dpms max_render_time adaptive_sync render_bit_depth color_profile allow_tearing contained skipwhite nextgroup=swayConfigOutputOptVals,@i3ConfigValue,swayConfigOutputMode
133+
syn keyword swayConfigOutputOptVals linear nearest smart rgb bgr vrgb vbgr none clockwise anticlockwise toggle srgb icc contained skipwhite nextgroup=swayConfigOutputOptVals,@i3ConfigValue,i3ConfigShOper
123134
syn keyword swayConfigOutputBgVals solid_color fill stretch fit center tile contained skipwhite nextgroup=@i3ConfigColVar
124135
syn match swayConfigOutputBg /[#$]\S\+ solid_color/ contained contains=@i3ConfigColVar,swayConfigOutputBgVals
125136
syn match swayConfigOutputBg /[^b# '"]\S*/ contained contains=i3ConfigShOper skipwhite nextgroup=swayConfigOutputBgVals
@@ -148,6 +159,7 @@ hi def link swayConfigInputType i3ConfigMoveType
148159
hi def link swayConfigInputIdent i3ConfigMoveDir
149160
hi def link swayConfigInputOptVals i3ConfigShParam
150161
hi def link swayConfigInputOpts i3ConfigOption
162+
hi def link swayConfigInputAngle i3ConfigNumber
151163
hi def link swayConfigXkbOptsPairVal i3ConfigParamLine
152164
hi def link swayConfigXkbOptsPair i3ConfigShParam
153165
hi def link swayConfigXkbLayout i3ConfigParamLine

0 commit comments

Comments
 (0)