added key o for other files

This commit is contained in:
2026-03-04 11:38:04 +01:00
parent e1c3ea09da
commit 270be048dc
2 changed files with 11 additions and 13 deletions

View File

@@ -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(<line1>, <q-args>) | :normal r
command! -nargs=1 -range -buffer -complete=custom,denote#completion#tags DenoteTagAdd :call denote#notes#tagmod(<line1>, <line2>, <q-args>, v:true) | :normal r
command! -nargs=1 -range -buffer -complete=custom,denote#completion#tags DenoteTagRm :call denote#notes#tagmod(<line1>, <line2>, <q-args>, v:false) | :normal r
@@ -47,19 +53,8 @@ if b:context['denote'] == 'list'
nnoremap <buffer> + :DenoteTagAdd
nnoremap <buffer> - :DenoteTagRm
nnoremap <buffer> dd :DenoteDelete<CR>r
nnoremap <buffer> o :call OpenDenoteEntry()<CR>
xnoremap <buffer> + :DenoteTagAdd
xnoremap <buffer> - :DenoteTagRm
xnoremap <buffer> d :DenoteDelete<CR>
" 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 <buffer> <Enter> :call OpenDenoteEntry()<CR>
endif