blob: 042b96e8720c9bec0f689c8cf924f5d40a25380c [file] [log] [blame]
Bram Moolenaar214641f2017-03-05 17:04:09 +01001" Language: tmux(1) configuration file
Bram Moolenaar46eea442022-03-30 10:51:39 +01002" Version: 3.3-rc (git-964deae4)
Bram Moolenaar214641f2017-03-05 17:04:09 +01003" 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 Moolenaar036986f2017-03-16 17:41:02 +01007if exists("b:current_syntax")
Bram Moolenaar214641f2017-03-05 17:04:09 +01008 finish
Bram Moolenaar214641f2017-03-05 17:04:09 +01009endif
10
Bram Moolenaar6c391a72021-09-09 21:55:11 +020011" Explicitly change compatibility options to Vim's defaults because this file
Bram Moolenaar036986f2017-03-16 17:41:02 +010012" uses line continuations.
13let s:original_cpo = &cpo
Bram Moolenaar214641f2017-03-05 17:04:09 +010014set cpo&vim
15
Bram Moolenaar036986f2017-03-16 17:41:02 +010016let b:current_syntax = "tmux"
Bram Moolenaar0b0f0992018-05-22 21:41:30 +020017syntax iskeyword @,48-57,_,192-255,-
Bram Moolenaar214641f2017-03-05 17:04:09 +010018syntax case match
19
20syn keyword tmuxAction none any current other
Bram Moolenaar46eea442022-03-30 10:51:39 +010021syn keyword tmuxBoolean off on yes no
Bram Moolenaar214641f2017-03-05 17:04:09 +010022
23syn keyword tmuxTodo FIXME NOTE TODO XXX contained
24
Bram Moolenaar46eea442022-03-30 10:51:39 +010025syn match tmuxColour /\<colou\?r[0-9]\+\>/ display
Bram Moolenaar214641f2017-03-05 17:04:09 +010026syn match tmuxKey /\(C-\|M-\|\^\)\+\S\+/ display
Bram Moolenaar0b0f0992018-05-22 21:41:30 +020027syn match tmuxNumber /\<\d\+\>/ display
Bram Moolenaar214641f2017-03-05 17:04:09 +010028syn match tmuxFlags /\s-\a\+/ display
Bram Moolenaar46eea442022-03-30 10:51:39 +010029syn match tmuxVariableExpansion /\$\({[A-Za-z_]\w*}\|[A-Za-z_]\w*\)/ display
30syn match tmuxControl /^\s*%\(if\|elif\|else\|endif\)\>/
31syn match tmuxEscape /\\\(u\x\{4\}\|U\x\{8\}\|\o\{3\}\|[\\ernt$]\)/ display
Bram Moolenaar214641f2017-03-05 17:04:09 +010032
Bram Moolenaar22863042021-10-16 15:23:36 +010033syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo,@Spell
Bram Moolenaar214641f2017-03-05 17:04:09 +010034
Bram Moolenaar46eea442022-03-30 10:51:39 +010035syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString,tmuxEscape,tmuxVariableExpansion,@Spell
36syn region tmuxUninterpolatedString start=+'+ skip=+\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString,@Spell
Bram Moolenaar214641f2017-03-05 17:04:09 +010037
38" TODO: Figure out how escaping works inside of #(...) and #{...} blocks.
39syn region tmuxFormatString start=/#[#DFhHIPSTW]/ end=// contained keepend
Bram Moolenaar22863042021-10-16 15:23:36 +010040syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ keepend
Bram Moolenaar214641f2017-03-05 17:04:09 +010041syn region tmuxFormatString start=/#(/ skip=/#(.\{-})/ end=/)/ contained keepend
42
Bram Moolenaar46eea442022-03-30 10:51:39 +010043" 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.
46syn region tmuxAssignment matchgroup=tmuxVariable start=/^\s*[A-Za-z_]\w*=\@=/ skip=/\\$\|\\\s/ end=/\s\|$/ contains=tmuxString,tmuxUninterpolatedString,tmuxVariableExpansion,tmuxControl,tmuxEscape
47
Bram Moolenaar214641f2017-03-05 17:04:09 +010048hi def link tmuxFormatString Identifier
49hi def link tmuxAction Boolean
50hi def link tmuxBoolean Boolean
51hi def link tmuxCommands Keyword
Bram Moolenaar46eea442022-03-30 10:51:39 +010052hi def link tmuxControl PreCondit
Bram Moolenaar214641f2017-03-05 17:04:09 +010053hi def link tmuxComment Comment
Bram Moolenaar46eea442022-03-30 10:51:39 +010054hi def link tmuxEscape Special
55hi def link tmuxEscapeUnquoted Special
Bram Moolenaar214641f2017-03-05 17:04:09 +010056hi def link tmuxKey Special
57hi def link tmuxNumber Number
58hi def link tmuxFlags Identifier
59hi def link tmuxOptions Function
60hi def link tmuxString String
61hi def link tmuxTodo Todo
Bram Moolenaar46eea442022-03-30 10:51:39 +010062hi def link tmuxUninterpolatedString
63\ String
Bram Moolenaar214641f2017-03-05 17:04:09 +010064hi def link tmuxVariable Identifier
65hi def link tmuxVariableExpansion Identifier
66
Bram Moolenaar22863042021-10-16 15:23:36 +010067" 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 Moolenaar214641f2017-03-05 17:04:09 +010069" Darker colors have their background set to white.
Bram Moolenaar22863042021-10-16 15:23:36 +010070if 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 Moolenaar46eea442022-03-30 10:51:39 +010073 exec "syn match tmuxColour" . s:i . " /\\<colou\\?r" . s:i . "\\>/ display"
Bram Moolenaar22863042021-10-16 15:23:36 +010074\ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg
75 endfor
76endif
Bram Moolenaar214641f2017-03-05 17:04:09 +010077
78syn keyword tmuxOptions
Bram Moolenaar46eea442022-03-30 10:51:39 +010079\ 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 Moolenaar91359012019-11-30 17:57:03 +010098\ detach-on-destroy display-panes-active-colour display-panes-colour
Bram Moolenaar46eea442022-03-30 10:51:39 +010099\ 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 Moolenaar22863042021-10-16 15:23:36 +0100120\ window-size window-status-activity-style window-status-bell-style
Bram Moolenaar91359012019-11-30 17:57:03 +0100121\ window-status-current-format window-status-current-style
122\ window-status-format window-status-last-style window-status-separator
Bram Moolenaar46eea442022-03-30 10:51:39 +0100123\ window-status-style window-style window-unlinked word-separators
124\ wrap-search xterm-keys
Bram Moolenaar214641f2017-03-05 17:04:09 +0100125
126syn keyword tmuxCommands
Bram Moolenaar0b0f0992018-05-22 21:41:30 +0200127\ attach attach-session bind bind-key break-pane breakp capture-pane
Bram Moolenaar46eea442022-03-30 10:51:39 +0100128\ capturep choose-buffer choose-client choose-session choose-tree
129\ choose-window clear-history clear-prompt-history clearhist clearphist
Bram Moolenaar22863042021-10-16 15:23:36 +0100130\ clock-mode command-prompt confirm confirm-before copy-mode customize-mode
Bram Moolenaar46eea442022-03-30 10:51:39 +0100131\ 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 Moolenaar22863042021-10-16 15:23:36 +0100135\ 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 Moolenaar46eea442022-03-30 10:51:39 +0100137\ 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 Moolenaar68e65602019-05-26 21:33:31 +0200146\ set-window-option setb setenv setw show show-buffer show-environment
Bram Moolenaar22863042021-10-16 15:23:36 +0100147\ show-hooks show-messages show-options show-prompt-history
148\ show-window-options showb showenv showmsgs showphist showw source
Bram Moolenaar46eea442022-03-30 10:51:39 +0100149\ 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 Moolenaar214641f2017-03-05 17:04:09 +0100152
Bram Moolenaar036986f2017-03-16 17:41:02 +0100153let &cpo = s:original_cpo
154unlet! s:original_cpo s:bg s:i