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 / mac / vim55rt.sit / runtime / syntax / zsh.vim < prev   
Encoding:
Text File  |  1999-09-25  |  4.6 KB  |  104 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:    Z shell (zsh)
  3. " Maintainer:    Felix von Leitner <leitner@math.fu-berlin.de>
  4. " Heavily based on sh.vim by Lennart Schultz
  5. " Last change:    1999 Jun 14
  6.  
  7. " Remove any old syntax stuff hanging around
  8. syn clear
  9.  
  10. syn region    zshSinglequote    start=+'+ skip=+\\'+ end=+'+
  11. " A bunch of useful zsh keywords
  12. " syn keyword    zshFunction    function
  13. syn keyword    zshStatement    bg break cd chdir continue echo eval exec
  14. syn keyword    zshStatement    exit export fg getopts hash jobs kill
  15. syn keyword    zshStatement    pwd read readonly return set zshift function
  16. syn keyword    zshStatement    stop suspend test times trap type ulimit
  17. syn keyword    zshStatement    umask unset wait setopt compctl source
  18. syn keyword    zshStatement    whence disown shift which unhash unalias
  19. syn keyword    zshStatement    alias functions unfunction getln disable
  20. syn keyword    zshStatement    vared getopt enable unsetopt autoload
  21. syn keyword    zshStatement    bindkey pushln command limit unlimit fc
  22. syn keyword    zshStatement    print builtin noglob sched r time
  23. syn keyword    zshStatement    typeset declare local integer
  24.  
  25. syn keyword    zshConditional    if else esac case then elif fi in
  26. syn keyword    zshRepeat    while for do done
  27.  
  28. " Following is worth to notice: command substitution, file redirection and functions (so these features turns red)
  29. syn match    zshFunctionName    "\h\w*\s*()"
  30. syn region    zshCommandSub    start=+`+ skip=+\\`+ end=+`+
  31. " contains=ALLBUT,zshFunction
  32. syn match    zshRedir    "\d\=\(<\|<<\|>\|>>\)\(|\|&\d\)\="
  33.  
  34. syn keyword    zshTodo contained TODO
  35.  
  36. syn keyword    zshShellVariables    USER LOGNAME HOME PATH CDPATH SHELL
  37. syn keyword    zshShellVariables    LC_TYPE LC_MESSAGE MAIL MAILCHECK
  38. syn keyword    zshShellVariables    PS1 PS2 IFS EGID EUID ERRNO GID UID
  39. syn keyword    zshShellVariables    HOST LINENO MACHTYPE OLDPWD OPTARG
  40. syn keyword    zshShellVariables    OPTIND OSTYPE PPID PWD RANDOM SECONDS
  41. syn keyword    zshShellVariables    SHLVL TTY signals TTYIDLE USERNAME
  42. syn keyword    zshShellVariables    VENDOR ZSH_NAME ZSH_VERSION ARGV0
  43. syn keyword    zshShellVariables    BAUD COLUMNS cdpath DIRSTACKSIZE
  44. syn keyword    zshShellVariables    FCEDIT fignore fpath histchars HISTCHARS
  45. syn keyword    zshShellVariables    HISTFILE HISTSIZE KEYTIMEOUT LANG
  46. syn keyword    zshShellVariables    LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES
  47. syn keyword    zshShellVariables    LC_TIME LINES LISTMAX LOGCHECK mailpath
  48. syn keyword    zshShellVariables    MAILPATH MANPATH manpath module_path
  49. syn keyword    zshShellVariables    MODULE_PATH NULLCMD path POSTEDIT
  50. syn keyword    zshShellVariables    PS3 PS4 PROMPT PROMPT2 PROMPT3 PROMPT4
  51. syn keyword    zshShellVariables    psvar PSVAR prompt READNULLCMD
  52. syn keyword    zshShellVariables    REPORTTIME RPROMPT RPS1 SAVEHIST
  53. syn keyword    zshShellVariables    SPROMPT STTY TIMEFMT TMOUT TMPPREFIX
  54. syn keyword    zshShellVariables    watch WATCH WATCHFMT WORDCHARS ZDOTDIR
  55. syn match    zshSpecialShellVar    "\$[-#@*$?!0-9]"
  56. syn keyword    zshSetVariables        ignoreeof noclobber
  57. syn region    zshDerefOpr    start="\${" end="}" contains=zshShellVariables
  58. syn match    zshDerefIdentifier    "\$[a-zA-Z_][a-zA-Z0-9_]*\>"
  59. syn match    zshOperator        "[][}{&;|)(]"
  60.  
  61. " String and Character contstants
  62. " Highlight special characters (those which have a backslash) differently
  63. syn match   zshSpecial    contained "\\\d\d\d\|\\[abcfnrtv\\]"
  64.  
  65.  
  66. syn match  zshNumber        "-\=\<\d\+\>"
  67. syn match  zshComment    "#.*$" contains=zshNumber,zshTodo
  68.  
  69.  
  70. syn match zshTestOpr    "-\<[oeaznlg][tfqet]\=\>\|!\==\|-\<[b-gkLprsStuwjxOG]\>"
  71. "syn region zshTest           start="\[" skip="\\$" end="\]" contains=zshString,zshTestOpr,zshDerefIdentifier,zshDerefOpr
  72. syn region  zshString    start=+"+  skip=+\\"+  end=+"+  contains=zshSpecial,zshOperator,zshDerefIdentifier,zshDerefOpr,zshSpecialShellVar,zshSinglequote,zshCommandSub
  73.  
  74. if !exists("did_zsh_syntax_inits")
  75.   let did_zsh_syntax_inits = 1
  76.   " The default methods for highlighting.  Can be overridden later
  77.   hi link zshSinglequote        zshString
  78.   hi link zshConditional        zshStatement
  79.   hi link zshRepeat        zshStatement
  80.   hi link zshFunctionName    zshFunction
  81.   hi link zshCommandSub        zshOperator
  82.   hi link zshRedir        zshOperator
  83.   hi link zshSetVariables    zshShellVariables
  84.   hi link zshSpecialShellVar    zshShellVariables
  85.   hi link zshTestOpr        zshOperator
  86.   hi link zshDerefOpr        zshSpecial
  87.   hi link zshDerefIdentifier    zshShellVariables
  88.   hi link zshOperator        Operator
  89.   hi link zshStatement        Statement
  90.   hi link zshNumber        Number
  91.   hi link zshString        String
  92.   hi link zshComment        Comment
  93.   hi link zshSpecial        Special
  94.   hi link zshTodo        Todo
  95.   hi link zshShellVariables    Special
  96. "  hi zshOperator        term=underline ctermfg=6 guifg=Purple gui=bold
  97. "  hi zshShellVariables    term=underline ctermfg=2 guifg=SeaGreen gui=bold
  98. "  hi zshFunction        term=bold ctermbg=1 guifg=Red
  99. endif
  100.  
  101. let b:current_syntax = "zsh"
  102.  
  103. " vim: ts=8
  104.