51 lines
1.1 KiB
VimL
51 lines
1.1 KiB
VimL
setlocal cursorline
|
|
setlocal nospell
|
|
setlocal nolist
|
|
set nobuflisted
|
|
|
|
" Close with q
|
|
nnoremap <silent><buffer> q :<C-u>close<CR>
|
|
|
|
nnoremap <silent><buffer> dd :call qf#delitem()<Cr>
|
|
nnoremap <buffer><silent> <C-j> :<C-u>call <SID>older()<CR>
|
|
nnoremap <buffer><silent> <C-k> :<C-u>call <SID>newer()<CR>
|
|
|
|
function! s:is_quickfix() abort
|
|
return getwininfo(win_getid())[0].quickfix
|
|
endfunction
|
|
|
|
if !exists('*s:older')
|
|
function! s:older() abort
|
|
try
|
|
if s:is_quickfix()
|
|
colder
|
|
else
|
|
lolder
|
|
endif
|
|
catch
|
|
echohl ErrorMsg
|
|
echo substitute(v:exception, 'Vim(.*):', '', '')
|
|
echohl None
|
|
endtry
|
|
endfunction
|
|
endif
|
|
|
|
if !exists('*s:newer')
|
|
function! s:newer() abort
|
|
try
|
|
if s:is_quickfix()
|
|
cnewer
|
|
else
|
|
lnewer
|
|
endif
|
|
catch
|
|
echohl ErrorMsg
|
|
echo substitute(v:exception, 'Vim(.*):', '', '')
|
|
echohl None
|
|
endtry
|
|
endfunction
|
|
endif
|
|
|
|
" Quit QuickFix window along with source file window
|
|
autocmd WinEnter * if winnr('$') == 1 && getbufvar(winbufnr(winnr()), "&buftype") == "quickfix" | q | endif
|