tutor.vim 1003 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. " vim: fdm=marker
  2. " Base: {{{1
  3. call tutor#SetupVim()
  4. " Buffer Settings: {{{1
  5. setlocal noreadonly
  6. if !exists('g:tutor_debug') || g:tutor_debug == 0
  7. setlocal buftype=nofile
  8. setlocal concealcursor+=inv
  9. setlocal conceallevel=2
  10. else
  11. setlocal buftype=
  12. setlocal concealcursor&
  13. setlocal conceallevel=0
  14. endif
  15. setlocal noundofile
  16. setlocal keywordprg=:help
  17. setlocal iskeyword=@,-,_
  18. " The user will have to enable the folds himself, but we provide the foldexpr
  19. " function.
  20. setlocal foldmethod=manual
  21. setlocal foldexpr=tutor#TutorFolds()
  22. setlocal foldlevel=4
  23. " Load metadata if it exists: {{{1
  24. if filereadable(expand('%').'.json')
  25. call tutor#LoadMetadata()
  26. endif
  27. " Mappings: {{{1
  28. call tutor#SetNormalMappings()
  29. " Checks: {{{1
  30. sign define tutorok text=✓ texthl=tutorOK
  31. sign define tutorbad text=✗ texthl=tutorX
  32. if !exists('g:tutor_debug') || g:tutor_debug == 0
  33. call tutor#ApplyMarks()
  34. autocmd! TextChanged,TextChangedI <buffer> call tutor#ApplyMarksOnChanged()
  35. endif