1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-21 17:25:11 +01:00
vim/runtime/syntax/readline.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

412 lines
17 KiB
VimL
Raw Normal View History

2004-06-13 20:20:40 +00:00
" Vim syntax file
2017-03-05 17:04:09 +01:00
" Language: readline(3) configuration file
2018-01-28 22:47:25 +01:00
" Maintainer: Daniel Moch <daniel@danielmoch.com>
2017-03-05 17:04:09 +01:00
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
2018-07-29 15:07:52 +02:00
" Latest Revision: 2018-07-26
" Add new functions for Readline 7 / Bash 4.4
" (credit: Github user bewuethr)
2004-06-13 20:20:40 +00:00
2011-05-10 17:18:44 +02:00
if exists('b:current_syntax')
2004-06-13 20:20:40 +00:00
finish
endif
2005-06-29 22:40:58 +00:00
let s:cpo_save = &cpo
set cpo&vim
2008-06-24 21:56:24 +00:00
setlocal iskeyword+=-
2004-06-13 20:20:40 +00:00
2011-05-10 17:18:44 +02:00
syn match readlineKey contained
\ '\S'
\ nextgroup=readlineKeyTerminator
2004-06-13 20:20:40 +00:00
2011-05-10 17:18:44 +02:00
syn match readlineBegin display '^'
\ nextgroup=readlineComment,
\ readlineConditional,
\ readlineInclude,
\ readlineKeyName,
\ readlineKey,
\ readlineKeySeq,
\ readlineKeyword
\ skipwhite
2004-06-13 20:20:40 +00:00
2011-05-10 17:18:44 +02:00
syn region readlineComment contained display oneline
\ start='#'
\ end='$'
\ contains=readlineTodo,
\ @Spell
syn keyword readlineTodo contained
\ TODO
\ FIXME
\ XXX
\ NOTE
syn match readlineConditional contained
\ '$if\>'
\ nextgroup=readlineTest,
\ readlineTestApp
\ skipwhite
syn keyword readlineTest contained
\ mode
\ nextgroup=readlineTestModeEq
syn match readlineTestModeEq contained
\ '='
\ nextgroup=readlineEditingMode
syn keyword readlineTest contained
\ term
\ nextgroup=readlineTestTermEq
syn match readlineTestTermEq contained
\ '='
\ nextgroup=readlineTestTerm
syn match readlineTestTerm contained
\ '\S\+'
syn match readlineTestApp contained
\ '\S\+'
syn match readlineConditional contained display
\ '$\%(else\|endif\)\>'
syn match readlineInclude contained display
\ '$include\>'
\ nextgroup=readlinePath
syn match readlinePath contained display
\ '.\+'
2004-06-13 20:20:40 +00:00
syn case ignore
2011-05-10 17:18:44 +02:00
syn match readlineKeyName contained display
\ nextgroup=readlineKeySeparator,
\ readlineKeyTerminator
\ '\%(Control\|Del\|Esc\|Escape\|LFD\|Meta\|Newline\|Ret\|Return\|Rubout\|Space\|Spc\|Tab\)'
2004-06-13 20:20:40 +00:00
syn case match
2011-05-10 17:18:44 +02:00
syn match readlineKeySeparator contained
\ '-'
\ nextgroup=readlineKeyName,
\ readlineKey
syn match readlineKeyTerminator contained
\ ':'
\ nextgroup=readlineFunction
\ skipwhite
2004-06-13 20:20:40 +00:00
2011-05-10 17:18:44 +02:00
syn region readlineKeySeq contained display oneline
\ start=+"+
\ skip=+\\\\\|\\"+
\ end=+"+
\ contains=readlineKeyEscape
\ nextgroup=readlineKeyTerminator
2004-06-13 20:20:40 +00:00
2011-05-10 17:18:44 +02:00
syn match readlineKeyEscape contained display
\ +\\\([CM]-\|[e\\"'abdfnrtv]\|\o\{3}\|x\x\{2}\)+
2004-06-13 20:20:40 +00:00
2011-05-10 17:18:44 +02:00
syn keyword readlineKeyword contained
\ set
\ nextgroup=readlineVariable
\ skipwhite
2018-07-29 15:07:52 +02:00
syn keyword readlineVariable contained
2011-05-10 17:18:44 +02:00
\ nextgroup=readlineBellStyle
\ skipwhite
\ bell-style
syn keyword readlineVariable contained
\ nextgroup=readlineBoolean
\ skipwhite
\ bind-tty-special-chars
2018-07-29 15:07:52 +02:00
\ blink-matching-paren
\ colored-completion-prefix
2017-09-19 22:06:03 +02:00
\ colored-stats
2011-05-10 17:18:44 +02:00
\ completion-ignore-case
\ completion-map-case
\ convert-meta
\ disable-completion
\ echo-control-characters
2018-07-29 15:07:52 +02:00
\ enable-bracketed-paste
2011-05-10 17:18:44 +02:00
\ enable-keypad
\ enable-meta-key
\ expand-tilde
\ history-preserve-point
\ horizontal-scroll-mode
\ input-meta
\ meta-flag
\ mark-directories
\ mark-modified-lines
\ mark-symlinked-directories
\ match-hidden-files
\ menu-complete-display-prefix
\ output-meta
\ page-completions
\ print-completions-horizontally
\ revert-all-at-newline
\ show-all-if-ambiguous
\ show-all-if-unmodified
2017-09-19 22:06:03 +02:00
\ show-mode-in-prompt
2011-05-10 17:18:44 +02:00
\ skip-completed-text
\ visible-stats
syn keyword readlineVariable contained
\ nextgroup=readlineString
\ skipwhite
\ comment-begin
\ isearch-terminators
2018-01-28 22:47:25 +01:00
\ vi-cmd-mode-string
\ vi-ins-mode-string
\ emacs-mode-string
2011-05-10 17:18:44 +02:00
syn keyword readlineVariable contained
\ nextgroup=readlineNumber
\ skipwhite
\ completion-display-width
\ completion-prefix-display-length
\ completion-query-items
\ history-size
2017-09-19 22:06:03 +02:00
\ keyseq-timeout
2011-05-10 17:18:44 +02:00
syn keyword readlineVariable contained
\ nextgroup=readlineEditingMode
\ skipwhite
\ editing-mode
syn keyword readlineVariable contained
\ nextgroup=readlineKeymap
\ skipwhite
\ keymap
syn keyword readlineBellStyle contained
\ audible
\ visible
\ none
2004-06-13 20:20:40 +00:00
syn case ignore
2011-05-10 17:18:44 +02:00
syn keyword readlineBoolean contained
\ on
\ off
2004-06-13 20:20:40 +00:00
syn case match
2011-05-10 17:18:44 +02:00
syn region readlineString contained display oneline
\ matchgroup=readlineStringDelimiter
\ start=+"+
\ skip=+\\\\\|\\"+
\ end=+"+
syn match readlineNumber contained display
\ '[+-]\d\+\>'
syn keyword readlineEditingMode contained
\ emacs
\ vi
syn match readlineKeymap contained display
\ 'emacs\%(-\%(standard\|meta\|ctlx\)\)\=\|vi\%(-\%(move\|command\|insert\)\)\='
syn keyword readlineFunction contained
\ beginning-of-line
\ end-of-line
\ forward-char
\ backward-char
\ forward-word
\ backward-word
\ clear-screen
\ redraw-current-line
\
\ accept-line
\ previous-history
\ next-history
\ beginning-of-history
\ end-of-history
\ reverse-search-history
\ forward-search-history
\ non-incremental-reverse-search-history
\ non-incremental-forward-search-history
\ history-search-forward
\ history-search-backward
\ yank-nth-arg
\ yank-last-arg
\
\ delete-char
\ backward-delete-char
\ forward-backward-delete-char
\ quoted-insert
\ tab-insert
\ self-insert
\ transpose-chars
\ transpose-words
\ upcase-word
\ downcase-word
\ capitalize-word
\ overwrite-mode
\
\ kill-line
\ backward-kill-line
\ unix-line-discard
\ kill-whole-line
\ kill-word
\ backward-kill-word
\ unix-word-rubout
\ unix-filename-rubout
\ delete-horizontal-space
\ kill-region
\ copy-region-as-kill
\ copy-backward-word
\ copy-forward-word
\ yank
\ yank-pop
\
\ digit-argument
\ universal-argument
\
\ complete
\ possible-completions
\ insert-completions
\ menu-complete
2012-04-25 19:07:41 +02:00
\ menu-complete-backward
2011-05-10 17:18:44 +02:00
\ delete-char-or-list
\
\ start-kbd-macro
\ end-kbd-macro
\ call-last-kbd-macro
2018-07-29 15:07:52 +02:00
\ print-last-kbd-macro
2011-05-10 17:18:44 +02:00
\
\ re-read-init-file
\ abort
\ do-uppercase-version
\ prefix-meta
\ undo
\ revert-line
\ tilde-expand
\ set-mark
\ exchange-point-and-mark
\ character-search
\ character-search-backward
\ skip-csi-sequence
\ insert-comment
\ dump-functions
\ dump-variables
\ dump-macros
\ emacs-editing-mode
\ vi-editing-mode
\
\ vi-eof-maybe
\ vi-movement-mode
\ vi-undo
\ vi-match
\ vi-tilde-expand
\ vi-complete
\ vi-char-search
\ vi-redo
\ vi-search
\ vi-arg-digit
\ vi-append-eol
\ vi-prev-word
\ vi-change-to
\ vi-delete-to
\ vi-end-word
\ vi-char-search
\ vi-fetch-history
\ vi-insert-beg
\ vi-search-again
\ vi-put
\ vi-replace
\ vi-subst
\ vi-char-search
\ vi-next-word
\ vi-yank-to
\ vi-first-print
\ vi-yank-arg
\ vi-goto-mark
\ vi-append-mode
\ vi-prev-word
\ vi-change-to
\ vi-delete-to
\ vi-end-word
\ vi-char-search
\ vi-insert-mode
\ vi-set-mark
\ vi-search-again
\ vi-put
\ vi-change-char
\ vi-subst
\ vi-char-search
\ vi-undo
\ vi-next-word
\ vi-delete
\ vi-yank-to
\ vi-column
\ vi-change-case
2004-06-13 20:20:40 +00:00
if exists("readline_has_bash")
2011-05-10 17:18:44 +02:00
syn keyword readlineFunction contained
2018-07-29 15:07:52 +02:00
\ shell-forward-word
\ shell-backward-word
2011-05-10 17:18:44 +02:00
\ shell-expand-line
\ history-expand-line
\ magic-space
\ alias-expand-line
\ history-and-alias-expand-line
\ insert-last-argument
\ operate-and-get-next
\ forward-backward-delete-char
2018-07-29 15:07:52 +02:00
\ shell-kill-word
\ shell-backward-kill-word
2011-05-10 17:18:44 +02:00
\ delete-char-or-list
\ complete-filename
\ possible-filename-completions
\ complete-username
\ possible-username-completions
\ complete-variable
\ possible-variable-completions
\ complete-hostname
\ possible-hostname-completions
\ complete-command
\ possible-command-completions
\ dynamic-complete-history
2018-07-29 15:07:52 +02:00
\ dabbrev-expand
2011-05-10 17:18:44 +02:00
\ complete-into-braces
\ glob-expand-word
\ glob-list-expansions
\ display-shell-version
\ glob-complete-word
\ edit-and-execute-command
2004-06-13 20:20:40 +00:00
endif
2011-05-10 17:18:44 +02:00
hi def link readlineKey readlineKeySeq
hi def link readlineComment Comment
hi def link readlineTodo Todo
hi def link readlineConditional Conditional
hi def link readlineTest Type
hi def link readlineDelimiter Delimiter
hi def link readlineTestModeEq readlineEq
hi def link readlineTestTermEq readlineEq
hi def link readlineTestTerm readlineString
hi def link readlineTestAppEq readlineEq
hi def link readlineTestApp readlineString
hi def link readlineInclude Include
hi def link readlinePath String
hi def link readlineKeyName SpecialChar
hi def link readlineKeySeparator readlineKeySeq
hi def link readlineKeyTerminator readlineDelimiter
hi def link readlineKeySeq String
hi def link readlineKeyEscape SpecialChar
hi def link readlineKeyword Keyword
hi def link readlineVariable Identifier
hi def link readlineBellStyle Constant
hi def link readlineBoolean Boolean
hi def link readlineString String
hi def link readlineStringDelimiter readlineString
hi def link readlineNumber Number
hi def link readlineEditingMode Constant
hi def link readlineKeymap Constant
hi def link readlineFunction Function
let b:current_syntax = 'readline'
2004-06-13 20:20:40 +00:00
2005-06-29 22:40:58 +00:00
let &cpo = s:cpo_save
unlet s:cpo_save