Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 1 | " Language: tmux(1) configuration file |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 2 | " Version: 3.3-rc (git-964deae4) |
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 | |
| 20 | syn keyword tmuxAction none any current other |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 21 | syn keyword tmuxBoolean off on yes no |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 22 | |
| 23 | syn keyword tmuxTodo FIXME NOTE TODO XXX contained |
| 24 | |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 25 | syn match tmuxColour /\<colou\?r[0-9]\+\>/ display |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 26 | syn match tmuxKey /\(C-\|M-\|\^\)\+\S\+/ display |
Bram Moolenaar | 0b0f099 | 2018-05-22 21:41:30 +0200 | [diff] [blame] | 27 | syn match tmuxNumber /\<\d\+\>/ display |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 28 | syn match tmuxFlags /\s-\a\+/ display |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 29 | syn match tmuxVariableExpansion /\$\({[A-Za-z_]\w*}\|[A-Za-z_]\w*\)/ display |
| 30 | syn match tmuxControl /^\s*%\(if\|elif\|else\|endif\)\>/ |
| 31 | 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] | 32 | |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 33 | syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo,@Spell |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 34 | |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 35 | syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString,tmuxEscape,tmuxVariableExpansion,@Spell |
| 36 | syn region tmuxUninterpolatedString start=+'+ skip=+\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString,@Spell |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 37 | |
| 38 | " TODO: Figure out how escaping works inside of #(...) and #{...} blocks. |
| 39 | syn region tmuxFormatString start=/#[#DFhHIPSTW]/ end=// contained keepend |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 40 | syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ keepend |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 41 | syn region tmuxFormatString start=/#(/ skip=/#(.\{-})/ end=/)/ contained keepend |
| 42 | |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 43 | " At the time of this writing, the latest tmux release will parse a line |
| 44 | " reading "abc=xyz set-option ..." as an assignment followed by a command |
| 45 | " hence the presence of "\s" in the "end" argument. |
| 46 | syn region tmuxAssignment matchgroup=tmuxVariable start=/^\s*[A-Za-z_]\w*=\@=/ skip=/\\$\|\\\s/ end=/\s\|$/ contains=tmuxString,tmuxUninterpolatedString,tmuxVariableExpansion,tmuxControl,tmuxEscape |
| 47 | |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 48 | hi def link tmuxFormatString Identifier |
| 49 | hi def link tmuxAction Boolean |
| 50 | hi def link tmuxBoolean Boolean |
| 51 | hi def link tmuxCommands Keyword |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 52 | hi def link tmuxControl PreCondit |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 53 | hi def link tmuxComment Comment |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 54 | hi def link tmuxEscape Special |
| 55 | hi def link tmuxEscapeUnquoted Special |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 56 | hi def link tmuxKey Special |
| 57 | hi def link tmuxNumber Number |
| 58 | hi def link tmuxFlags Identifier |
| 59 | hi def link tmuxOptions Function |
| 60 | hi def link tmuxString String |
| 61 | hi def link tmuxTodo Todo |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 62 | hi def link tmuxUninterpolatedString |
| 63 | \ String |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 64 | hi def link tmuxVariable Identifier |
| 65 | hi def link tmuxVariableExpansion Identifier |
| 66 | |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 67 | " Make the foreground of colourXXX keywords match the color they represent |
| 68 | " 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] | 69 | " Darker colors have their background set to white. |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 70 | if get(g:, "tmux_syntax_colors", 1) |
| 71 | for s:i in range(0, 255) |
| 72 | 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] | 73 | exec "syn match tmuxColour" . s:i . " /\\<colou\\?r" . s:i . "\\>/ display" |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 74 | \ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg |
| 75 | endfor |
| 76 | endif |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 77 | |
| 78 | syn keyword tmuxOptions |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 79 | \ activity-action after-bind-key after-capture-pane after-copy-mode |
| 80 | \ after-display-message after-display-panes after-kill-pane |
| 81 | \ after-list-buffers after-list-clients after-list-keys after-list-panes |
| 82 | \ after-list-sessions after-list-windows after-load-buffer after-lock-server |
| 83 | \ after-new-session after-new-window after-paste-buffer after-pipe-pane |
| 84 | \ after-queue after-refresh-client after-rename-session after-rename-window |
| 85 | \ after-resize-pane after-resize-window after-save-buffer |
| 86 | \ after-select-layout after-select-pane after-select-window after-send-keys |
| 87 | \ after-set-buffer after-set-environment after-set-hook after-set-option |
| 88 | \ after-show-environment after-show-messages after-show-options |
| 89 | \ after-split-window after-unbind-key aggressive-resize alert-activity |
| 90 | \ alert-bell alert-silence allow-passthrough allow-rename alternate-screen |
| 91 | \ assume-paste-time automatic-rename automatic-rename-format backspace |
| 92 | \ base-index bell-action buffer-limit client-active client-attached |
| 93 | \ client-detached client-focus-in client-focus-out client-resized |
| 94 | \ client-session-changed clock-mode-colour clock-mode-style command-alias |
| 95 | \ copy-command copy-mode-current-match-style copy-mode-mark-style |
| 96 | \ copy-mode-match-style cursor-colour cursor-style default-command |
| 97 | \ default-shell default-size default-terminal destroy-unattached |
Bram Moolenaar | 9135901 | 2019-11-30 17:57:03 +0100 | [diff] [blame] | 98 | \ detach-on-destroy display-panes-active-colour display-panes-colour |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 99 | \ display-panes-time display-time editor escape-time exit-empty |
| 100 | \ exit-unattached extended-keys fill-character focus-events history-file |
| 101 | \ history-limit key-table lock-after-time lock-command main-pane-height |
| 102 | \ main-pane-width message-command-style message-limit message-style |
| 103 | \ mode-keys mode-style monitor-activity monitor-bell monitor-silence mouse |
| 104 | \ other-pane-height other-pane-width pane-active-border-style |
| 105 | \ pane-base-index pane-border-format pane-border-indicators |
| 106 | \ pane-border-lines pane-border-status pane-border-style pane-colours |
| 107 | \ pane-died pane-exited pane-focus-in pane-focus-out pane-mode-changed |
| 108 | \ pane-set-clipboard pane-title-changed popup-border-lines |
| 109 | \ popup-border-style popup-style prefix prefix2 prompt-history-limit |
| 110 | \ remain-on-exit remain-on-exit-format renumber-windows repeat-time |
| 111 | \ scroll-on-clear session-closed session-created session-renamed |
| 112 | \ session-window-changed set-clipboard set-titles set-titles-string |
| 113 | \ silence-action status status-bg status-fg status-format status-interval |
| 114 | \ status-justify status-keys status-left status-left-length |
| 115 | \ status-left-style status-position status-right status-right-length |
| 116 | \ status-right-style status-style synchronize-panes terminal-features |
| 117 | \ terminal-overrides update-environment user-keys visual-activity |
| 118 | \ visual-bell visual-silence window-active-style window-layout-changed |
| 119 | \ window-linked window-pane-changed window-renamed window-resized |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 120 | \ window-size window-status-activity-style window-status-bell-style |
Bram Moolenaar | 9135901 | 2019-11-30 17:57:03 +0100 | [diff] [blame] | 121 | \ window-status-current-format window-status-current-style |
| 122 | \ window-status-format window-status-last-style window-status-separator |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 123 | \ window-status-style window-style window-unlinked word-separators |
| 124 | \ wrap-search xterm-keys |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 125 | |
| 126 | syn keyword tmuxCommands |
Bram Moolenaar | 0b0f099 | 2018-05-22 21:41:30 +0200 | [diff] [blame] | 127 | \ attach attach-session bind bind-key break-pane breakp capture-pane |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 128 | \ capturep choose-buffer choose-client choose-session choose-tree |
| 129 | \ choose-window clear-history clear-prompt-history clearhist clearphist |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 130 | \ clock-mode command-prompt confirm confirm-before copy-mode customize-mode |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 131 | \ delete-buffer deleteb detach detach-client display display-menu |
| 132 | \ display-message display-panes display-popup displayp find-window findw has |
| 133 | \ has-session if if-shell info join-pane joinp kill-pane kill-server |
| 134 | \ kill-session kill-window killp killw last last-pane last-window lastp |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 135 | \ link-window linkw list-buffers list-clients list-commands list-keys |
| 136 | \ list-panes list-sessions list-windows load-buffer loadb lock lock-client |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 137 | \ lock-server lock-session lockc locks ls lsb lsc lscm lsk lsp lsw menu |
| 138 | \ move-pane move-window movep movew new new-session new-window neww next |
| 139 | \ next-layout next-window nextl paste-buffer pasteb pipe-pane pipep popup |
| 140 | \ prev previous-layout previous-window prevl refresh refresh-client rename |
| 141 | \ rename-session rename-window renamew resize-pane resize-window resizep |
| 142 | \ resizew respawn-pane respawn-window respawnp respawnw rotate-window |
| 143 | \ rotatew run run-shell save-buffer saveb select-layout select-pane |
| 144 | \ select-window selectl selectp selectw send send-keys send-prefix |
| 145 | \ server-info set set-buffer set-environment set-hook set-option |
Bram Moolenaar | 68e6560 | 2019-05-26 21:33:31 +0200 | [diff] [blame] | 146 | \ set-window-option setb setenv setw show show-buffer show-environment |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 147 | \ show-hooks show-messages show-options show-prompt-history |
| 148 | \ show-window-options showb showenv showmsgs showphist showw source |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 149 | \ source-file split-pane split-window splitp splitw start start-server |
| 150 | \ suspend-client suspendc swap-pane swap-window swapp swapw switch-client |
| 151 | \ switchc unbind unbind-key unlink-window unlinkw wait wait-for |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 152 | |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 153 | let &cpo = s:original_cpo |
| 154 | unlet! s:original_cpo s:bg s:i |