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