Ticket #51143: tmux.vim

File tmux.vim, 5.3 KB (added by tessus (Helmut K. C. Tessarek), 8 years ago)
Line 
1" Vim syntax file
2" Language: tmux(1) configuration file
3" Maintainer: Tiago Cunha <tcunha@users.sourceforge.net>
4" Last Change: $Date: 2010-07-27 18:29:07 $
5" License: This file is placed in the public domain.
6"
7" To install this file:
8"
9" - Drop the file in the syntax directory into runtimepath (such as
10"  ~/.vim/syntax/tmux.vim).
11" - Make the filetype recognisable by adding the following to filetype.vim
12"   (~/.vim/filetype.vim):
13"
14"       augroup filetypedetect
15"               au BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
16"       augroup END
17"
18" - Switch on syntax highlighting by adding "syntax enable" to .vimrc.
19"
20
21if version < 600
22        syntax clear
23elseif exists("b:current_syntax")
24        finish
25endif
26
27setlocal iskeyword+=-
28syntax case match
29
30syn keyword tmuxAction  any current none
31syn keyword tmuxBoolean off on
32
33syn keyword tmuxCmds
34        \ attach[-session]
35        \ bind[-key]
36        \ break-pane
37        \ breakp
38        \ capture-pane
39        \ capturep
40        \ choose-buffer
41        \ choose-client
42        \ choose-list
43        \ choose-session
44        \ choose-tree
45        \ choose-window
46        \ clear-history
47        \ clearhist
48        \ clock-mode
49        \ command-prompt
50        \ confirm[-before]
51        \ copy-mode
52        \ delete-buffer
53        \ deleteb
54        \ detach[-client]
55        \ display[-message]
56        \ display-panes
57        \ displayp
58        \ find-window
59        \ findw
60        \ has[-session]
61        \ if[-shell]
62        \ join-pane
63        \ joinp
64        \ kill-pane
65        \ killp
66        \ kill-server
67        \ kill-session
68        \ kill-window
69        \ killw
70        \ last-pane
71        \ lastp
72        \ last[-window]
73        \ link-window
74        \ linkw
75        \ list-buffers
76        \ lsb
77        \ list-clients
78        \ lsc
79        \ list-commands
80        \ lscm
81        \ list-keys
82        \ lsk
83        \ list-panes
84        \ lsp
85        \ list-sessions
86        \ ls
87        \ list-windows
88        \ lsw
89        \ load-buffer
90        \ loadb
91        \ lock-client
92        \ lockc
93        \ lock[-server]
94        \ lock-session
95        \ locks
96        \ move-pane
97        \ movep
98        \ move-window
99        \ movew
100        \ new[-session]
101        \ next-layout
102        \ nextl
103        \ next[-window]
104        \ paste-buffer
105        \ pasteb
106        \ pipe-pane
107        \ pipep
108        \ previous-layout
109        \ prevl
110        \ prev[ious-window]
111        \ refresh[-client]
112        \ rename[-session]
113        \ rename-window
114        \ renamew
115        \ resize-pane
116        \ resizep
117        \ respawn-pane
118        \ respawnp
119        \ respawn-window
120        \ respawnw
121        \ rotate-window
122        \ rotatew
123        \ run[-shell]
124        \ save-buffer
125        \ saveb
126        \ select-layout
127        \ selectl
128        \ select-pane
129        \ selectp
130        \ select-window
131        \ selectw
132        \ send[-keys]
133        \ send-prefix
134        \ server-info
135        \ info
136        \ set-buffer
137        \ setb
138        \ set-environment
139        \ setenv
140        \ set[-option]
141        \ set-window-option
142        \ setw
143        \ show-buffer
144        \ showb
145        \ show-environment
146        \ showenv
147        \ show-messages
148        \ showmsgs
149        \ show[-options]
150        \ show-window-options
151        \ showw
152        \ source[-file]
153        \ split-window
154        \ splitw
155        \ start[-server]
156        \ suspend-client
157        \ suspendc
158        \ swap-pane
159        \ swapp
160        \ swap-window
161        \ swapw
162        \ switch-client
163        \ switchc
164        \ unbind[-key]
165        \ unlink-window
166        \ unlinkw
167        \ wait[-for]
168
169syn keyword tmuxOptsSet
170        \ assume-paste-time
171        \ base-index
172        \ bell-action
173        \ bell-on-alert
174        \ buffer-limit
175        \ default-command
176        \ default-shell
177        \ default-terminal
178        \ destroy-unattached
179        \ detach-on-destroy
180        \ display-panes-active-colour
181        \ display-panes-colour
182        \ display-panes-time
183        \ display-time
184        \ escape-time
185        \ exit-unattached
186        \ focus-events
187        \ history-file
188        \ history-limit
189        \ lock-after-time
190        \ lock-command
191        \ lock-server
192        \ message-command-style
193        \ message-limit
194        \ message-style
195        \ mouse
196        \ mouse-utf8
197        \ pane-active-border-style
198        \ pane-border-style
199        \ prefix
200        \ prefix2
201        \ quiet
202        \ renumber-windows
203        \ repeat-time
204        \ set-clipboard
205        \ set-remain-on-exit
206        \ set-titles
207        \ set-titles-string
208        \ status
209        \ status-interval
210        \ status-justify
211        \ status-keys
212        \ status-left
213        \ status-left-length
214        \ status-left-style
215        \ status-position
216        \ status-right
217        \ status-right-length
218        \ status-utf8
219        \ staus-right-style
220        \ terminal-overrides
221        \ update-environment
222        \ visual-activity
223        \ visual-bell
224        \ visual-silence
225        \ word-separators
226
227syn keyword tmuxOptsSetw
228        \ aggressive-resize
229        \ allow-rename
230        \ alternate-screen
231        \ automatic-rename
232        \ clock-mode-colour
233        \ clock-mode-style
234        \ force-height
235        \ force-width
236        \ main-pane-height
237        \ main-pane-width
238        \ mode-keys
239        \ mode-style
240        \ monitor-activity
241        \ monitor-silence
242        \ other-pane-height
243        \ other-pane-width
244        \ pane-base-index
245        \ remain-on-exit
246        \ synchronize-panes
247        \ utf8
248        \ window-active-style
249        \ window-status-activity-style
250        \ window-status-bell-style
251        \ window-status-current-format
252        \ window-status-current-style
253        \ window-status-format
254        \ window-status-last-style
255        \ window-status-separator
256        \ window-status-style
257        \ window-style
258        \ wrap-search
259        \ xterm-keys
260
261syn keyword tmuxTodo FIXME NOTE TODO XXX contained
262
263syn match tmuxKey               /\(C-\|M-\|\^\)\+\S\+/  display
264syn match tmuxNumber            /\d\+/                  display
265syn match tmuxOptions           /\s-\a\+/               display
266syn match tmuxVariable          /\w\+=/                 display
267syn match tmuxVariableExpansion /\${\=\w\+}\=/          display
268
269" Comments can span multiple lines, when the newline is escaped
270" (with a single) backslash at the end.
271syn region tmuxComment  start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo
272syn region tmuxString   start=/"/ end=/"/ display oneline
273syn region tmuxString   start=/'/ end=/'/ display oneline
274
275hi def link tmuxAction                  Boolean
276hi def link tmuxBoolean                 Boolean
277hi def link tmuxCmds                    Keyword
278hi def link tmuxComment                 Comment
279hi def link tmuxKey                     Special
280hi def link tmuxNumber                  Number
281hi def link tmuxOptions                 Identifier
282hi def link tmuxOptsSet                 Function
283hi def link tmuxOptsSetw                Function
284hi def link tmuxString                  String
285hi def link tmuxTodo                    Todo
286hi def link tmuxVariable                Constant
287hi def link tmuxVariableExpansion       Constant
288
289let b:current_syntax = "tmux"