home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / runtime / dos / syntax / readline.vim < prev    next >
Encoding:
Text File  |  2012-05-31  |  16.6 KB  |  396 lines

  1. " Vim syntax file
  2. " Language:         readline(3) configuration file
  3. " Maintainer:       Nikolai Weibull <now@bitwi.se>
  4. " Latest Revision:  2012-04-25
  5. "   readline_has_bash - if defined add support for bash specific
  6. "                       settings/functions
  7.  
  8. if exists('b:current_syntax')
  9.   finish
  10. endif
  11.  
  12. let s:cpo_save = &cpo
  13. set cpo&vim
  14.  
  15. setlocal iskeyword+=-
  16.  
  17. syn match   readlineKey         contained
  18.                               \ '\S'
  19.                               \ nextgroup=readlineKeyTerminator
  20.  
  21. syn match   readlineBegin       display '^'
  22.                               \ nextgroup=readlineComment,
  23.                               \           readlineConditional,
  24.                               \           readlineInclude,
  25.                               \           readlineKeyName,
  26.                               \           readlineKey,
  27.                               \           readlineKeySeq,
  28.                               \           readlineKeyword
  29.                               \ skipwhite
  30.  
  31. syn region  readlineComment     contained display oneline
  32.                                 \ start='#'
  33.                                 \ end='$'
  34.                                 \ contains=readlineTodo,
  35.                                 \          @Spell
  36.  
  37. syn keyword readlineTodo        contained
  38.                               \ TODO
  39.                               \ FIXME
  40.                               \ XXX
  41.                               \ NOTE
  42.  
  43. syn match   readlineConditional contained
  44.                               \ '$if\>'
  45.                               \ nextgroup=readlineTest,
  46.                               \           readlineTestApp
  47.                               \ skipwhite
  48.  
  49. syn keyword readlineTest        contained
  50.                               \ mode
  51.                               \ nextgroup=readlineTestModeEq
  52.  
  53. syn match   readlineTestModeEq  contained
  54.                               \ '='
  55.                               \ nextgroup=readlineEditingMode
  56.  
  57. syn keyword readlineTest        contained
  58.                               \ term
  59.                               \ nextgroup=readlineTestTermEq
  60.  
  61. syn match   readlineTestTermEq  contained
  62.                               \ '='
  63.                               \ nextgroup=readlineTestTerm
  64.  
  65. syn match   readlineTestTerm    contained
  66.                               \ '\S\+'
  67.  
  68. syn match   readlineTestApp     contained
  69.                               \ '\S\+'
  70.  
  71. syn match   readlineConditional contained display
  72.                               \ '$\%(else\|endif\)\>'
  73.  
  74. syn match   readlineInclude     contained display
  75.                               \ '$include\>'
  76.                               \ nextgroup=readlinePath
  77.  
  78. syn match   readlinePath        contained display
  79.                               \ '.\+'
  80.  
  81. syn case ignore
  82. syn match   readlineKeyName     contained display
  83.                               \ nextgroup=readlineKeySeparator,
  84.                               \           readlineKeyTerminator
  85.                               \ '\%(Control\|Del\|Esc\|Escape\|LFD\|Meta\|Newline\|Ret\|Return\|Rubout\|Space\|Spc\|Tab\)'
  86. syn case match
  87.  
  88. syn match   readlineKeySeparator  contained
  89.                                 \ '-'
  90.                                 \ nextgroup=readlineKeyName,
  91.                                 \           readlineKey
  92.  
  93. syn match   readlineKeyTerminator contained
  94.                                 \ ':'
  95.                                 \ nextgroup=readlineFunction
  96.                                 \ skipwhite
  97.  
  98. syn region  readlineKeySeq     contained display oneline
  99.                               \ start=+"+
  100.                               \ skip=+\\\\\|\\"+
  101.                               \ end=+"+
  102.                               \ contains=readlineKeyEscape
  103.                               \ nextgroup=readlineKeyTerminator
  104.  
  105. syn match   readlineKeyEscape   contained display
  106.                               \ +\\\([CM]-\|[e\\"'abdfnrtv]\|\o\{3}\|x\x\{2}\)+
  107.  
  108. syn keyword readlineKeyword     contained
  109.                               \ set
  110.                               \ nextgroup=readlineVariable
  111.                               \ skipwhite
  112.  
  113. syn keyword readlineVariable    contained 
  114.                               \ nextgroup=readlineBellStyle
  115.                               \ skipwhite
  116.                               \ bell-style
  117.  
  118. syn keyword readlineVariable    contained
  119.                               \ nextgroup=readlineBoolean
  120.                               \ skipwhite
  121.                               \ bind-tty-special-chars
  122.                               \ completion-ignore-case
  123.                               \ completion-map-case
  124.                               \ convert-meta
  125.                               \ disable-completion
  126.                               \ echo-control-characters
  127.                               \ enable-keypad
  128.                               \ enable-meta-key
  129.                               \ expand-tilde
  130.                               \ history-preserve-point
  131.                               \ horizontal-scroll-mode
  132.                               \ input-meta
  133.                               \ meta-flag
  134.                               \ mark-directories
  135.                               \ mark-modified-lines
  136.                               \ mark-symlinked-directories
  137.                               \ match-hidden-files
  138.                               \ menu-complete-display-prefix
  139.                               \ output-meta
  140.                               \ page-completions
  141.                               \ print-completions-horizontally
  142.                               \ revert-all-at-newline
  143.                               \ show-all-if-ambiguous
  144.                               \ show-all-if-unmodified
  145.                               \ skip-completed-text
  146.                               \ visible-stats
  147.  
  148. syn keyword readlineVariable    contained
  149.                               \ nextgroup=readlineString
  150.                               \ skipwhite
  151.                               \ comment-begin
  152.                               \ isearch-terminators
  153.  
  154. syn keyword readlineVariable    contained
  155.                               \ nextgroup=readlineNumber
  156.                               \ skipwhite
  157.                               \ completion-display-width
  158.                               \ completion-prefix-display-length
  159.                               \ completion-query-items
  160.                               \ history-size
  161.  
  162. syn keyword readlineVariable    contained
  163.                               \ nextgroup=readlineEditingMode
  164.                               \ skipwhite
  165.                               \ editing-mode
  166.  
  167. syn keyword readlineVariable    contained
  168.                               \ nextgroup=readlineKeymap
  169.                               \ skipwhite
  170.                               \ keymap
  171.  
  172. syn keyword readlineBellStyle   contained
  173.                               \ audible
  174.                               \ visible
  175.                               \ none
  176.  
  177. syn case ignore
  178. syn keyword readlineBoolean     contained
  179.                               \ on
  180.                               \ off
  181. syn case match
  182.  
  183. syn region  readlineString      contained display oneline
  184.                               \ matchgroup=readlineStringDelimiter
  185.                               \ start=+"+
  186.                               \ skip=+\\\\\|\\"+
  187.                               \ end=+"+
  188.  
  189. syn match   readlineNumber      contained display
  190.                               \ '[+-]\d\+\>'
  191.  
  192. syn keyword readlineEditingMode contained
  193.                               \ emacs
  194.                               \ vi
  195.  
  196. syn match   readlineKeymap      contained display
  197.                               \ 'emacs\%(-\%(standard\|meta\|ctlx\)\)\=\|vi\%(-\%(move\|command\|insert\)\)\='
  198.  
  199. syn keyword readlineFunction    contained
  200.                               \ beginning-of-line
  201.                               \ end-of-line
  202.                               \ forward-char
  203.                               \ backward-char
  204.                               \ forward-word
  205.                               \ backward-word
  206.                               \ clear-screen
  207.                               \ redraw-current-line
  208.                               \
  209.                               \ accept-line
  210.                               \ previous-history
  211.                               \ next-history
  212.                               \ beginning-of-history
  213.                               \ end-of-history
  214.                               \ reverse-search-history
  215.                               \ forward-search-history
  216.                               \ non-incremental-reverse-search-history
  217.                               \ non-incremental-forward-search-history
  218.                               \ history-search-forward
  219.                               \ history-search-backward
  220.                               \ yank-nth-arg
  221.                               \ yank-last-arg
  222.                               \
  223.                               \ delete-char
  224.                               \ backward-delete-char
  225.                               \ forward-backward-delete-char
  226.                               \ quoted-insert
  227.                               \ tab-insert
  228.                               \ self-insert
  229.                               \ transpose-chars
  230.                               \ transpose-words
  231.                               \ upcase-word
  232.                               \ downcase-word
  233.                               \ capitalize-word
  234.                               \ overwrite-mode
  235.                               \
  236.                               \ kill-line
  237.                               \ backward-kill-line
  238.                               \ unix-line-discard
  239.                               \ kill-whole-line
  240.                               \ kill-word
  241.                               \ backward-kill-word
  242.                               \ unix-word-rubout
  243.                               \ unix-filename-rubout
  244.                               \ delete-horizontal-space
  245.                               \ kill-region
  246.                               \ copy-region-as-kill
  247.                               \ copy-backward-word
  248.                               \ copy-forward-word
  249.                               \ yank
  250.                               \ yank-pop
  251.                               \
  252.                               \ digit-argument
  253.                               \ universal-argument
  254.                               \
  255.                               \ complete
  256.                               \ possible-completions
  257.                               \ insert-completions
  258.                               \ menu-complete
  259.                               \ menu-complete-backward
  260.                               \ delete-char-or-list
  261.                               \
  262.                               \ start-kbd-macro
  263.                               \ end-kbd-macro
  264.                               \ call-last-kbd-macro
  265.                               \
  266.                               \ re-read-init-file
  267.                               \ abort
  268.                               \ do-uppercase-version
  269.                               \ prefix-meta
  270.                               \ undo
  271.                               \ revert-line
  272.                               \ tilde-expand
  273.                               \ set-mark
  274.                               \ exchange-point-and-mark
  275.                               \ character-search
  276.                               \ character-search-backward
  277.                               \ skip-csi-sequence
  278.                               \ insert-comment
  279.                               \ dump-functions
  280.                               \ dump-variables
  281.                               \ dump-macros
  282.                               \ emacs-editing-mode
  283.                               \ vi-editing-mode
  284.                               \
  285.                               \ vi-eof-maybe
  286.                               \ vi-movement-mode
  287.                               \ vi-undo
  288.                               \ vi-match
  289.                               \ vi-tilde-expand
  290.                               \ vi-complete
  291.                               \ vi-char-search
  292.                               \ vi-redo
  293.                               \ vi-search
  294.                               \ vi-arg-digit
  295.                               \ vi-append-eol
  296.                               \ vi-prev-word
  297.                               \ vi-change-to
  298.                               \ vi-delete-to
  299.                               \ vi-end-word
  300.                               \ vi-char-search
  301.                               \ vi-fetch-history
  302.                               \ vi-insert-beg
  303.                               \ vi-search-again
  304.                               \ vi-put
  305.                               \ vi-replace
  306.                               \ vi-subst
  307.                               \ vi-char-search
  308.                               \ vi-next-word
  309.                               \ vi-yank-to
  310.                               \ vi-first-print
  311.                               \ vi-yank-arg
  312.                               \ vi-goto-mark
  313.                               \ vi-append-mode
  314.                               \ vi-prev-word
  315.                               \ vi-change-to
  316.                               \ vi-delete-to
  317.                               \ vi-end-word
  318.                               \ vi-char-search
  319.                               \ vi-insert-mode
  320.                               \ vi-set-mark
  321.                               \ vi-search-again
  322.                               \ vi-put
  323.                               \ vi-change-char
  324.                               \ vi-subst
  325.                               \ vi-char-search
  326.                               \ vi-undo
  327.                               \ vi-next-word
  328.                               \ vi-delete
  329.                               \ vi-yank-to
  330.                               \ vi-column
  331.                               \ vi-change-case
  332.  
  333. if exists("readline_has_bash")
  334.   syn keyword readlineFunction  contained
  335.                               \ shell-expand-line
  336.                               \ history-expand-line
  337.                               \ magic-space
  338.                               \ alias-expand-line
  339.                               \ history-and-alias-expand-line
  340.                               \ insert-last-argument
  341.                               \ operate-and-get-next
  342.                               \ forward-backward-delete-char
  343.                               \ delete-char-or-list
  344.                               \ complete-filename
  345.                               \ possible-filename-completions
  346.                               \ complete-username
  347.                               \ possible-username-completions
  348.                               \ complete-variable
  349.                               \ possible-variable-completions
  350.                               \ complete-hostname
  351.                               \ possible-hostname-completions
  352.                               \ complete-command
  353.                               \ possible-command-completions
  354.                               \ dynamic-complete-history
  355.                               \ complete-into-braces
  356.                               \ glob-expand-word
  357.                               \ glob-list-expansions
  358.                               \ display-shell-version
  359.                               \ glob-complete-word
  360.                               \ edit-and-execute-command
  361. endif
  362.  
  363. hi def link readlineKey           readlineKeySeq
  364. hi def link readlineComment       Comment
  365. hi def link readlineTodo          Todo
  366. hi def link readlineConditional   Conditional
  367. hi def link readlineTest          Type
  368. hi def link readlineDelimiter     Delimiter
  369. hi def link readlineTestModeEq    readlineEq
  370. hi def link readlineTestTermEq    readlineEq
  371. hi def link readlineTestTerm      readlineString
  372. hi def link readlineTestAppEq     readlineEq
  373. hi def link readlineTestApp       readlineString
  374. hi def link readlineInclude       Include
  375. hi def link readlinePath          String
  376. hi def link readlineKeyName       SpecialChar
  377. hi def link readlineKeySeparator  readlineKeySeq
  378. hi def link readlineKeyTerminator readlineDelimiter
  379. hi def link readlineKeySeq        String
  380. hi def link readlineKeyEscape     SpecialChar
  381. hi def link readlineKeyword       Keyword
  382. hi def link readlineVariable      Identifier
  383. hi def link readlineBellStyle     Constant
  384. hi def link readlineBoolean       Boolean
  385. hi def link readlineString        String
  386. hi def link readlineStringDelimiter readlineString
  387. hi def link readlineNumber        Number
  388. hi def link readlineEditingMode   Constant
  389. hi def link readlineKeymap        Constant
  390. hi def link readlineFunction      Function
  391.  
  392. let b:current_syntax = 'readline'
  393.  
  394. let &cpo = s:cpo_save
  395. unlet s:cpo_save
  396.