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:
parent
804ae4005a
commit
c541763617
1 changed files with 13 additions and 0 deletions
|
@ -39,3 +39,16 @@ endfunction
|
|||
let g:wiki_link_target_map = "PrependDatestamp"
|
||||
|
||||
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'
|
||||
|
|
Loading…
Reference in a new issue