Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: i3 config file |
Bram Moolenaar | 2f0936c | 2022-01-08 21:51:59 +0000 | [diff] [blame] | 3 | " Original Author: Mohamed Boughaba <mohamed dot bgb at gmail dot com> |
| 4 | " Maintainer: Quentin Hibon (github user hiqua) |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 5 | " Version: 0.4.22 |
| 6 | " Reference version (JosefLitos/i3config.vim): 4.22 |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 7 | " Last Change: 2023-09-12 |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 8 | |
| 9 | " References: |
| 10 | " http://i3wm.org/docs/userguide.html#configuring |
| 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 | scriptencoding utf-8 |
| 20 | |
Bram Moolenaar | 2ecbe53 | 2022-07-29 21:36:21 +0100 | [diff] [blame] | 21 | " Error |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 22 | syn match i3ConfigError /.\+/ |
Bram Moolenaar | 2ecbe53 | 2022-07-29 21:36:21 +0100 | [diff] [blame] | 23 | |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 24 | " Todo |
| 25 | syn keyword i3ConfigTodo TODO FIXME XXX contained |
| 26 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 27 | " Helper type definitions |
| 28 | syn match i3ConfigSeparator /[,;]/ contained |
| 29 | syn match i3ConfigParen /[{}]/ contained |
| 30 | syn keyword i3ConfigBoolean yes no enabled disabled on off true false contained |
| 31 | syn region i3ConfigString start=/\W\@<="/ skip=/\\"/ end=/"/ contained contains=i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigVariable,i3ConfigExecAction keepend extend |
| 32 | syn region i3ConfigString start=/\W\@<='/ end=/'/ contained contains=i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigVariable,i3ConfigExecAction keepend extend |
| 33 | syn match i3ConfigColor /#\w\{3,8}/ contained |
| 34 | syn match i3ConfigNumber /[a-zA-Z_$-]\@<!-\?\d\+\w\@!/ contained |
| 35 | |
| 36 | " 4.1 Include directive |
| 37 | syn keyword i3ConfigIncludeKeyword include contained |
| 38 | syn match i3ConfigIncludeCommand /`[^`]*`/ contained contains=i3ConfigShDelim,i3ConfigShParam,i3ConfigShOper,i3ConfigShCommand |
| 39 | syn match i3ConfigInclude /^include .*$/ contains=i3ConfigIncludeKeyword,i3ConfigString,i3ConfigVariable,i3ConfigIncludeCommand |
| 40 | |
| 41 | " 4.2 Comments |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 42 | syn match i3ConfigComment /^\s*#.*$/ contains=i3ConfigTodo |
| 43 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 44 | " 4.3 Fonts |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 45 | syn keyword i3ConfigFontKeyword font contained |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 46 | syn match i3ConfigColonOperator /:/ contained |
| 47 | syn match i3ConfigFontNamespace /\w\+:/ contained contains=i3ConfigColonOperator |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 48 | syn match i3ConfigFontSize /\s\=\d\+\(px\)\?\s\?$/ contained |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 49 | syn region i3ConfigFont start=/^\s*font / skip=/\\$/ end=/$/ contains=i3ConfigFontKeyword,i3ConfigFontNamespace,i3ConfigFontSize,i3ConfigSeparator keepend |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 50 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 51 | " 4.4-4.5 Keyboard/Mouse bindings |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 52 | syn keyword i3ConfigBindKeyword bindsym bindcode contained |
| 53 | syn match i3ConfigBindArgument /--\(release\|border\|whole-window\|exclude-titlebar\)/ contained |
| 54 | syn match i3ConfigBindModifier /+/ contained |
| 55 | syn match i3ConfigBindModkey /Ctrl\|Shift\|Mod[1-5]/ contained |
| 56 | syn match i3ConfigBindCombo /[$a-zA-Z0-9_+]\+ / contained contains=i3ConfigBindModifier,i3ConfigVariable,i3ConfigBindModkey |
| 57 | syn match i3ConfigBindComboLine /bind\(sym\|code\)\( --[a-z-]\+\)* [$a-zA-Z0-9_+]\+ / contained contains=i3ConfigBindKeyword,i3ConfigBindArgument,i3ConfigBindCombo |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 58 | syn region i3ConfigBind start=/^\s*bind\(sym\|code\) / skip=/\\$/ end=/$/ contains=i3ConfigBindComboLine,i3ConfigCriteria,i3ConfigAction,i3ConfigSeparator,i3ConfigActionKeyword,i3ConfigOption,i3ConfigString,i3ConfigNumber,i3ConfigVariable,i3ConfigBoolean keepend |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 59 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 60 | " 4.6 Binding modes |
| 61 | syn region i3ConfigKeyword start=/^mode\( --pango_markup\)\? \([^'" {]\+\|'[^']\+'\|".\+"\)\s\+{$/ end=/^\s*}$/ contains=i3ConfigShParam,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigNumber,i3ConfigParen,i3ConfigVariable fold keepend extend |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 62 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 63 | " 4.7 Floating modifier |
| 64 | syn match i3ConfigKeyword /^floating_modifier [$a-zA-Z0-9+]\+$/ contains=i3ConfigVariable,i3ConfigBindModkey |
| 65 | |
| 66 | " 4.8 Floating window size |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 67 | syn keyword i3ConfigSizeSpecial x contained |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 68 | syn match i3ConfigSize / -\?\d\+ x -\?\d\+/ contained contains=i3ConfigSizeSpecial,i3ConfigNumber |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 69 | syn match i3ConfigKeyword /^floating_\(maximum\|minimum\)_size .*$/ contains=i3ConfigSize |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 70 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 71 | " 4.9 Orientation |
| 72 | syn keyword i3ConfigOrientationOpts vertical horizontal auto contained |
| 73 | syn match i3ConfigKeyword /^default_orientation \w*$/ contains=i3ConfigOrientationOpts |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 74 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 75 | " 4.10 Layout mode |
| 76 | syn keyword i3ConfigWorkspaceLayoutOpts default stacking tabbed contained |
| 77 | syn match i3ConfigKeyword /^workspace_layout \w*$/ contains=i3ConfigWorkspaceLayoutOpts |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 78 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 79 | " 4.11 Title alignment |
| 80 | syn keyword i3ConfigTitleAlignOpts left center right contained |
| 81 | syn match i3ConfigKeyword /^title_align .*$/ contains=i3ConfigTitleAlignOpts |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 82 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 83 | " 4.12 Border style |
| 84 | syn keyword i3ConfigBorderOpts none normal pixel contained |
| 85 | syn match i3ConfigKeyword /^default\(_floating\)\?_border .*$/ contains=i3ConfigBorderOpts,i3ConfigNumber,i3ConfigVariable |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 86 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 87 | " 4.13 Hide edge borders |
| 88 | syn keyword i3ConfigEdgeOpts none vertical horizontal both smart smart_no_gaps contained |
| 89 | syn match i3ConfigKeyword /^hide_edge_borders \w\+$/ contains=i3ConfigEdgeOpts |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 90 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 91 | " 4.14 Smart Borders |
| 92 | syn keyword i3ConfigSmartBorderOpts no_gaps contained |
| 93 | syn match i3ConfigKeyword /^smart_borders \(on\|off\|no_gaps\)$/ contains=i3ConfigSmartBorderOpts,i3ConfigBoolean |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 94 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 95 | " 4.15 Arbitrary commands |
| 96 | syn keyword i3ConfigForWindowKeyword for_window contained |
| 97 | syn region i3ConfigForWindow start=/^for_window / end=/$/ contains=i3ConfigForWindowKeyword,i3ConfigCriteria keepend |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 98 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 99 | " 4.16 No opening focus |
| 100 | syn match i3ConfigKeyword /^no_focus .*$/ contains=i3ConfigCondition |
| 101 | |
| 102 | " 4.17 Variables |
| 103 | syn match i3ConfigVariable /\$[A-Z0-9a-z_:|[\]-]\+/ |
| 104 | syn keyword i3ConfigSetKeyword set contained |
| 105 | syn match i3ConfigSet /^set \$.*$/ contains=i3ConfigVariable,i3ConfigSetKeyword,i3ConfigColor,i3ConfigString,i3ConfigNoStartupId,i3ConfigNumber,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShParam,i3ConfigShOper |
| 106 | |
| 107 | " 4.18 X resources |
| 108 | syn keyword i3ConfigResourceKeyword set_from_resource contained |
| 109 | syn match i3ConfigResource /^set_from_resource\s\+.*$/ contains=i3ConfigResourceKeyword,i3ConfigCondition,i3ConfigColor,i3ConfigVariable,i3ConfigString,i3ConfigNumber |
| 110 | |
| 111 | " 4.19 Assign clients to workspaces |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 112 | syn keyword i3ConfigAssignKeyword assign contained |
| 113 | syn match i3ConfigAssignSpecial /→/ contained |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 114 | syn match i3ConfigAssign /^assign .*$/ contains=i3ConfigAssignKeyword,i3ConfigAssignSpecial,i3ConfigCondition,i3ConfigVariable,i3ConfigString,i3ConfigNumber |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 115 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 116 | " 4.20 Executing shell commands |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 117 | syn keyword i3ConfigExecKeyword exec contained |
| 118 | syn keyword i3ConfigExecAlwaysKeyword exec_always contained |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 119 | syn match i3ConfigShCmdDelim /\$(/ contained |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 120 | syn region i3ConfigShCommand start=/\$(/ end=/)/ contained contains=i3ConfigShCmdDelim,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigString,i3ConfigNumber,i3ConfigVariable keepend extend |
| 121 | syn match i3ConfigShDelim /[[\]{}();`]\+/ contained |
| 122 | syn match i3ConfigShOper /[<>&|+=~^*!.?]\+/ contained |
| 123 | syn match i3ConfigShParam /\<-[a-zA-Z0-9_-]\+\>/ contained containedin=i3ConfigVar |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 124 | syn region i3ConfigExec start=/^\s*exec\(_always\)\?\( --no-startup-id\)\? [^{]/ skip=/\\$/ end=/$/ contains=i3ConfigExecKeyword,i3ConfigExecAlwaysKeyword,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigString,i3ConfigVariable,i3ConfigExecAction keepend |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 125 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 126 | " 4.21 Workspaces per output |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 127 | syn keyword i3ConfigWorkspaceKeyword workspace contained |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 128 | syn keyword i3ConfigWorkspaceOutput output contained |
| 129 | syn keyword i3ConfigWorkspaceDir prev next back_and_forth contained |
| 130 | syn region i3ConfigWorkspaceLine start=/^workspace / skip=/\\$/ end=/$/ contains=i3ConfigWorkspaceKeyword,i3ConfigNumber,i3ConfigString,i3ConfigGaps,i3ConfigWorkspaceOutput,i3ConfigVariable,i3ConfigBoolean,i3ConfigSeparator keepend |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 131 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 132 | " 4.22 Changing colors |
| 133 | syn match i3ConfigDotOperator /\./ contained |
| 134 | syn keyword i3ConfigClientOpts focused focused_inactive unfocused urgent placeholder background contained |
| 135 | syn match i3ConfigKeyword /^client\..*$/ contains=i3ConfigDotOperator,i3ConfigClientOpts,i3ConfigColor,i3ConfigVariable |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 136 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 137 | " 4.23 Interprocess communication |
| 138 | syn match i3ConfigIpcKeyword /ipc-socket/ contained |
| 139 | syn match i3ConfigIpc /^ipc-socket .*$/ contains=i3ConfigIpcKeyword |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 140 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 141 | " 4.24 Focus follows mouse |
| 142 | syn keyword i3ConfigFocusFollowsMouseOpts always contained |
| 143 | syn match i3ConfigFocusFollowsMouse /^focus_follows_mouse \(yes\|no\|always\)$/ contains=i3ConfigBoolean,i3ConfigFocusFollowsMouseOpts |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 144 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 145 | " 4.25 Mouse warping |
| 146 | syn keyword i3ConfigMouseWarpingOpts output container none contained |
| 147 | syn match i3ConfigMouseWarping /^mouse_warping \w*$/ contains=i3ConfigMouseWarpingOpts |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 148 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 149 | " 4.26 Popups while fullscreen |
| 150 | syn keyword i3ConfigPopupFullscreenOpts smart ignore leave_fullscreen contained |
| 151 | syn match i3ConfigPopupFullscreen /^popup_during_fullscreen \w*$/ contains=i3ConfigPopupFullscreenOpts |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 152 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 153 | " 4.27 Focus wrapping |
| 154 | syn keyword i3ConfigFocusWrappingOpts force workspace contained |
| 155 | syn match i3ConfigFocusWrapping /^focus_wrapping \(yes\|no\|force\|workspace\)$/ contains=i3ConfigBoolean,i3ConfigFocusWrappingOpts |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 156 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 157 | " 4.28 Forcing Xinerama |
| 158 | syn match i3ConfigForceXinerama /^force_xinerama \(yes\|no\)$/ contains=i3ConfigBoolean |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 159 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 160 | " 4.29 Automatic workspace back-and-forth |
| 161 | syn match i3ConfigAutomaticSwitch /^workspace_auto_back_and_forth \(yes\|no\)$/ contains=i3ConfigBoolean |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 162 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 163 | " 4.30 Delay urgency hint |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 164 | syn keyword i3ConfigTimeUnit ms contained |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 165 | syn match i3ConfigDelayUrgency /^force_display_urgency_hint \d\+ ms$/ contains=i3ConfigBoolean,i3ConfigNumber,i3ConfigTimeUnit |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 166 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 167 | " 4.31 Focus on window activation |
| 168 | syn keyword i3ConfigFocusOnActivationOpts smart urgent focus none contained |
| 169 | syn match i3ConfigFocusOnActivation /^focus_on_window_activation .*$/ contains=i3ConfigFocusOnActivationKeyword |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 170 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 171 | " 4.32 Show marks in title |
| 172 | syn match i3ConfigShowMarks /^show_marks \(yes\|no\)$/ contains=i3ConfigBoolean |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 173 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 174 | " 4.34 Tiling drag |
| 175 | syn keyword i3ConfigTilingDragOpts modifier titlebar contained |
| 176 | syn match i3ConfigTilingDrag /^tiling_drag\( off\|\( modifier\| titlebar\)\{1,2\}\)$/ contains=i3ConfigTilingOpts,i3ConfigBoolean |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 177 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 178 | " 4.35 Gaps |
| 179 | syn keyword i3ConfigGapsOpts inner outer horizontal vertical left right top bottom current all set plus minus toggle contained |
| 180 | syn region i3ConfigGaps start=/gaps/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=i3ConfigGapsOpts,i3ConfigNumber,i3ConfigVariable,i3ConfigSeparator keepend |
| 181 | syn match i3ConfigGapStyleLine /^gaps .*$/ contains=i3ConfigGaps |
| 182 | syn keyword i3ConfigSmartGapOpts inverse_outer contained |
| 183 | syn match i3ConfigSmartGap /^smart_gaps \(on\|off\|inverse_outer\)$/ contains=i3ConfigSmartGapOpts,i3ConfigBoolean |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 184 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 185 | " 5 Configuring bar |
| 186 | syn match i3ConfigBarModifier /^\s\+modifier [^ ]\+$/ contained contains=i3ConfigBindModifier,i3ConfigVariable,i3ConfigBindModkey |
| 187 | syn keyword i3ConfigBarOpts bar i3bar_command status_command mode hidden_state id position output tray_output tray_padding font separator_symbol workspace_buttons workspace_min_width strip_workspace_numbers strip_workspace_name binding_mode_indicator padding contained |
| 188 | syn region i3ConfigBarBlock start=/^bar {$/ end=/^}$/ contains=i3ConfigBarOpts,i3ConfigBarModifier,i3ConfigBind,i3ConfigString,i3ConfigComment,i3ConfigFont,i3ConfigBoolean,i3ConfigNumber,i3ConfigParen,i3ConfigColor,i3ConfigVariable,i3ConfigColorsBlock fold keepend extend |
| 189 | |
| 190 | " 5.16 Color block |
| 191 | syn match i3ConfigColorsOpts /\(focused_\)\?\(background\|statusline\|separator\)\|\(focused\|active\|inactive\|urgent\)_workspace\|binding_mode/ contained |
| 192 | syn region i3ConfigColorsBlock start=/^\s\+colors {$/ end=/^\s\+}$/ contained contains=i3ConfigColorsOpts,i3ConfigColor,i3ConfigVariable,i3ConfigComment,i3ConfigParen fold keepend extend |
| 193 | |
| 194 | " 6.0 Criteria-based commands |
| 195 | syn match i3ConfigConditionProp /\w\+\(-\w\+\)*/ contained |
| 196 | syn match i3ConfigConditionText /[^[ ]\+=/ contained contains=i3ConfigConditionProp,i3ConfigShOper |
| 197 | syn keyword i3ConfigConditionFocused __focused__ contained |
| 198 | syn region i3ConfigCondition start=/\[/ end=/\]/ contained contains=i3ConfigConditionText,i3ConfigShDelim,i3ConfigNumber,i3ConfigString,i3ConfigConditionFocused keepend extend |
| 199 | syn region i3ConfigCriteria start=/\[/ skip=/\\$/ end=/\(;\|$\)/ contained contains=i3ConfigCondition,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigBoolean,i3ConfigNumber,i3ConfigVariable,i3ConfigSeparator keepend |
| 200 | |
| 201 | " 6.1 Actions through shell |
| 202 | syn match i3ConfigExecActionKeyword /i3-msg/ contained |
| 203 | syn region i3ConfigExecAction start=/[a-z3-]\+msg '/ skip=/\\$\| '/ end=/'/ contained contains=i3ConfigExecActionKeyword,i3ConfigShCommand,i3ConfigNumber,i3ConfigShOper,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigVariable keepend extend |
| 204 | syn region i3ConfigExecAction start=/[a-z3-]\+msg "/ skip=/\\$\| "/ end=/"/ contained contains=i3ConfigExecActionKeyword,i3ConfigShCommand,i3ConfigNumber,i3ConfigShOper,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigVariable keepend extend |
| 205 | syn region i3ConfigExecAction start=/[a-z3-]\+msg\( ['"-]\)\@!/ skip=/\\$/ end=/\([&|;})'"]\|$\)/ contained contains=i3ConfigExecActionKeyword,i3ConfigShCommand,i3ConfigNumber,i3ConfigShOper,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigVariable keepend |
| 206 | " 6.1 Executing applications (4.20) |
| 207 | syn region i3ConfigAction start=/exec/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=i3ConfigExecKeyword,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigString,i3ConfigVariable,i3ConfigSeparator keepend |
| 208 | |
| 209 | " 6.3 Manipulating layout |
| 210 | syn keyword i3ConfigLayoutKeyword layout contained |
| 211 | syn keyword i3ConfigLayoutOpts default tabbed stacking splitv splith toggle split all contained |
| 212 | syn region i3ConfigAction start=/layout/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=i3ConfigLayoutKeyword,i3ConfigLayoutOpts,i3ConfigSeparator keepend |
| 213 | |
| 214 | " 6.4 Focusing containers |
| 215 | syn keyword i3ConfigFocusKeyword focus contained |
| 216 | syn keyword i3ConfigFocusOpts left right up down parent child next prev sibling floating tiling mode_toggle contained |
| 217 | syn keyword i3ConfigFocusOutputOpts left right down up current primary nonprimary next prev contained |
| 218 | syn region i3ConfigFocusOutput start=/ output / skip=/\\$/ end=/\([,;]\|$\)/ contained contains=i3ConfigMoveType,i3ConfigWorkspaceOutput,i3ConfigFocusOutputOpts,i3ConfigString,i3ConfigNumber,i3ConfigSeparator keepend |
| 219 | syn match i3ConfigFocusOutputLine /^focus output .*$/ contains=i3ConfigFocusKeyword,i3ConfigFocusOutput |
| 220 | syn region i3ConfigAction start=/focus/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=i3ConfigFocusKeyword,i3ConfigFocusOpts,i3ConfigFocusOutput,i3ConfigString,i3ConfigSeparator keepend |
| 221 | |
| 222 | " 6.8 Focusing workspaces (4.21) |
| 223 | syn region i3ConfigAction start=/workspace / skip=/\\$/ end=/\([,;]\|$\)/ contained contains=i3ConfigWorkspaceKeyword,i3ConfigWorkspaceDir,i3ConfigNumber,i3ConfigString,i3ConfigGaps,i3ConfigWorkspaceOutput,i3ConfigVariable,i3ConfigBoolean,i3ConfigSeparator keepend |
| 224 | |
| 225 | " 6.9-6.11 Moving containers |
| 226 | syn keyword i3ConfigMoveKeyword move contained |
| 227 | syn keyword i3ConfigMoveDir left right down up position absolute center to contained |
| 228 | syn keyword i3ConfigMoveType window container workspace output mark mouse scratchpad contained |
| 229 | syn match i3ConfigUnit / px\| ppt/ contained |
| 230 | syn region i3ConfigAction start=/move/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=i3ConfigMoveKeyword,i3ConfigMoveDir,i3ConfigMoveType,i3ConfigWorkspaceDir,i3ConfigUnit,i3ConfigNumber,i3ConfigVariable,i3ConfigSeparator keepend |
| 231 | |
| 232 | " 6.12 Resizing containers/windows |
| 233 | syn keyword i3ConfigResizeKeyword resize contained |
| 234 | syn keyword i3ConfigResizeOpts grow shrink up down left right set width height or contained |
| 235 | syn region i3ConfigAction start=/resize/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=i3ConfigResizeKeyword,i3ConfigResizeOpts,i3ConfigNumber,i3ConfigUnit,i3ConfigSeparator keepend |
| 236 | |
| 237 | " 6.14 VIM-like marks |
| 238 | syn keyword i3ConfigMarkKeyword mark contained |
| 239 | syn match i3ConfigMark /mark\( --\(add\|replace\)\( --toggle\)\?\)\?/ contained contains=i3ConfigMarkKeyword |
| 240 | syn region i3ConfigAction start=/\<mark/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=i3ConfigMark,i3ConfigNumber,i3ConfigString,i3ConfigSeparator keepend |
| 241 | |
| 242 | " 6.24 Changing gaps (4.35) |
| 243 | syn region i3ConfigAction start=/gaps/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=i3ConfigGaps keepend |
| 244 | |
| 245 | " Commands useable in keybinds |
| 246 | syn keyword i3ConfigActionKeyword mode append_layout kill open fullscreen sticky split floating swap rename unmark show_marks title_window_icon title_format border restart reload exit scratchpad nop bar contained |
| 247 | syn keyword i3ConfigOption enable disable toggle key restore current horizontal vertical auto none normal pixel show container with id con_id contained |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 248 | |
| 249 | " Define the highlighting. |
Bram Moolenaar | 2ecbe53 | 2022-07-29 21:36:21 +0100 | [diff] [blame] | 250 | hi def link i3ConfigError Error |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 251 | hi def link i3ConfigTodo Todo |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 252 | hi def link i3ConfigKeyword Keyword |
| 253 | hi def link i3ConfigCommand Statement |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 254 | hi def link i3ConfigOperator Operator |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 255 | hi def link i3ConfigSeparator i3ConfigOperator |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 256 | hi def link i3ConfigParen Delimiter |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 257 | hi def link i3ConfigBoolean Boolean |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 258 | hi def link i3ConfigString String |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 259 | hi def link i3ConfigColor Constant |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 260 | hi def link i3ConfigNumber Number |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 261 | hi def link i3ConfigIncludeKeyword i3ConfigKeyword |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 262 | hi def link i3ConfigInclude i3ConfigString |
| 263 | hi def link i3ConfigComment Comment |
| 264 | hi def link i3ConfigFontKeyword i3ConfigKeyword |
| 265 | hi def link i3ConfigColonOperator i3ConfigOperator |
| 266 | hi def link i3ConfigFontNamespace i3ConfigOption |
| 267 | hi def link i3ConfigFontSize i3ConfigNumber |
| 268 | hi def link i3ConfigFont i3ConfigString |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 269 | hi def link i3ConfigBindKeyword i3ConfigKeyword |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 270 | hi def link i3ConfigBindArgument i3ConfigShParam |
| 271 | hi def link i3ConfigBindModifier i3ConfigOperator |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 272 | hi def link i3ConfigBindModkey Special |
| 273 | hi def link i3ConfigBindCombo SpecialChar |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 274 | hi def link i3ConfigSizeSpecial i3ConfigOperator |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 275 | hi def link i3ConfigOrientationOpts i3ConfigOption |
| 276 | hi def link i3ConfigWorkspaceLayoutOpts i3ConfigOption |
| 277 | hi def link i3ConfigTitleAlignOpts i3ConfigOption |
| 278 | hi def link i3ConfigBorderOpts i3ConfigOption |
| 279 | hi def link i3ConfigEdgeOpts i3ConfigOption |
| 280 | hi def link i3ConfigSmartBorderOpts i3ConfigOption |
| 281 | hi def link i3ConfigForWindowKeyword i3ConfigKeyword |
| 282 | hi def link i3ConfigVariable Variable |
| 283 | hi def link i3ConfigSetKeyword i3ConfigKeyword |
| 284 | hi def link i3ConfigResourceKeyword i3ConfigKeyword |
| 285 | hi def link i3ConfigResource i3ConfigString |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 286 | hi def link i3ConfigAssignKeyword i3ConfigKeyword |
| 287 | hi def link i3ConfigAssignSpecial i3ConfigOption |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 288 | hi def link i3ConfigExecKeyword i3ConfigCommand |
| 289 | hi def link i3ConfigExecAlwaysKeyword i3ConfigKeyword |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 290 | hi def link i3ConfigShParam PreProc |
| 291 | hi def link i3ConfigShDelim Delimiter |
| 292 | hi def link i3ConfigShOper Operator |
| 293 | hi def link i3ConfigShCmdDelim i3ConfigShDelim |
| 294 | hi def link i3ConfigShCommand Normal |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 295 | hi def link i3ConfigWorkspaceKeyword i3ConfigCommand |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 296 | hi def link i3ConfigWorkspaceOutput i3ConfigOption |
| 297 | hi def link i3ConfigWorkspaceDir i3ConfigOption |
| 298 | hi def link i3ConfigDotOperator i3ConfigOperator |
| 299 | hi def link i3ConfigClientOpts i3ConfigOption |
| 300 | hi def link i3ConfigIpcKeyword i3ConfigKeyword |
| 301 | hi def link i3ConfigIpc i3ConfigString |
| 302 | hi def link i3ConfigFocusFollowsMouseOpts i3ConfigOption |
| 303 | hi def link i3ConfigFocusFollowsMouse i3ConfigKeyword |
| 304 | hi def link i3ConfigMouseWarpingOpts i3ConfigOption |
| 305 | hi def link i3ConfigMouseWarping i3ConfigKeyword |
| 306 | hi def link i3ConfigPopupFullscreenOpts i3ConfigOption |
| 307 | hi def link i3ConfigPopupFullscreen i3ConfigKeyword |
| 308 | hi def link i3ConfigFocusWrappingOpts i3ConfigOption |
| 309 | hi def link i3ConfigFocusWrapping i3ConfigKeyword |
| 310 | hi def link i3ConfigForceXinerama i3ConfigKeyword |
| 311 | hi def link i3ConfigAutomaticSwitch i3ConfigKeyword |
Josef Litoš | 62145db | 2023-09-11 20:12:48 +0200 | [diff] [blame] | 312 | hi def link i3ConfigTimeUnit i3ConfigNumber |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 313 | hi def link i3ConfigDelayUrgency i3ConfigKeyword |
| 314 | hi def link i3ConfigFocusOnActivationOpts i3ConfigOption |
| 315 | hi def link i3ConfigFocusOnActivation i3ConfigKeyword |
| 316 | hi def link i3ConfigShowMarks i3ConfigCommand |
| 317 | hi def link i3ConfigTilingDragOpts i3ConfigOption |
| 318 | hi def link i3ConfigTilingDrag i3ConfigKeyword |
| 319 | hi def link i3ConfigGapsOpts i3ConfigOption |
| 320 | hi def link i3ConfigGaps i3ConfigCommand |
| 321 | hi def link i3ConfigSmartGapOpts i3ConfigOption |
| 322 | hi def link i3ConfigSmartGap i3ConfigKeyword |
| 323 | hi def link i3ConfigBarModifier i3ConfigKeyword |
| 324 | hi def link i3ConfigBarOpts i3ConfigKeyword |
| 325 | hi def link i3ConfigColorsOpts i3ConfigOption |
| 326 | hi def link i3ConfigColors i3ConfigKeyword |
| 327 | hi def link i3ConfigConditionProp i3ConfigShParam |
| 328 | hi def link i3ConfigConditionFocused Constant |
| 329 | hi def link i3ConfigExecActionKeyword i3ConfigShCommand |
| 330 | hi def link i3ConfigExecAction i3ConfigString |
| 331 | hi def link i3ConfigLayoutKeyword i3ConfigCommand |
| 332 | hi def link i3ConfigLayoutOpts i3ConfigOption |
| 333 | hi def link i3ConfigFocusKeyword i3ConfigCommand |
| 334 | hi def link i3ConfigFocusOpts i3ConfigOption |
| 335 | hi def link i3ConfigFocusOutputOpts i3ConfigOption |
| 336 | hi def link i3ConfigMoveKeyword i3ConfigCommand |
| 337 | hi def link i3ConfigMoveDir i3ConfigOption |
| 338 | hi def link i3ConfigMoveType i3ConfigOption |
| 339 | hi def link i3ConfigUnit i3ConfigNumber |
| 340 | hi def link i3ConfigResizeKeyword i3ConfigCommand |
| 341 | hi def link i3ConfigResizeOpts i3ConfigOption |
| 342 | hi def link i3ConfigMarkKeyword i3ConfigCommand |
| 343 | hi def link i3ConfigMark i3ConfigShParam |
| 344 | hi def link i3ConfigActionKeyword i3ConfigCommand |
| 345 | hi def link i3ConfigOption Type |
Bram Moolenaar | 0e6adf8 | 2021-12-16 14:41:10 +0000 | [diff] [blame] | 346 | |
Josef Litoš | f5356bf | 2023-09-12 20:20:25 +0200 | [diff] [blame] | 347 | let b:current_syntax = "i3config" |