Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 1 | " Language: tmux(1) configuration file |
Eric Pruitt | 315b6f7 | 2024-09-04 22:15:40 +0200 | [diff] [blame] | 2 | " Version: 3.4 (git-3d8ead8a) |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 3 | " URL: https://github.com/ericpruitt/tmux.vim/ |
| 4 | " Maintainer: Eric Pruitt <eric.pruitt@gmail.com> |
| 5 | " License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause) |
| 6 | |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 7 | if exists("b:current_syntax") |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 8 | finish |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 9 | endif |
| 10 | |
Bram Moolenaar | 6c391a7 | 2021-09-09 21:55:11 +0200 | [diff] [blame] | 11 | " Explicitly change compatibility options to Vim's defaults because this file |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 12 | " uses line continuations. |
| 13 | let s:original_cpo = &cpo |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 14 | set cpo&vim |
| 15 | |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 16 | let b:current_syntax = "tmux" |
Bram Moolenaar | 0b0f099 | 2018-05-22 21:41:30 +0200 | [diff] [blame] | 17 | syntax iskeyword @,48-57,_,192-255,- |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 18 | syntax case match |
| 19 | |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 20 | " The values "yes" and "no" are synonyms for "on" and "off", so they do not |
| 21 | " appear in the option table file. |
| 22 | syn keyword tmuxEnums yes no |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 23 | |
| 24 | syn keyword tmuxTodo FIXME NOTE TODO XXX contained |
| 25 | |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 26 | syn match tmuxColour /\<colou\?r[0-9]\+\>/ display |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 27 | syn match tmuxKey /\(C-\|M-\|\^\)\+\S\+/ display |
Bram Moolenaar | 0b0f099 | 2018-05-22 21:41:30 +0200 | [diff] [blame] | 28 | syn match tmuxNumber /\<\d\+\>/ display |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 29 | syn match tmuxFlags /\s-\a\+/ display |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 30 | syn match tmuxVariableExpansion /\$\({[A-Za-z_]\w*}\|[A-Za-z_]\w*\)/ display |
Eric Pruitt | 73a8108 | 2024-07-09 18:32:55 +0200 | [diff] [blame] | 31 | syn match tmuxControl /\(^\|\s\)%\(if\|elif\|else\|endif\|hidden\)\($\|\s\)/ display |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 32 | syn match tmuxEscape /\\\(u\x\{4\}\|U\x\{8\}\|\o\{3\}\|[\\ernt$]\)/ display |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 33 | |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 34 | " Missing closing bracket. |
| 35 | syn match tmuxInvalidVariableExpansion /\${[^}]*$/ display |
| 36 | " Starts with invalid character. |
| 37 | syn match tmuxInvalidVariableExpansion /\${[^A-Za-z_][^}]*}/ display |
| 38 | syn match tmuxInvalidVariableExpansion /\$[^A-Za-z_{ \t]/ display |
| 39 | " Contains invalid character. |
Eric Pruitt | 315b6f7 | 2024-09-04 22:15:40 +0200 | [diff] [blame] | 40 | syn match tmuxInvalidVariableExpansion /\${[^}]*[^A-Za-z0-9_}][^}]*}/ display |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 41 | |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 42 | syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo,@Spell |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 43 | |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 44 | syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString,tmuxEscape,tmuxVariableExpansion,tmuxInvalidVariableExpansion,@Spell |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 45 | syn region tmuxUninterpolatedString start=+'+ skip=+\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString,@Spell |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 46 | |
| 47 | " TODO: Figure out how escaping works inside of #(...) and #{...} blocks. |
| 48 | syn region tmuxFormatString start=/#[#DFhHIPSTW]/ end=// contained keepend |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 49 | syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ keepend |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 50 | syn region tmuxFormatString start=/#(/ skip=/#(.\{-})/ end=/)/ contained keepend |
| 51 | |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 52 | " At the time of this writing, the latest tmux release will parse a line |
| 53 | " reading "abc=xyz set-option ..." as an assignment followed by a command |
| 54 | " hence the presence of "\s" in the "end" argument. |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 55 | syn region tmuxAssignment matchgroup=tmuxVariable start=/^\s*[A-Za-z_]\w*=\@=/ skip=/\\$\|\\\s/ end=/\s\|$/ contains=tmuxString,tmuxUninterpolatedString,tmuxVariableExpansion,tmuxControl,tmuxEscape,tmuxInvalidVariableExpansion |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 56 | |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 57 | hi def link tmuxFormatString Identifier |
| 58 | hi def link tmuxAction Boolean |
| 59 | hi def link tmuxBoolean Boolean |
| 60 | hi def link tmuxCommands Keyword |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 61 | hi def link tmuxControl PreCondit |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 62 | hi def link tmuxComment Comment |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 63 | hi def link tmuxEnums Boolean |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 64 | hi def link tmuxEscape Special |
| 65 | hi def link tmuxEscapeUnquoted Special |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 66 | hi def link tmuxInvalidVariableExpansion |
| 67 | \ Error |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 68 | hi def link tmuxKey Special |
| 69 | hi def link tmuxNumber Number |
| 70 | hi def link tmuxFlags Identifier |
| 71 | hi def link tmuxOptions Function |
| 72 | hi def link tmuxString String |
| 73 | hi def link tmuxTodo Todo |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 74 | hi def link tmuxUninterpolatedString |
| 75 | \ String |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 76 | hi def link tmuxVariable Identifier |
| 77 | hi def link tmuxVariableExpansion Identifier |
| 78 | |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 79 | " Make the foreground of colourXXX keywords match the color they represent |
| 80 | " when g:tmux_syntax_colors is unset or set to a non-zero value. |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 81 | " Darker colors have their background set to white. |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 82 | if get(g:, "tmux_syntax_colors", 1) |
| 83 | for s:i in range(0, 255) |
| 84 | let s:bg = (!s:i || s:i == 16 || (s:i > 231 && s:i < 235)) ? 15 : "none" |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 85 | exec "syn match tmuxColour" . s:i . " /\\<colou\\?r" . s:i . "\\>/ display" |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 86 | \ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg |
| 87 | endfor |
| 88 | endif |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 89 | |
| 90 | syn keyword tmuxOptions |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 91 | \ activity-action after-bind-key after-capture-pane after-copy-mode |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 92 | \ after-display-message after-display-panes after-kill-pane after-list-buffers |
| 93 | \ after-list-clients after-list-keys after-list-panes after-list-sessions |
| 94 | \ after-list-windows after-load-buffer after-lock-server after-new-session |
| 95 | \ after-new-window after-paste-buffer after-pipe-pane after-queue |
| 96 | \ after-refresh-client after-rename-session after-rename-window |
| 97 | \ after-resize-pane after-resize-window after-save-buffer after-select-layout |
| 98 | \ after-select-pane after-select-window after-send-keys after-set-buffer |
| 99 | \ after-set-environment after-set-hook after-set-option after-show-environment |
| 100 | \ after-show-messages after-show-options after-split-window after-unbind-key |
| 101 | \ aggressive-resize alert-activity alert-bell alert-silence allow-passthrough |
Eric Pruitt | 73a8108 | 2024-07-09 18:32:55 +0200 | [diff] [blame] | 102 | \ allow-rename allow-set-title alternate-screen assume-paste-time |
| 103 | \ automatic-rename automatic-rename-format backspace base-index bell-action |
| 104 | \ buffer-limit client-active client-attached client-detached client-focus-in |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 105 | \ client-focus-out client-resized client-session-changed clock-mode-color |
Eric Pruitt | 73a8108 | 2024-07-09 18:32:55 +0200 | [diff] [blame] | 106 | \ clock-mode-colour clock-mode-style command-alias command-error copy-command |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 107 | \ copy-mode-current-match-style copy-mode-mark-style copy-mode-match-style |
| 108 | \ cursor-color cursor-colour cursor-style default-command default-shell |
| 109 | \ default-size default-terminal destroy-unattached detach-on-destroy |
| 110 | \ display-panes-active-color display-panes-active-colour display-panes-color |
| 111 | \ display-panes-colour display-panes-time display-time editor escape-time |
| 112 | \ exit-empty exit-unattached extended-keys fill-character focus-events |
| 113 | \ history-file history-limit key-table lock-after-time lock-command |
| 114 | \ main-pane-height main-pane-width menu-border-lines menu-border-style |
| 115 | \ menu-selected-style menu-style message-command-style message-limit |
| 116 | \ message-line message-style mode-keys mode-style monitor-activity monitor-bell |
| 117 | \ monitor-silence mouse other-pane-height other-pane-width |
| 118 | \ pane-active-border-style pane-base-index pane-border-format |
| 119 | \ pane-border-indicators pane-border-lines pane-border-status pane-border-style |
| 120 | \ pane-colors pane-colours pane-died pane-exited pane-focus-in pane-focus-out |
| 121 | \ pane-mode-changed pane-set-clipboard pane-title-changed popup-border-lines |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 122 | \ popup-border-style popup-style prefix prefix2 prompt-history-limit |
| 123 | \ remain-on-exit remain-on-exit-format renumber-windows repeat-time |
| 124 | \ scroll-on-clear session-closed session-created session-renamed |
| 125 | \ session-window-changed set-clipboard set-titles set-titles-string |
| 126 | \ silence-action status status-bg status-fg status-format status-interval |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 127 | \ status-justify status-keys status-left status-left-length status-left-style |
| 128 | \ status-position status-right status-right-length status-right-style |
| 129 | \ status-style synchronize-panes terminal-features terminal-overrides |
| 130 | \ update-environment user-keys visual-activity visual-bell visual-silence |
| 131 | \ window-active-style window-layout-changed window-linked window-pane-changed |
| 132 | \ window-renamed window-resized window-size window-status-activity-style |
| 133 | \ window-status-bell-style window-status-current-format |
| 134 | \ window-status-current-style window-status-format window-status-last-style |
| 135 | \ window-status-separator window-status-style window-style window-unlinked |
| 136 | \ word-separators wrap-search xterm-keys |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 137 | |
| 138 | syn keyword tmuxCommands |
Eric Pruitt | b42703a | 2023-12-18 00:03:40 -0800 | [diff] [blame] | 139 | \ attach attach-session bind bind-key break-pane breakp capture-pane capturep |
| 140 | \ choose-buffer choose-client choose-session choose-tree choose-window |
| 141 | \ clear-history clear-prompt-history clearhist clearphist clock-mode |
| 142 | \ command-prompt confirm confirm-before copy-mode customize-mode delete-buffer |
| 143 | \ deleteb detach detach-client display display-menu display-message |
| 144 | \ display-panes display-popup displayp find-window findw has has-session if |
| 145 | \ if-shell info join-pane joinp kill-pane kill-server kill-session kill-window |
| 146 | \ killp killw last last-pane last-window lastp link-window linkw list-buffers |
| 147 | \ list-clients list-commands list-keys list-panes list-sessions list-windows |
| 148 | \ load-buffer loadb lock lock-client lock-server lock-session lockc locks ls |
| 149 | \ lsb lsc lscm lsk lsp lsw menu move-pane move-window movep movew new |
| 150 | \ new-session new-window neww next next-layout next-window nextl paste-buffer |
| 151 | \ pasteb pipe-pane pipep popup prev previous-layout previous-window prevl |
| 152 | \ refresh refresh-client rename rename-session rename-window renamew |
| 153 | \ resize-pane resize-window resizep resizew respawn-pane respawn-window |
| 154 | \ respawnp respawnw rotate-window rotatew run run-shell save-buffer saveb |
| 155 | \ select-layout select-pane select-window selectl selectp selectw send |
| 156 | \ send-keys send-prefix server-access server-info set set-buffer |
| 157 | \ set-environment set-hook set-option set-window-option setb setenv setw show |
| 158 | \ show-buffer show-environment show-hooks show-messages show-options |
| 159 | \ show-prompt-history show-window-options showb showenv showmsgs showphist |
| 160 | \ showw source source-file split-pane split-window splitp splitw start |
| 161 | \ start-server suspend-client suspendc swap-pane swap-window swapp swapw |
| 162 | \ switch-client switchc unbind unbind-key unlink-window unlinkw wait wait-for |
| 163 | |
| 164 | syn keyword tmuxEnums |
| 165 | \ absolute-centre all always any arrows bar blinking-bar blinking-block |
| 166 | \ blinking-underline block both bottom centre color colour current default |
Eric Pruitt | e8f6af6 | 2024-02-21 10:46:47 -0800 | [diff] [blame] | 167 | \ double emacs external failed heavy keep-group keep-last largest latest left |
| 168 | \ manual next no-detached none number off on other padded previous right |
| 169 | \ rounded simple single smallest top underline vi |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 170 | |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 171 | let &cpo = s:original_cpo |
| 172 | unlet! s:original_cpo s:bg s:i |