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