blob: 4e87de841797760a510e0c00a25d876e7bbb271d [file] [log] [blame]
Bram Moolenaar214641f2017-03-05 17:04:09 +01001" Language: tmux(1) configuration file
2" Version: 2.3 (git-14dc2ac)
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
7if version < 600
8 syntax clear
9elseif exists("b:current_syntax")
10 finish
11else
12 let b:current_syntax = "tmux"
13endif
14
15" this file uses line continuations
16let s:cpo_sav = &cpo
17set cpo&vim
18
19setlocal iskeyword+=-
20syntax case match
21
22syn keyword tmuxAction none any current other
23syn keyword tmuxBoolean off on
24
25syn keyword tmuxTodo FIXME NOTE TODO XXX contained
26
27syn match tmuxColour /\<colour[0-9]\+/ display
28syn match tmuxKey /\(C-\|M-\|\^\)\+\S\+/ display
29syn match tmuxNumber /\d\+/ display
30syn match tmuxFlags /\s-\a\+/ display
31syn match tmuxVariable /\w\+=/ display
32syn match tmuxVariableExpansion /\${\=\w\+}\=/ display
33
34syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo
35
36syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString
37syn region tmuxString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString
38
39" TODO: Figure out how escaping works inside of #(...) and #{...} blocks.
40syn region tmuxFormatString start=/#[#DFhHIPSTW]/ end=// contained keepend
41syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ contained keepend
42syn region tmuxFormatString start=/#(/ skip=/#(.\{-})/ end=/)/ contained keepend
43
44hi def link tmuxFormatString Identifier
45hi def link tmuxAction Boolean
46hi def link tmuxBoolean Boolean
47hi def link tmuxCommands Keyword
48hi 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
65unlet s:bg s:i
66
67syn keyword tmuxOptions
68\ buffer-limit command-alias default-terminal escape-time exit-unattached
69\ focus-events history-file message-limit set-clipboard terminal-overrides
70\ assume-paste-time base-index bell-action bell-on-alert default-command
71\ default-shell destroy-unattached detach-on-destroy
72\ display-panes-active-colour display-panes-colour display-panes-time
73\ display-time history-limit key-table lock-after-time lock-command
74\ message-attr message-bg message-command-attr message-command-bg
75\ message-command-fg message-command-style message-fg message-style mouse
76\ prefix prefix2 renumber-windows repeat-time set-titles set-titles-string
77\ status status-attr status-bg status-fg status-interval status-justify
78\ status-keys status-left status-left-attr status-left-bg status-left-fg
79\ status-left-length status-left-style status-position status-right
80\ status-right-attr status-right-bg status-right-fg status-right-length
81\ status-right-style status-style update-environment visual-activity
82\ visual-bell visual-silence word-separators aggressive-resize allow-rename
83\ alternate-screen automatic-rename automatic-rename-format
84\ clock-mode-colour clock-mode-style force-height force-width
85\ main-pane-height main-pane-width mode-attr mode-bg mode-fg mode-keys
86\ mode-style monitor-activity monitor-silence other-pane-height
87\ other-pane-width pane-active-border-bg pane-active-border-fg
88\ pane-active-border-style pane-base-index pane-border-bg pane-border-fg
89\ pane-border-format pane-border-status pane-border-style remain-on-exit
90\ synchronize-panes window-active-style window-style
91\ window-status-activity-attr window-status-activity-bg
92\ window-status-activity-fg window-status-activity-style window-status-attr
93\ window-status-bell-attr window-status-bell-bg window-status-bell-fg
94\ window-status-bell-style window-status-bg window-status-current-attr
95\ window-status-current-bg window-status-current-fg
96\ window-status-current-format window-status-current-style window-status-fg
97\ window-status-format window-status-last-attr window-status-last-bg
98\ window-status-last-fg window-status-last-style window-status-separator
99\ window-status-style wrap-search xterm-keys
100
101syn keyword tmuxCommands
102\ attach-session attach bind-key bind break-pane breakp capture-pane
103\ capturep clear-history clearhist choose-buffer choose-client choose-tree
104\ choose-session choose-window command-prompt confirm-before confirm
105\ copy-mode clock-mode detach-client detach suspend-client suspendc
106\ display-message display display-panes displayp find-window findw if-shell
107\ if join-pane joinp move-pane movep kill-pane killp kill-server
108\ start-server start kill-session kill-window killw unlink-window unlinkw
109\ list-buffers lsb list-clients lsc list-keys lsk list-commands lscm
110\ list-panes lsp list-sessions ls list-windows lsw load-buffer loadb
111\ lock-server lock lock-session locks lock-client lockc move-window movew
112\ link-window linkw new-session new has-session has new-window neww
113\ paste-buffer pasteb pipe-pane pipep refresh-client refresh rename-session
114\ rename rename-window renamew resize-pane resizep respawn-pane respawnp
115\ respawn-window respawnw rotate-window rotatew run-shell run save-buffer
116\ saveb show-buffer showb select-layout selectl next-layout nextl
117\ previous-layout prevl select-pane selectp last-pane lastp select-window
118\ selectw next-window next previous-window prev last-window last send-keys
119\ send send-prefix set-buffer setb delete-buffer deleteb set-environment
120\ setenv set-hook show-hooks set-option set set-window-option setw
121\ show-environment showenv show-messages showmsgs show-options show
122\ show-window-options showw source-file source split-window splitw swap-pane
123\ swapp swap-window swapw switch-client switchc unbind-key unbind wait-for
124\ wait
125
126let &cpo = s:cpo_sav
127unlet! s:cpo_sav