startify.vim 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. " vim: et sw=2 sts=2
  2. " Plugin: https://github.com/mhinz/vim-startify
  3. " Description: A fancy start screen for Vim.
  4. " Maintainer: Marco Hinz <http://github.com/mhinz>
  5. if exists("b:current_syntax")
  6. finish
  7. endif
  8. let s:sep = startify#get_separator()
  9. syntax sync fromstart
  10. syntax match StartifyBracket /.*\%9c/ contains=
  11. \ StartifyNumber,
  12. \ StartifySelect,
  13. syntax match StartifySpecial /\V<empty buffer>\|<quit>/
  14. syntax match StartifyNumber /^\s*\[\zs[^BSVT]\{-}\ze\]/
  15. syntax match StartifySelect /^\s*\[\zs[BSVT]\{-}\ze\]/
  16. syntax match StartifyVar /\$[^\/]\+/
  17. syntax match StartifyFile /.*/ contains=
  18. \ StartifyBracket,
  19. \ StartifyPath,
  20. \ StartifySpecial,
  21. execute 'syntax match StartifySlash /\'. s:sep .'/'
  22. execute 'syntax match StartifyPath /\%9c.*\'. s:sep .'/ contains=StartifySlash,StartifyVar'
  23. if exists('g:startify_custom_header')
  24. execute 'syntax region StartifyHeader start=/\%1l/ end=/\%'. (len(g:startify_custom_header) + 2) .'l/'
  25. endif
  26. if exists('g:startify_custom_footer')
  27. execute 'syntax region StartifyFooter start=/\%'. startify#get_lastline() .'l/ end=/*/'
  28. endif
  29. if exists('b:startify_section_header_lines')
  30. for line in b:startify_section_header_lines
  31. execute 'syntax region StartifySection start=/\%'. line .'l/ end=/$/'
  32. endfor
  33. endif
  34. highlight default link StartifyBracket Delimiter
  35. highlight default link StartifyFile Identifier
  36. highlight default link StartifyFooter Title
  37. highlight default link StartifyHeader Title
  38. highlight default link StartifyNumber Number
  39. highlight default link StartifyPath Directory
  40. highlight default link StartifySection Statement
  41. highlight default link StartifySelect Title
  42. highlight default link StartifySlash Delimiter
  43. highlight default link StartifySpecial Comment
  44. highlight default link StartifyVar StartifyPath
  45. let b:current_syntax = 'startify'