@@ -42,6 +42,8 @@ setlocal comments=sr:(*\ ,mb:\ ,ex:*)
42
42
setlocal comments ^= sr :(** ,mb: \ \ ,ex :* )
43
43
setlocal commentstring = (*% s * )
44
44
45
+ let b: undo_ftplugin = " setlocal com< cms<"
46
+
45
47
" Add mappings, unless the user didn't want this.
46
48
if ! exists (" no_plugin_maps" ) && ! exists (" no_ocaml_maps" )
47
49
" (un)commenting
@@ -50,6 +52,11 @@ if !exists("no_plugin_maps") && !exists("no_ocaml_maps")
50
52
xmap <buffer> <LocalLeader> c <Plug> BUncomOn
51
53
nmap <buffer> <LocalLeader> C <Plug> LUncomOff
52
54
xmap <buffer> <LocalLeader> C <Plug> BUncomOff
55
+ let b: undo_ftplugin .=
56
+ \ " | silent! execute 'nunmap <buffer> <LocalLeader>c'" .
57
+ \ " | silent! execute 'xunmap <buffer> <LocalLeader>c'" .
58
+ \ " | silent! execute 'nunmap <buffer> <LocalLeader>C'" .
59
+ \ " | silent! execute 'xunmap <buffer> <LocalLeader>C'"
53
60
endif
54
61
55
62
nnoremap <buffer> <Plug> LUncomOn gI(* <End> *)<ESC>
@@ -62,17 +69,27 @@ if !exists("no_plugin_maps") && !exists("no_ocaml_maps")
62
69
63
70
nmap <buffer> <LocalLeader> t <Plug> OCamlPrintType
64
71
xmap <buffer> <LocalLeader> t <Plug> OCamlPrintType
72
+
73
+ let b: undo_ftplugin .=
74
+ \ " | silent! execute 'nunmap <buffer> <LocalLeader>s'" .
75
+ \ " | silent! execute 'nunmap <buffer> <LocalLeader>S'" .
76
+ \ " | silent! execute 'nunmap <buffer> <LocalLeader>t'" .
77
+ \ " | silent! execute 'xunmap <buffer> <LocalLeader>t'"
65
78
endif
66
79
67
- " Let % jump between structure elements (due to Issac Trotts)
68
- let b: mw = ' \<let\>:\<and\>:\(\<in\>\|;;\)'
69
- let b: mw = b: mw . ' ,\<if\>:\<then\>:\<else\>'
70
- let b: mw = b: mw . ' ,\<\(for\|while\)\>:\<do\>:\<done\>'
71
- let b: mw = b: mw . ' ,\<\(object\|sig\|struct\|begin\)\>:\<end\>'
72
- let b: mw = b: mw . ' ,\<\(match\|try\)\>:\<with\>'
73
- let b: match_words = b: mw
80
+ if exists (" loaded_matchit" ) && ! exists (" b:match_words" )
81
+ " Let % jump between structure elements (due to Issac Trotts)
82
+ let b: mw = ' \<let\>:\<and\>:\(\<in\>\|;;\)'
83
+ let b: mw = b: mw . ' ,\<if\>:\<then\>:\<else\>'
84
+ let b: mw = b: mw . ' ,\<\(for\|while\)\>:\<do\>:\<done\>'
85
+ let b: mw = b: mw . ' ,\<\(object\|sig\|struct\|begin\)\>:\<end\>'
86
+ let b: mw = b: mw . ' ,\<\(match\|try\)\>:\<with\>'
87
+ let b: match_words = b: mw
88
+
89
+ let b: match_ignorecase= 0
74
90
75
- let b: match_ignorecase= 0
91
+ let b: undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words"
92
+ endif
76
93
77
94
function ! s: OcpGrep (bang ,args ) abort
78
95
let grepprg = &l: grepprg
@@ -150,12 +167,9 @@ endif
150
167
if exists (" g:ocaml_folding" )
151
168
setlocal foldmethod = expr
152
169
setlocal foldexpr = OMLetFoldLevel (v: lnum )
170
+ let b: undo_ftplugin .= " | setlocal fdm< fde<"
153
171
endif
154
172
155
- let b: undo_ftplugin = " setlocal efm< foldmethod< foldexpr<"
156
- \ . " | unlet! b:mw b:match_words b:match_ignorecase"
157
-
158
-
159
173
" - Only definitions below, executed once -------------------------------------
160
174
161
175
if exists (" *OMLetFoldLevel" )
0 commit comments