Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 1 | " Language: tmux(1) configuration file |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 2 | " Version: 3.2a (git-44ada9cd) |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 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 | 6c391a7 | 2021-09-09 21:55:11 +0200 | [diff] [blame] | 11 | " Explicitly change compatibility options to Vim's defaults because this file |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 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 | 0b0f099 | 2018-05-22 21:41:30 +0200 | [diff] [blame] | 17 | syntax iskeyword @,48-57,_,192-255,- |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 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 |
Bram Moolenaar | 0b0f099 | 2018-05-22 21:41:30 +0200 | [diff] [blame] | 27 | syn match tmuxNumber /\<\d\+\>/ display |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 28 | syn match tmuxFlags /\s-\a\+/ display |
| 29 | syn match tmuxVariable /\w\+=/ display |
| 30 | syn match tmuxVariableExpansion /\${\=\w\+}\=/ display |
Bram Moolenaar | 9135901 | 2019-11-30 17:57:03 +0100 | [diff] [blame] | 31 | syn match tmuxControl /%\(if\|elif\|else\|endif\)/ |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 32 | |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 33 | syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo,@Spell |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 34 | |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 35 | syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString,@Spell |
| 36 | syn region tmuxString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString,@Spell |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 37 | |
| 38 | " TODO: Figure out how escaping works inside of #(...) and #{...} blocks. |
| 39 | syn region tmuxFormatString start=/#[#DFhHIPSTW]/ end=// contained keepend |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 40 | syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ keepend |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 41 | syn region tmuxFormatString start=/#(/ skip=/#(.\{-})/ end=/)/ contained keepend |
| 42 | |
| 43 | hi def link tmuxFormatString Identifier |
| 44 | hi def link tmuxAction Boolean |
| 45 | hi def link tmuxBoolean Boolean |
| 46 | hi def link tmuxCommands Keyword |
Bram Moolenaar | 9135901 | 2019-11-30 17:57:03 +0100 | [diff] [blame] | 47 | hi def link tmuxControl Keyword |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 48 | hi def link tmuxComment Comment |
| 49 | hi def link tmuxKey Special |
| 50 | hi def link tmuxNumber Number |
| 51 | hi def link tmuxFlags Identifier |
| 52 | hi def link tmuxOptions Function |
| 53 | hi def link tmuxString String |
| 54 | hi def link tmuxTodo Todo |
| 55 | hi def link tmuxVariable Identifier |
| 56 | hi def link tmuxVariableExpansion Identifier |
| 57 | |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 58 | " Make the foreground of colourXXX keywords match the color they represent |
| 59 | " when g:tmux_syntax_colors is unset or set to a non-zero value. |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 60 | " Darker colors have their background set to white. |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 61 | if get(g:, "tmux_syntax_colors", 1) |
| 62 | for s:i in range(0, 255) |
| 63 | let s:bg = (!s:i || s:i == 16 || (s:i > 231 && s:i < 235)) ? 15 : "none" |
| 64 | exec "syn match tmuxColour" . s:i . " /\\<colour" . s:i . "\\>/ display" |
| 65 | \ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg |
| 66 | endfor |
| 67 | endif |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 68 | |
| 69 | syn keyword tmuxOptions |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 70 | \ backspace buffer-limit command-alias copy-command default-terminal editor |
| 71 | \ escape-time exit-empty activity-action assume-paste-time base-index |
| 72 | \ bell-action default-command default-shell default-size destroy-unattached |
Bram Moolenaar | 9135901 | 2019-11-30 17:57:03 +0100 | [diff] [blame] | 73 | \ detach-on-destroy display-panes-active-colour display-panes-colour |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 74 | \ display-panes-time display-time exit-unattached extended-keys focus-events |
| 75 | \ history-file history-limit key-table lock-after-time lock-command |
| 76 | \ message-command-style message-limit message-style aggressive-resize |
| 77 | \ allow-rename alternate-screen automatic-rename automatic-rename-format |
| 78 | \ clock-mode-colour clock-mode-style copy-mode-current-match-style |
| 79 | \ copy-mode-mark-style copy-mode-match-style main-pane-height |
| 80 | \ main-pane-width mode-keys mode-style monitor-activity monitor-bell |
| 81 | \ monitor-silence mouse other-pane-height other-pane-width |
| 82 | \ pane-active-border-style pane-base-index pane-border-format |
| 83 | \ pane-border-lines pane-border-status pane-border-style pane-colours prefix |
| 84 | \ prefix2 prompt-history-limit remain-on-exit renumber-windows repeat-time |
| 85 | \ set-clipboard set-titles set-titles-string silence-action status status-bg |
| 86 | \ status-fg status-format status-interval status-justify status-keys |
| 87 | \ status-left status-left-length status-left-style status-position |
| 88 | \ status-right status-right-length status-right-style status-style |
| 89 | \ synchronize-panes terminal-features terminal-overrides update-environment |
| 90 | \ user-keys visual-activity visual-bell visual-silence window-active-style |
| 91 | \ window-size window-status-activity-style window-status-bell-style |
Bram Moolenaar | 9135901 | 2019-11-30 17:57:03 +0100 | [diff] [blame] | 92 | \ window-status-current-format window-status-current-style |
| 93 | \ window-status-format window-status-last-style window-status-separator |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 94 | \ window-status-style window-style word-separators wrap-search |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 95 | |
| 96 | syn keyword tmuxCommands |
Bram Moolenaar | 0b0f099 | 2018-05-22 21:41:30 +0200 | [diff] [blame] | 97 | \ attach attach-session bind bind-key break-pane breakp capture-pane |
| 98 | \ capturep choose-buffer choose-client choose-tree clear-history clearhist |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 99 | \ clock-mode command-prompt confirm confirm-before copy-mode customize-mode |
| 100 | \ detach detach-client display display-menu display-message display-panes |
| 101 | \ display-popup displayp find-window findw if if-shell join-pane joinp |
| 102 | \ kill-pane kill-server kill-session kill-window killp has has-session killw |
| 103 | \ link-window linkw list-buffers list-clients list-commands list-keys |
| 104 | \ list-panes list-sessions list-windows load-buffer loadb lock lock-client |
| 105 | \ lock-server lock-session lockc last-pane lastp locks ls last last-window |
| 106 | \ lsb delete-buffer deleteb lsc lscm lsk lsp lsw menu move-pane move-window |
| 107 | \ clear-prompt-history clearphist movep movew new new-session new-window |
| 108 | \ neww next next-layout next-window nextl paste-buffer pasteb pipe-pane |
| 109 | \ pipep popup prev previous-layout previous-window prevl refresh |
| 110 | \ refresh-client rename rename-session rename-window renamew resize-pane |
| 111 | \ resize-window resizep resizew respawn-pane respawn-window respawnp |
| 112 | \ respawnw rotate-window rotatew run run-shell save-buffer saveb |
Bram Moolenaar | 68e6560 | 2019-05-26 21:33:31 +0200 | [diff] [blame] | 113 | \ select-layout select-pane select-window selectl selectp selectw send |
| 114 | \ send-keys send-prefix set set-buffer set-environment set-hook set-option |
| 115 | \ set-window-option setb setenv setw show show-buffer show-environment |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 116 | \ show-hooks show-messages show-options show-prompt-history |
| 117 | \ show-window-options showb showenv showmsgs showphist showw source |
| 118 | \ source-file split-window splitw start start-server suspend-client suspendc |
| 119 | \ swap-pane swap-window swapp swapw switch-client switchc unbind unbind-key |
| 120 | \ unlink-window unlinkw wait wait-for |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 121 | |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 122 | let &cpo = s:original_cpo |
| 123 | unlet! s:original_cpo s:bg s:i |