startify.vim 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. let s:padding_left = repeat(' ', get(g:, 'startify_padding_left', 3))
  10. syntax sync fromstart
  11. execute 'syntax match StartifyBracket /.*\%'. (len(s:padding_left) + 6) .'c/ contains=
  12. \ StartifyNumber,
  13. \ StartifySelect'
  14. syntax match StartifySpecial /\V<empty buffer>\|<quit>/
  15. syntax match StartifyNumber /^\s*\[\zs[^BSVT]\{-}\ze\]/
  16. syntax match StartifySelect /^\s*\[\zs[BSVT]\{-}\ze\]/
  17. syntax match StartifyVar /\$[^\/]\+/
  18. syntax match StartifyFile /.*/ contains=
  19. \ StartifyBracket,
  20. \ StartifyPath,
  21. \ StartifySpecial,
  22. execute 'syntax match StartifySlash /\'. s:sep .'/'
  23. execute 'syntax match StartifyPath /\%'. (len(s:padding_left) + 6) .'c.*\'. s:sep .'/ contains=StartifySlash,StartifyVar'
  24. execute 'syntax region StartifyHeader start=/\%1l/ end=/\%'. (len(g:startify_header) + 2) .'l/'
  25. if exists('g:startify_custom_footer')
  26. execute 'syntax region StartifyFooter start=/\%'. startify#get_lastline() .'l/ end=/\_.*/'
  27. endif
  28. if exists('b:startify.section_header_lines')
  29. for line in b:startify.section_header_lines
  30. execute 'syntax region StartifySection start=/\%'. line .'l/ end=/$/'
  31. endfor
  32. endif
  33. highlight default link StartifyBracket Delimiter
  34. highlight default link StartifyFile Identifier
  35. highlight default link StartifyFooter Title
  36. highlight default link StartifyHeader Title
  37. highlight default link StartifyNumber Number
  38. highlight default link StartifyPath Directory
  39. highlight default link StartifySection Statement
  40. highlight default link StartifySelect Title
  41. highlight default link StartifySlash Delimiter
  42. highlight default link StartifySpecial Comment
  43. highlight default link StartifyVar StartifyPath
  44. let b:current_syntax = 'startify'