I got the wonderful bookmarks.vim plugin to my vim. I especially like the named bookmarks and using the QuickFix window to list them.
In the code to show the bookmark list I'd like to add something that causes the QuickFix window to close after I select a choice. How do I do that?
" Open all bookmarks in the quickfix window
command! CopenBookmarks call s:CopenBookmarks()
function! s:CopenBookmarks()
let choices = []
for [name, place] in items(g:BOOKMARKS)
let [filename, cursor] = place
call add(choices, {
\ 'text': name,
\ 'filename': filename,
\ 'lnum': cursor[1],
\ 'col': cursor[2]
\ })
endfor
call setqflist(choices)
copen
endfunction
<A-down>
and<A-up>
mapped for moving between upper and lower windows andF3
maps to quit, so<A-down>F3
is just as few/many keystrokes as the given solution. – Tyree