Add wiki.vim file opening scheme for pdf, html

Can open file-links that the cursor is currently over (in markdown link
format). PDF is opened in zathura, html in qutebrowser, the rest in vim.
This commit is contained in:
Marty Oehme 2020-02-04 20:40:03 +01:00
parent 804ae4005a
commit c541763617

View file

@ -39,3 +39,16 @@ endfunction
let g:wiki_link_target_map = "PrependDatestamp" let g:wiki_link_target_map = "PrependDatestamp"
let g:wiki_list_todos = ['[ ]', '[x]'] let g:wiki_list_todos = ['[ ]', '[x]']
" set file opening schemes
function! WikiFileOpen(...) abort dict
if self.path =~# '.pdf$'
silent execute '!zathura' fnameescape(self.path) '&'
return 1
elseif self.path =~# '.html$'
silent execute '!qutebrowser' fnameescape(self.path) '&'
return 1
endif
return 0
endfunction
let g:wiki_file_open = 'WikiFileOpen'