diff --git a/after/ftplugin/qf.vim b/after/ftplugin/qf.vim index 7de28f0..6425349 100644 --- a/after/ftplugin/qf.vim +++ b/after/ftplugin/qf.vim @@ -39,6 +39,12 @@ endif " Denote-list specific configuration if b:context['denote'] == 'list' + function OpenDenoteEntry() + let l:item = getloclist(0, {'items': 1})['items'][line('.')-1] + let l:bufnr = l:item['bufnr'] + let l:filename = bufname(l:bufnr) + call system('open ' .. shellescape(l:filename)) + endfunction command! -nargs=1 -range -buffer DenoteSetTitle :call denote#notes#settitle(, ) | :normal r command! -nargs=1 -range -buffer -complete=custom,denote#completion#tags DenoteTagAdd :call denote#notes#tagmod(, , , v:true) | :normal r command! -nargs=1 -range -buffer -complete=custom,denote#completion#tags DenoteTagRm :call denote#notes#tagmod(, , , v:false) | :normal r @@ -47,19 +53,8 @@ if b:context['denote'] == 'list' nnoremap + :DenoteTagAdd nnoremap - :DenoteTagRm nnoremap dd :DenoteDeleter + nnoremap o :call OpenDenoteEntry() xnoremap + :DenoteTagAdd xnoremap - :DenoteTagRm xnoremap d :DenoteDelete - " Open non-notes using the 'open' command - function OpenDenoteEntry() - let l:item = getloclist(0, {'items': 1})['items'][line('.')-1] - let l:bufnr = l:item['bufnr'] - let l:filename = bufname(l:bufnr) - if index(g:denote_note_file_extensions, fnamemodify(l:filename, ':e')) == -1 - call system('open ' .. shellescape(l:filename)) - else - exe 'edit ' .. fnameescape(l:filename) - endif - endfunction - nnoremap :call OpenDenoteEntry() endif diff --git a/doc/denote.txt b/doc/denote.txt index 74ffede..8b71f0c 100644 --- a/doc/denote.txt +++ b/doc/denote.txt @@ -1,6 +1,6 @@ *denote.txt* Handling denote entries – the vim way - Last change: 2026 Mar 3 + Last change: 2026 Mar 4 This is the documentation for the denote package. This package also introduces the |libdenote| plugin in the file autoload/libdenote.vim, which may be of @@ -257,6 +257,9 @@ C Change the title of the selected entry. dd Delete the selected entry. {Visual}d Delete the visually selected entries. + *denote-list-o* +o Open the file using the system "open" command. + ============================================================================== APPENDIX A - THE LIBDENOTE PLUGIN *libdenote*