added key o for other files
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user