vim-polyglot/syntax/tmux.vim

334 lines
5.9 KiB
VimL
Raw Normal View History

if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
" Vim syntax file
" Language: tmux(1) configuration file
" Maintainer: Tiago Cunha <tcunha@users.sourceforge.net>
" License: This file is placed in the public domain.
2015-02-11 14:27:11 -05:00
"
" To install this file:
"
" - Drop the file in the syntax directory into runtimepath (such as
" ~/.vim/syntax/tmux.vim).
" - Make the filetype recognisable by adding the following to filetype.vim
" (~/.vim/filetype.vim):
"
" augroup filetypedetect
" au BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
" augroup END
"
" - Switch on syntax highlighting by adding "syntax enable" to .vimrc.
"
2017-12-30 05:10:32 -05:00
if v:version < 600
syntax clear
2017-12-30 05:10:32 -05:00
elseif exists('b:current_syntax')
finish
endif
setlocal iskeyword+=-
syntax case match
2017-05-17 05:07:28 -04:00
syn keyword tmuxAction any current default none
syn keyword tmuxBoolean off on
syn keyword tmuxCmds
2016-06-26 12:03:28 -04:00
\ attach
\ attach-session
\ bind
\ bind-key
2015-02-11 14:27:11 -05:00
\ break-pane
\ breakp
\ capture-pane
\ capturep
\ choose-buffer
\ choose-client
\ choose-session
\ choose-tree
\ choose-window
\ clear-history
\ clearhist
\ clock-mode
\ command-prompt
2016-06-26 12:03:28 -04:00
\ confirm
\ confirm-before
2015-02-11 14:27:11 -05:00
\ copy-mode
2017-12-30 05:10:32 -05:00
\ copy-mode-vi
2015-02-11 14:27:11 -05:00
\ delete-buffer
\ deleteb
2016-06-26 12:03:28 -04:00
\ detach
\ detach-client
\ display
\ display-message
2015-02-11 14:27:11 -05:00
\ display-panes
\ displayp
\ find-window
\ findw
2016-06-26 12:03:28 -04:00
\ has
\ has-session
\ if
\ if-shell
\ info
2015-02-11 14:27:11 -05:00
\ join-pane
\ joinp
\ kill-pane
\ kill-server
\ kill-session
\ kill-window
2016-06-26 12:03:28 -04:00
\ killp
2015-02-11 14:27:11 -05:00
\ killw
2016-06-26 12:03:28 -04:00
\ last
2015-02-11 14:27:11 -05:00
\ last-pane
2016-06-26 12:03:28 -04:00
\ last-window
2015-02-11 14:27:11 -05:00
\ lastp
\ link-window
\ linkw
\ list-buffers
\ list-clients
\ list-commands
\ list-keys
\ list-panes
\ list-sessions
\ list-windows
\ load-buffer
\ loadb
2016-06-26 12:03:28 -04:00
\ lock
2015-02-11 14:27:11 -05:00
\ lock-client
2016-06-26 12:03:28 -04:00
\ lock-server
2015-02-11 14:27:11 -05:00
\ lock-session
2016-06-26 12:03:28 -04:00
\ lockc
2015-02-11 14:27:11 -05:00
\ locks
2016-06-26 12:03:28 -04:00
\ ls
\ lsb
\ lsc
\ lscm
\ lsk
\ lsp
\ lsw
2015-02-11 14:27:11 -05:00
\ move-pane
\ move-window
2016-06-26 12:03:28 -04:00
\ movep
2015-02-11 14:27:11 -05:00
\ movew
2016-06-26 12:03:28 -04:00
\ new
\ new-session
\ new-window
\ neww
\ next
2015-02-11 14:27:11 -05:00
\ next-layout
2016-06-26 12:03:28 -04:00
\ next-window
2015-02-11 14:27:11 -05:00
\ nextl
\ paste-buffer
\ pasteb
2016-06-26 12:03:28 -04:00
\ path
2015-02-11 14:27:11 -05:00
\ pipe-pane
\ pipep
2016-06-26 12:03:28 -04:00
\ prev
2015-02-11 14:27:11 -05:00
\ previous-layout
2016-06-26 12:03:28 -04:00
\ previous-window
2015-02-11 14:27:11 -05:00
\ prevl
2016-06-26 12:03:28 -04:00
\ refresh
\ refresh-client
\ rename
\ rename-session
2015-02-11 14:27:11 -05:00
\ rename-window
\ renamew
\ resize-pane
\ resizep
\ respawn-pane
\ respawn-window
2016-06-26 12:03:28 -04:00
\ respawnp
2015-02-11 14:27:11 -05:00
\ respawnw
\ rotate-window
\ rotatew
2016-06-26 12:03:28 -04:00
\ run
\ run-shell
2015-02-11 14:27:11 -05:00
\ save-buffer
\ saveb
\ select-layout
\ select-pane
\ select-window
2016-06-26 12:03:28 -04:00
\ selectl
\ selectp
2015-02-11 14:27:11 -05:00
\ selectw
2016-06-26 12:03:28 -04:00
\ send
\ send-keys
2015-02-11 14:27:11 -05:00
\ send-prefix
\ server-info
2016-06-26 12:03:28 -04:00
\ set
2015-02-11 14:27:11 -05:00
\ set-buffer
\ set-environment
2016-06-26 12:03:28 -04:00
\ set-hook
\ set-option
2015-02-11 14:27:11 -05:00
\ set-window-option
2016-06-26 12:03:28 -04:00
\ setb
\ setenv
2015-02-11 14:27:11 -05:00
\ setw
2016-06-26 12:03:28 -04:00
\ show
2015-02-11 14:27:11 -05:00
\ show-buffer
\ show-environment
2016-06-26 12:03:28 -04:00
\ show-hooks
2015-02-11 14:27:11 -05:00
\ show-messages
2016-06-26 12:03:28 -04:00
\ show-options
2015-02-11 14:27:11 -05:00
\ show-window-options
2016-06-26 12:03:28 -04:00
\ showb
\ showenv
\ showmsgs
2015-02-11 14:27:11 -05:00
\ showw
2016-06-26 12:03:28 -04:00
\ source
\ source-file
2015-02-11 14:27:11 -05:00
\ split-window
\ splitw
2016-06-26 12:03:28 -04:00
\ start
\ start-server
2015-02-11 14:27:11 -05:00
\ suspend-client
\ suspendc
\ swap-pane
\ swap-window
2016-06-26 12:03:28 -04:00
\ swapp
2015-02-11 14:27:11 -05:00
\ swapw
\ switch-client
\ switchc
2016-06-26 12:03:28 -04:00
\ unbind
\ unbind-key
2015-02-11 14:27:11 -05:00
\ unlink-window
\ unlinkw
2016-06-26 12:03:28 -04:00
\ wait
\ wait-for
syn keyword tmuxOptsSet
2015-02-11 14:27:11 -05:00
\ assume-paste-time
\ base-index
\ bell-action
\ bell-on-alert
\ buffer-limit
\ default-command
\ default-shell
\ default-terminal
\ destroy-unattached
\ detach-on-destroy
\ display-panes-active-colour
\ display-panes-colour
\ display-panes-time
\ display-time
\ escape-time
\ exit-unattached
\ focus-events
2016-06-26 12:03:28 -04:00
\ history-file
2015-02-11 14:27:11 -05:00
\ history-limit
\ lock-after-time
\ lock-command
\ message-command-style
\ message-limit
\ message-style
2016-06-26 12:03:28 -04:00
\ mouse
2015-02-11 14:27:11 -05:00
\ prefix
\ prefix2
\ quiet
\ renumber-windows
\ repeat-time
\ set-clipboard
2015-02-11 14:27:11 -05:00
\ set-remain-on-exit
\ set-titles
\ set-titles-string
\ status
2016-09-11 07:24:17 -04:00
\ status-bg
\ status-fg
2015-02-11 14:27:11 -05:00
\ status-interval
\ status-justify
\ status-keys
\ status-left
\ status-left-length
\ status-left-style
\ status-position
\ status-right
\ status-right-length
2016-06-26 12:03:28 -04:00
\ status-right-style
\ status-style
2015-02-11 14:27:11 -05:00
\ terminal-overrides
\ update-environment
\ visual-activity
\ visual-bell
\ visual-silence
\ word-separators
syn keyword tmuxOptsSetw
2015-02-11 14:27:11 -05:00
\ aggressive-resize
\ allow-rename
\ alternate-screen
\ automatic-rename
2016-06-26 12:03:28 -04:00
\ automatic-rename-format
2015-02-11 14:27:11 -05:00
\ clock-mode-colour
\ clock-mode-style
\ force-height
\ force-width
\ main-pane-height
\ main-pane-width
2017-05-17 05:07:28 -04:00
\ message-attr
\ message-bg
\ message-fg
2015-02-11 14:27:11 -05:00
\ mode-keys
\ mode-style
\ monitor-activity
\ monitor-silence
\ other-pane-height
\ other-pane-width
2017-05-17 05:07:28 -04:00
\ pane-active-border-bg
\ pane-active-border-fg
2016-06-26 12:03:28 -04:00
\ pane-active-border-style
2015-02-11 14:27:11 -05:00
\ pane-base-index
2017-05-17 05:07:28 -04:00
\ pane-border-fg
2016-06-26 12:03:28 -04:00
\ pane-border-style
2015-02-11 14:27:11 -05:00
\ remain-on-exit
\ synchronize-panes
2016-06-26 12:03:28 -04:00
\ window-active-style
2017-05-17 05:07:28 -04:00
\ window-status-activity-attr
\ window-status-activity-bg
\ window-status-activity-fg
2015-02-11 14:27:11 -05:00
\ window-status-activity-style
\ window-status-bell-style
2017-05-17 05:07:28 -04:00
\ window-status-bg
\ window-status-current-attr
2016-09-11 07:24:17 -04:00
\ window-status-current-bg
2016-12-20 14:57:20 -05:00
\ window-status-current-fg
2015-02-11 14:27:11 -05:00
\ window-status-current-format
\ window-status-current-style
2017-05-17 05:07:28 -04:00
\ window-status-fg
2015-02-11 14:27:11 -05:00
\ window-status-format
\ window-status-last-style
\ window-status-separator
\ window-status-style
2016-06-26 12:03:28 -04:00
\ window-style
2015-02-11 14:27:11 -05:00
\ wrap-search
\ xterm-keys
syn keyword tmuxTodo FIXME NOTE TODO XXX contained
syn match tmuxKey /\(C-\|M-\|\^\)\+\S\+/ display
2017-05-17 05:07:28 -04:00
syn match tmuxNumber /\<\d\+\>/ display
syn match tmuxOptions /\s-\a\+/ display
syn match tmuxVariable /\w\+=/ display
syn match tmuxVariableExpansion /\${\=\w\+}\=/ display
2016-06-26 12:03:28 -04:00
" Comments can span multiple lines, when the newline is escaped
" (with a single) backslash at the end.
syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo
syn region tmuxString start=/"/ end=/"/ display oneline
syn region tmuxString start=/'/ end=/'/ display oneline
hi def link tmuxAction Boolean
hi def link tmuxBoolean Boolean
hi def link tmuxCmds Keyword
hi def link tmuxComment Comment
hi def link tmuxKey Special
hi def link tmuxNumber Number
hi def link tmuxOptions Identifier
hi def link tmuxOptsSet Function
hi def link tmuxOptsSetw Function
hi def link tmuxString String
hi def link tmuxTodo Todo
hi def link tmuxVariable Constant
hi def link tmuxVariableExpansion Constant
2017-12-30 05:10:32 -05:00
let b:current_syntax = 'tmux'
endif