blob: 4f435ab923d45852175fa02da32c8bc0a7715bda [file] [log] [blame]
Bram Moolenaar214641f2017-03-05 17:04:09 +01001" Language: tmux(1) configuration file
Bram Moolenaar91359012019-11-30 17:57:03 +01002" Version: 3.0 (git-48cbbb87)
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
21syn keyword tmuxBoolean off on
22
23syn keyword tmuxTodo FIXME NOTE TODO XXX contained
24
25syn match tmuxColour /\<colour[0-9]\+/ display
26syn 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
29syn match tmuxVariable /\w\+=/ display
30syn match tmuxVariableExpansion /\${\=\w\+}\=/ display
Bram Moolenaar91359012019-11-30 17:57:03 +010031syn match tmuxControl /%\(if\|elif\|else\|endif\)/
Bram Moolenaar214641f2017-03-05 17:04:09 +010032
33syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo
34
35syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString
36syn region tmuxString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString
37
38" TODO: Figure out how escaping works inside of #(...) and #{...} blocks.
39syn region tmuxFormatString start=/#[#DFhHIPSTW]/ end=// contained keepend
40syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ contained keepend
41syn region tmuxFormatString start=/#(/ skip=/#(.\{-})/ end=/)/ contained keepend
42
43hi def link tmuxFormatString Identifier
44hi def link tmuxAction Boolean
45hi def link tmuxBoolean Boolean
46hi def link tmuxCommands Keyword
Bram Moolenaar91359012019-11-30 17:57:03 +010047hi def link tmuxControl Keyword
Bram Moolenaar214641f2017-03-05 17:04:09 +010048hi def link tmuxComment Comment
49hi def link tmuxKey Special
50hi def link tmuxNumber Number
51hi def link tmuxFlags Identifier
52hi def link tmuxOptions Function
53hi def link tmuxString String
54hi def link tmuxTodo Todo
55hi def link tmuxVariable Identifier
56hi def link tmuxVariableExpansion Identifier
57
58" Make the foreground of colourXXX keywords match the color they represent.
59" Darker colors have their background set to white.
60for s:i in range(0, 255)
61 let s:bg = (!s:i || s:i == 16 || (s:i > 231 && s:i < 235)) ? 15 : "none"
62 exec "syn match tmuxColour" . s:i . " /\\<colour" . s:i . "\\>/ display"
63\ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg
64endfor
Bram Moolenaar214641f2017-03-05 17:04:09 +010065
66syn keyword tmuxOptions
Bram Moolenaar91359012019-11-30 17:57:03 +010067\ backspace buffer-limit command-alias default-terminal escape-time
68\ exit-empty activity-action assume-paste-time base-index bell-action
69\ default-command default-shell default-size destroy-unattached
70\ detach-on-destroy display-panes-active-colour display-panes-colour
71\ display-panes-time display-time exit-unattached focus-events history-file
72\ history-limit key-table lock-after-time lock-command message-command-style
73\ message-limit message-style aggressive-resize allow-rename
74\ alternate-screen automatic-rename automatic-rename-format
75\ clock-mode-colour clock-mode-style main-pane-height main-pane-width
76\ mode-keys mode-style monitor-activity monitor-bell monitor-silence mouse
77\ other-pane-height other-pane-width pane-active-border-style
78\ pane-base-index pane-border-format pane-border-status pane-border-style
79\ prefix prefix2 remain-on-exit renumber-windows repeat-time set-clipboard
80\ set-titles set-titles-string silence-action status status-bg status-fg
81\ status-format status-interval status-justify status-keys status-left
82\ status-left-length status-left-style status-position status-right
83\ status-right-length status-right-style status-style synchronize-panes
84\ terminal-overrides update-environment user-keys visual-activity
85\ visual-bell visual-silence window-active-style window-size
86\ window-status-activity-style window-status-bell-style
87\ window-status-current-format window-status-current-style
88\ window-status-format window-status-last-style window-status-separator
89\ window-status-style window-style word-separators wrap-search xterm-keys
Bram Moolenaar214641f2017-03-05 17:04:09 +010090
91syn keyword tmuxCommands
Bram Moolenaar0b0f0992018-05-22 21:41:30 +020092\ attach attach-session bind bind-key break-pane breakp capture-pane
93\ capturep choose-buffer choose-client choose-tree clear-history clearhist
94\ clock-mode command-prompt confirm confirm-before copy-mode detach
Bram Moolenaar68e65602019-05-26 21:33:31 +020095\ detach-client display display-menu display-message display-panes displayp
96\ find-window findw if if-shell join-pane joinp kill-pane kill-server
97\ kill-session kill-window killp has-session has killw link-window linkw
98\ list-buffers list-clients list-commands list-keys list-panes list-sessions
99\ list-windows load-buffer loadb lock lock-client lock-server lock-session
100\ lockc last-pane lastp locks ls last-window last lsb lsc delete-buffer
101\ deleteb lscm lsk lsp lsw menu move-pane move-window movep movew new
102\ new-session new-window neww next next-layout next-window nextl
103\ paste-buffer pasteb pipe-pane pipep prev previous-layout previous-window
104\ prevl refresh refresh-client rename rename-session rename-window renamew
105\ resize-pane resize-window resizep resizew respawn-pane respawn-window
106\ respawnp respawnw rotate-window rotatew run run-shell save-buffer saveb
107\ select-layout select-pane select-window selectl selectp selectw send
108\ send-keys send-prefix set set-buffer set-environment set-hook set-option
109\ set-window-option setb setenv setw show show-buffer show-environment
110\ show-hooks show-messages show-options show-window-options showb showenv
111\ showmsgs showw source source-file split-window splitw start start-server
112\ suspend-client suspendc swap-pane swap-window swapp swapw switch-client
113\ switchc unbind unbind-key unlink-window unlinkw wait wait-for
Bram Moolenaar214641f2017-03-05 17:04:09 +0100114
Bram Moolenaar036986f2017-03-16 17:41:02 +0100115let &cpo = s:original_cpo
116unlet! s:original_cpo s:bg s:i