diff --git a/nvim/.config/nvim/plugin/wiki.vim b/nvim/.config/nvim/plugin/wiki.vim index 25854cf..1c63525 100644 --- a/nvim/.config/nvim/plugin/wiki.vim +++ b/nvim/.config/nvim/plugin/wiki.vim @@ -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'