Merged from the latest developing branch.
[MacVim.git] / runtime / syntax / readline.vim
blob1972e5af5df224ea8728aa4b835a7f00d2eabcb0
1 " Vim syntax file
2 " Language:         readline(3) configuration file
3 " Maintainer:       Nikolai Weibull <now@bitwi.se>
4 " Latest Revision:  2007-06-17
5 "   readline_has_bash - if defined add support for bash specific
6 "                       settings/functions
8 if exists("b:current_syntax")
9   finish
10 endif
12 let s:cpo_save = &cpo
13 set cpo&vim
15 setlocal iskeyword+=-
17 syn keyword readlineTodo        contained TODO FIXME XXX NOTE
19 syn region  readlineComment     display oneline start='^\s*#' end='$'
20                                 \ contains=readlineTodo,@Spell
22 syn match   readlineString      '^\s*[A-Za-z-]\+:'me=e-1 contains=readlineKeys
23 syn region  readlineString      display oneline start=+"+ skip=+\\\\\|\\"+
24                                 \ end=+"+ contains=readlineKeysTwo
26 syn case ignore
27 syn keyword readlineKeys        contained Control Meta Del Esc Escape LFD
28                                 \ Newline Ret Return Rubout Space Spc Tab
29 syn case match
31 syn match   readlineKeysTwo     contained display
32                                 \ +\\\([CM]-\|[e\\"'abdfnrtv]\|\o\{3}\|x\x\{3}\)+
34 syn match   readlineKeymaps     contained display
35                                 \ 'emacs\(-standard\|-meta\|-ctlx\)\='
36 syn match   readlineKeymaps     contained display
37                                 \ 'vi\(-move\|-command\|-insert\)\='
39 syn keyword readlineBellStyles  contained audible visible none
41 syn match   readlineNumber      contained display '\<\d\+\>'
43 syn case ignore
44 syn keyword readlineBoolean     contained on off
45 syn case match
47 syn keyword readlineIfOps       contained mode term
49 syn region  readlineConditional display oneline transparent
50                                 \ matchgroup=readlineConditional
51                                 \ start='^\s*$if' end="$"
52                                 \ contains=readlineIfOps,readlineKeymaps
53 syn match   readlineConditional display '^\s*$\(else\|endif\)\>'
55 syn match   readlineInclude     display '^\s*$include\>'
57 syn region  readlineSet         display oneline transparent
58                                 \ matchgroup=readlineKeyword start='^\s*set\>'
59                                 \ end="$"me=e-1 contains=readlineNumber,
60                                 \ readlineBoolean,readlineKeymaps,
61                                 \ readlineBellStyles,readlineSettings
63 syn keyword readlineSettings    contained bell-style comment-begin
64                                 \ completion-ignore-case completion-query-items
65                                 \ convert-meta disable-completion editing-mode
66                                 \ enable-keypad expand-tilde
67                                 \ horizontal-scroll-mode mark-directories
68                                 \ keymap mark-modified-lines meta-flag
69                                 \ input-meta output-meta
70                                 \ print-completions-horizontally
71                                 \ show-all-if-ambiguous visible-stats
72                                 \ prefer-visible-bell blink-matching-paren
73                                 \ match-hidden-files history-preserve-point
74                                 \ isearch-terminators
76 syn region  readlineBinding     display oneline transparent
77                                 \ matchgroup=readlineKeyword start=':' end='$'
78                                 \ contains=readlineKeys,readlineFunctions
80 syn keyword readlineFunctions   contained display
81                                 \ beginning-of-line end-of-line forward-char
82                                 \ backward-char forward-word backward-word
83                                 \ clear-screen redraw-current-line
84                                 \ accept-line previous-history
85                                 \ next-history beginning-of-history
86                                 \ end-of-history reverse-search-history
87                                 \ forward-search-history
88                                 \ non-incremental-reverse-search-history
89                                 \ non-incremental-forward-search-history
90                                 \ history-search-forward
91                                 \ history-search-backward
92                                 \ yank-nth-arg yank-last-arg
93                                 \ delete-char backward-delete-char
94                                 \ forward-backward-delete-char quoted-insert
95                                 \ tab-insert self-insert transpose-chars
96                                 \ transpose-words upcase-word downcase-word
97                                 \ capitalize-word overwrite-mode kill-line
98                                 \ backward-kill-line unix-line-discard
99                                 \ kill-whole-line kill-word backward-kill-word
100                                 \ unix-word-rubout unix-filename-rubout
101                                 \ delete-horizontal-space kill-region
102                                 \ copy-region-as-kill copy-backward-word
103                                 \ copy-forward-word yank yank-pop
104                                 \ digit-argument universal-argument complete
105                                 \ possible-completions insert-completions
106                                 \ menu-complete delete-char-or-list
107                                 \ start-kbd-macro end-kbd-macro
108                                 \ call-last-kbd-macro re-read-init-file
109                                 \ abort do-uppercase-version prefix-meta
110                                 \ undo revert-line tilde-expand set-mark
111                                 \ exchange-point-and-mark character-search
112                                 \ character-search-backward insert-comment
113                                 \ dump-functions dump-variables dump-macros
114                                 \ emacs-editing-mode vi-editing-mode
115                                 \ vi-complete vi-char-search vi-redo
116                                 \ vi-search vi-arg-digit vi-append-eol
117                                 \ vi-prev-word vi-change-to vi-delete-to
118                                 \ vi-end-word vi-fetch-history vi-insert-beg
119                                 \ vi-search-again vi-put vi-replace
120                                 \ vi-subst vi-yank-to vi-first-print
121                                 \ vi-yank-arg vi-goto-mark vi-append-mode
122                                 \ vi-insertion-mode prev-history vi-set-mark
123                                 \ vi-search-again vi-put vi-change-char
124                                 \ vi-subst vi-delete vi-yank-to
125                                 \ vi-column vi-change-case vi-overstrike
126                                 \ vi-overstrike-delete do-lowercase-version
127                                 \ delete-char-or-list tty-status
128                                 \ arrow-key-prefix vi-back-to-indent vi-bword
129                                 \ vi-bWord vi-eword vi-eWord vi-fword vi-fWord
130                                 \ vi-next-word
132 if exists("readline_has_bash")
133   syn keyword readlineFunctions contained
134                                 \ shell-expand-line history-expand-line
135                                 \ magic-space alias-expand-line
136                                 \ history-and-alias-expand-line
137                                 \ insert-last-argument operate-and-get-next
138                                 \ forward-backward-delete-char
139                                 \ delete-char-or-list complete-filename
140                                 \ possible-filename-completions
141                                 \ complete-username
142                                 \ possible-username-completions
143                                 \ complete-variable
144                                 \ possible-variable-completions
145                                 \ complete-hostname
146                                 \ possible-hostname-completions
147                                 \ complete-command
148                                 \ possible-command-completions
149                                 \ dynamic-complete-history
150                                 \ complete-into-braces
151                                 \ glob-expand-word glob-list-expansions
152                                 \ display-shell-version glob-complete-word
153                                 \ edit-and-execute-command
154 endif
156 hi def link readlineComment     Comment
157 hi def link readlineTodo        Todo
158 hi def link readlineString      String
159 hi def link readlineKeys        SpecialChar
160 hi def link readlineKeysTwo     SpecialChar
161 hi def link readlineKeymaps     Constant
162 hi def link readlineBellStyles  Constant
163 hi def link readlineNumber      Number
164 hi def link readlineBoolean     Boolean
165 hi def link readlineIfOps       Type
166 hi def link readlineConditional Conditional
167 hi def link readlineInclude     Include
168 hi def link readlineKeyword     Keyword
169 hi def link readlineSettings    Type
170 hi def link readlineFunctions   Type
172 let b:current_syntax = "readline"
174 let &cpo = s:cpo_save
175 unlet s:cpo_save