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