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