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 / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / runtime / syntax / readline.vim < prev    next >
Encoding:
Text File  |  2003-04-25  |  7.5 KB  |  153 lines

  1. " Vim syntax file
  2. " Language:        readline configuration file
  3. " Maintainer:        Nikolai 'pcp' Weibull <da.box@home.se>
  4. " URL:            http://www.pcppopper.org/
  5. " Latest Revision:  2002-12-06
  6. " Variables:
  7. "   readline_has_bash - if defined add support for bash specific
  8. "            settings/functions
  9.  
  10. if version < 600
  11.     syntax clear
  12. elseif exists("b:current_syntax")
  13.     finish
  14. endif
  15.  
  16. " Set iskeyword since we need `-' (and potentially others) in keywords.
  17. " For version 5.x: Set it globally
  18. " For version 6.x: Set it locally
  19. if version >= 600
  20.     command -nargs=1 SetIsk setlocal iskeyword=<args>
  21. else
  22.     command -nargs=1 SetIsk set iskeyword=<args>
  23. endif
  24. SetIsk 48-57,65-90,97-122,-
  25. delcommand SetIsk
  26.  
  27. " comments
  28. syn region  readlineComment    display oneline matchgroup=readlineComment start="^\s*#" end="$" contains=readlineTodo
  29.  
  30. " todo
  31. syn keyword readlineTodo    contained TODO FIXME
  32.  
  33. " strings (argh...not the way i want it, but fine..."
  34. syn match   readlineString    "^\s*[A-Za-z-]\+:"me=e-1 contains=readlineKeys
  35. syn region  readlineString    display oneline start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=readlineKeysTwo
  36.  
  37. " special key
  38. syn case ignore
  39. syn keyword readlineKeys    contained Control Meta Del Esc Escape LFD Newline Ret Return Rubout Space Spc Tab
  40. syn case match
  41.  
  42. syn match   readlineKeysTwo    contained +\\\([CM]-\|[e\\"'abdfnrtv]\|\o\{3}\|x\x\{3}\)+
  43.  
  44. " keymaps
  45. syn match   readlineKeymaps    contained "emacs\(-standard\|-meta\|-ctlx\)\="
  46. syn match   readlineKeymaps    contained "vi\(-move\|-command\|-insert\)\="
  47.  
  48. " bell styles
  49. syn keyword readlineBellStyles    contained audible visible none
  50.  
  51. " numbers
  52. syn match   readlineNumber    contained "\<\d\+\>"
  53.  
  54. " booleans
  55. syn case ignore
  56. syn keyword readlineBoolean    contained on off
  57. syn case match
  58.  
  59. " conditionals
  60. syn keyword readlineIfOps    contained mode term
  61.  
  62. syn region  readlineConditional display oneline transparent matchgroup=readlineConditional start="^\s*$if" end="$" contains=readlineIfOps,readlineKeymaps
  63. syn match   readlineConditional    "^\s*$\(else\|endif\)\>"
  64.  
  65. " include
  66. syn match   readlineInclude    "^\s*$include\>"
  67.  
  68. " settings
  69.  
  70. syn region  readlineSet        display oneline transparent matchgroup=readlineKeyword start="^\s*set\>" end="$"me=e-1 contains=readlineNumber,readlineBoolean,readlineKeymaps,readlineBellStyles,readlineSettings
  71.  
  72. syn keyword readlineSettings    contained bell-style comment-begin completion-ignore-case
  73. syn keyword readlineSettings    contained completion-query-items convert-meta disable-completion editing-mode enable-keypad
  74. syn keyword readlineSettings    contained expand-tilde horizontal-scroll-mode mark-directories keymap mark-modified-lines meta-flag
  75. syn keyword readlineSettings    contained input-meta output-meta print-completions-horizontally show-all-if-ambiguous visible-stats
  76. syn keyword readlineSettings    contained prefer-visible-bell blink-matching-paren
  77. syn keyword readlineSettings    contained match-hidden-files history-preserve-point isearch-terminators
  78.  
  79. " bash extensions
  80. if exists("readline_has_bash")
  81.     "syn keyword readlineSettings    contained
  82. endif
  83.  
  84. " key bindings
  85. syn region  readlineBinding    display oneline transparent matchgroup=readlineKeyword start=":" end="$" contains=readlineKeys,readlineFunctions
  86.  
  87. syn match   readlineFunctions    contained "\<\(beginning\|end\)-of-line\>"
  88. syn match   readlineFunctions    contained "\<\(backward\|forward\)-\(char\|word\)\>"
  89. syn match   readlineFunctions    contained "\<\(previous\|next\|\(beginning\|end\)-of\|\(non-incremental-\)\=\(reverse\|forward\)-search\)-history\>"
  90. syn match   readlineFunctions    contained "\<history-search-\(forward\|backward\)\>"
  91. syn match   readlineFunctions    contained "\<yank-\(nth\|last\)-arg\>"
  92. syn match   readlineFunctions    contained "\<\(backward-\)\=kill-\(\(whole-\)\=line\|word\)\>"
  93. syn match   readlineFunctions    contained "\<\(start\|end\|call-last\)-kbd-macro\>"
  94. syn match   readlineFunctions    contained "\<dump-\(functions\|variables\|macros\)\>"
  95. syn match   readlineFunctions    contained "\<non-incremental-\(reverse\|forward\)-search-history-again\>"
  96. syn keyword readlineFunctions    contained clear-screen redraw-current-line accept-line delete-char backward-delete-char quoted-insert tab-insert
  97. syn keyword readlineFunctions    contained self-insert transpose-chars transpose-words downcase-word capitalize-word unix-word-rubout
  98. syn keyword readlineFunctions    contained delete-horizontal-space kill-region copy-region-as-kill copy-backward-word copy-forward-word yank yank-pop
  99. syn keyword readlineFunctions    contained digit-argument universal-argument complete possible-completions insert-completions menu-complete
  100. syn keyword readlineFunctions    contained re-read-init-file abort do-uppercase-version prefix-meta undo revert-line tilde-expand set-mark
  101. syn keyword readlineFunctions    contained exchange-point-and-mark character-search character-search-backward insert-comment emacs-editing-mode vi-editing-mode
  102. syn keyword readlineFunctions    contained unix-line-discard upcase-word backward-delete-word vi-eof-maybe vi-movement-mode vi-match vi-tilde-expand
  103. syn keyword readlineFunctions    contained vi-complete vi-char-search vi-redo vi-search vi-arg-digit vi-append-eol vi-prev-word vi-change-to vi-delete-to
  104. syn keyword readlineFunctions    contained vi-end-word vi-fetch-history vi-insert-beg vi-search-again vi-put vi-replace vi-subst vi-yank-to vi-first-print
  105. syn keyword readlineFunctions    contained vi-yank-arg vi-goto-mark vi-append-mode vi-insertion-mode prev-history vi-set-mark vi-search-again vi-put vi-change-char
  106. syn keyword readlineFunctions    contained vi-subst vi-delete vi-yank-to vi-column vi-change-case vi-overstrike vi-overstrike-delete
  107. syn keyword readlineFunctions    contained do-lowercase-version delete-char-or-list tty-status arrow-key-prefix
  108. syn keyword readlineFunctions    contained vi-back-to-indent vi-bword vi-bWord vi-eword vi-eWord vi-fword vi-fWord vi-next-word
  109.  
  110. " bash extensions
  111. if exists("readline_has_bash")
  112.     syn keyword readlineFunctions    contained shell-expand-line history-expand-line magic-space alias-expand-line history-and-alias-expand-line insert-last-argument
  113.     syn keyword readlineFunctions    contained operate-and-get-next forward-backward-delete-char delete-char-or-list complete-filename possible-filename-completions
  114.     syn keyword readlineFunctions    contained complete-username possible-username-completions complete-variable possible-variable-completions complete-hostname
  115.     syn keyword readlineFunctions    contained possible-hostname-completions complete-command possible-command-completions dynamic-complete-history complete-into-braces
  116.     syn keyword readlineFunctions    contained glob-expand-word glob-list-expansions display-shell-version
  117.     syn keyword readlineFunctions    contained glob-complete-word edit-and-execute-command
  118. endif
  119.  
  120. " Define the default highlighting.
  121. " For version 5.7 and earlier: only when not done already
  122. " For version 5.8 and later: only when an item doesn't have highlighting yet
  123. if version >= 508 || !exists("did_readline_syn_inits")
  124.     if version < 508
  125.     let did_readline_syn_inits = 1
  126.     command -nargs=+ HiLink hi link <args>
  127.     else
  128.     command -nargs=+ HiLink hi def link <args>
  129.     endif
  130.  
  131.     HiLink readlineComment    Comment
  132.     HiLink readlineTodo        Todo
  133.     HiLink readlineString    String
  134.     HiLink readlineKeys        SpecialChar
  135.     HiLink readlineKeysTwo    SpecialChar
  136.     HiLink readlineKeymaps    Constant
  137.     HiLink readlineBellStyles    Constant
  138.     HiLink readlineNumber    Number
  139.     HiLink readlineBoolean    Boolean
  140.     HiLink readlineIfOps    Type
  141.     HiLink readlineConditional    Conditional
  142.     HiLink readlineInclude    Include
  143.     HiLink readlineKeyword    Keyword
  144.     HiLink readlineSettings    Type
  145.     HiLink readlineFunctions    Type
  146.     delcommand HiLink
  147. endif
  148.  
  149. let b:current_syntax = "readline"
  150.  
  151. " vim: set sw=4 sts=4:
  152.  
  153.