Last active
July 16, 2021 20:17
-
-
Save slarwise/d0b7248b8f6837a4ecc254206a8ac2b2 to your computer and use it in GitHub Desktop.
Vim quickfix options, mappings and commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Open the quickfix window in a horizontal split at the bottom | |
" The height is the number of quickfix items (if it fits) | |
command! Copen execute "cclose | botright copen " . len(getqflist()) | |
" Open the quickfix window in a vertical split to the left | |
command! Vcopen execute "cclose | copen | wincmd H" | |
" Add the cfilter plugin to enable the :Cfilter command | |
" This command lets you filter the quickfix list | |
packadd cfilter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Make the quickfix window behave like a regular window when resizing | |
" E.g. <C-W>= will resize the quickfix window to the same size as the other windows | |
setlocal nowinfixheight | |
setlocal nowinfixwidth | |
" Open the quickfix item under the cursor but stay in the quickfix window | |
" zt adjusts the window so that the line is at the top | |
nnoremap <buffer> p <CR>zt<C-w>p | |
" Open the quickfix item below but stay in the quickfix window | |
nnoremap <buffer> <C-j> j<CR>zt<C-w>p | |
" Open the quickfix item above but stay in the quickfix window | |
nnoremap <buffer> <C-k> k<CR>zt<C-w>p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Typical workflow: