cleaned
This commit is contained in:
53
after/ftplugin/qf.vim
Normal file
53
after/ftplugin/qf.vim
Normal file
@@ -0,0 +1,53 @@
|
||||
" Run this plugin only if the denote package has been setup
|
||||
if !exists('g:denote_directory')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Load only once per buffer
|
||||
if exists('b:loaded_denote_ftplugin_qf')
|
||||
finish
|
||||
endif
|
||||
let b:loaded_denote_ftplugin_qf = 1
|
||||
|
||||
" This will be called for every location and quickfix, when data is loaded into
|
||||
" the list. This does nothing for such lists that are note 'denote' lists.
|
||||
|
||||
let b:context = getloclist(0, {'context': 1})['context']
|
||||
if type(b:context) != v:t_dict || !has_key(b:context, 'denote')
|
||||
" Clear settings
|
||||
set spell<
|
||||
nmapclear <buffer>
|
||||
finish
|
||||
endif
|
||||
|
||||
setlocal nospell
|
||||
nnoremap <buffer> q :lclose<CR>
|
||||
|
||||
" Reload capability
|
||||
if has_key(b:context, 'gfun')
|
||||
function DenoteLocListReload()
|
||||
let curl = line('.')
|
||||
let Gfun = b:context['gfun']
|
||||
call denote#loclist#jumptowindow()
|
||||
exe 'lclose'
|
||||
call Gfun()
|
||||
exe 'lwindow'
|
||||
exe curl
|
||||
endfunction
|
||||
nnoremap <buffer> <silent> r :call DenoteLocListReload()<CR>
|
||||
endif
|
||||
|
||||
" Denote-list specific configuration
|
||||
if b:context['denote'] == 'list'
|
||||
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
|
||||
command! -range -buffer -bang DenoteDelete :call denote#notes#rm(<line1>, <line2>, <bang>0) | :normal r
|
||||
nnoremap <buffer> C :DenoteSetTitle
|
||||
nnoremap <buffer> + :DenoteTagAdd
|
||||
nnoremap <buffer> - :DenoteTagRm
|
||||
nnoremap <buffer> dd :DenoteDelete<CR>r
|
||||
xnoremap <buffer> + :DenoteTagAdd
|
||||
xnoremap <buffer> - :DenoteTagRm
|
||||
xnoremap <buffer> d :DenoteDelete<CR>
|
||||
endif
|
||||
Reference in New Issue
Block a user