@@ -4,6 +4,7 @@ import autoload "../../lib/funcs.vim"
44import autoload " ../../lib/preview.vim"
55import autoload " ../../lib/links.vim"
66import autoload ' ../../lib/utils.vim'
7+ import autoload ' ../../lib/highlight.vim'
78import autoload ' ../../lib/constants.vim'
89
910
@@ -61,8 +62,8 @@ if use_pandoc && executable('pandoc')
6162
6263 compiler pandoc
6364
65+ # TODO : make it to take additional arguments
6466 def Make (format: string = ' html' )
65- #
6667
6768 var output_file = $ ' {expand(' % :p :r ' )}.{format}'
6869 var cmd = execute ($ ' make {format}' )
@@ -178,6 +179,15 @@ if empty(maparg('<Plug>MarkdownCode'))
178179 \ TEXT_STYLES_DICT, TEXT_STYLES_DICT)<cr> g@
179180endif
180181
182+ if empty (maparg (' <Plug>MarkdownAddHighlight' ))
183+ noremap <script> <buffer> <Plug> MarkdownAddHighlight
184+ \ <esc><ScriptCmd> highlight.AddProp()<cr>
185+ endif
186+
187+ if empty (maparg (' <Plug>MarkdownClearHighlight' ))
188+ noremap <script> <buffer> <Plug> MarkdownClearHighlight
189+ \ <esc><ScriptCmd> highlight.ClearProp()<cr>
190+ endif
181191# ----------- TODO :TO BE REVIEWED ----------------------
182192
183193def SetCodeBlock (open_block: dict <string> ,
@@ -255,4 +265,12 @@ if use_default_mappings
255265 if ! hasmapto (' <Plug>MarkdownReferencePreview' )
256266 nnoremap <buffer> <silent> K <Plug> MarkdownReferencePreview
257267 endif
268+
269+ # ---------- Highlight --------------------------
270+ if ! hasmapto (' <Plug>MarkdownAddHighlight' )
271+ xnoremap <leader> ha <Plug> MarkdownAddHighlight
272+ endif
273+ if ! hasmapto (' <Plug>MarkdownClearHighlight' )
274+ xnoremap <leader> hd <Plug> MarkdownClearHighlight
275+ endif
258276endif
0 commit comments