20
votes
Make cnext and cprevious loop back to the begining
You can write some commands:
command! Cnext try | cnext | catch | cfirst | catch | endtry
command! Cprev try | cprev | catch | clast | catch | endtry
command! Lnext try | lnext | catch | lfirst | ...
16
votes
Accepted
How to map Enter to custom command EXCEPT in quick fix?
Using an expression mapping is the easiest way to do this:
nnoremap <expr> <CR> &buftype ==# 'quickfix' ? "\<CR>" : 'za'
This defines a mapping that checks whether you are in ...
13
votes
How to auto fix common linting errors reported via syntastic?
As mentioned in the comments be aware of the consequences this modification has to you work environment (know exactly which eslint rules you use to "fix" things).
To answer your question: adding the ...
13
votes
Accepted
How to automatically set wrapping for quickfix window?
Autocommands to the rescue!
Put these lines in your vimrc:
augroup quickfix
autocmd!
autocmd FileType qf setlocal wrap
augroup END
There's also this slightly cleaner method:
create ~/.vim/...
12
votes
Accepted
Open quickfix in vertical split
Prefixing your command with :vert modifies it to use a vertical split:
:vert copen
12
votes
Accepted
Showing colors in vim's quickfix window from Dispatch tasks
If you want your tests to embed colour codes (presumably ANSI) in their output and then have the colours show in the quickfix window, you're out of luck.
However the quickfix buffer is just a buffer, ...
12
votes
Quickfix support for Python tracebacks
Built in compiler plugin pyunit
As already suggested by jamessan, one option is to use the built in compiler plugin pyunit:
:compiler pyunit
:set makeprg=python3\ %
:make
This has the downside, that ...
11
votes
Accepted
autocmd with quickfix window
The parameter for both the WinEnter and BufEnter events are matched against the buffer name, which is empty for the quickfix window:
:echo bufname('')
[no output]
You can still use the buftype ...
10
votes
Accepted
How can I close the quickfix window and go back to the file I was editing
To close the quickfix window, you use :cclose, as @statox mentioned in the comments.
This won't affect which code buffer you're viewing, though. Vim doesn't distinguish between the buffer you were ...
8
votes
Accepted
Quickfix support for Python tracebacks
Vim comes with a set of "compiler" scripts, one of which is called "pyunit". If you run :compiler pyunit and then :make (with your suggested value for 'makeprg'), quickfix is ...
8
votes
Accepted
How to make <enter> open new tabs for the quickfix window when it is opened with "tab copen" including the first time?
This workaround seems to work (mind the capitalized T in the end):
autocmd FileType qf nnoremap <buffer> <Enter> <C-W><Enter><C-W>T
It will create a mapping that is ...
8
votes
Which buffer quickfix file is opened in?
This is a fairly widespread and well-known annoyance. There are at least two plugins which aim to address it: vim-qf and QFEnter
But, the behavior is quite predictable (cf :help quickfix.txt). If ...
8
votes
Accepted
Using global command on Quickfix entries
Update: New official vim plugin cfilter
Since 21.8.2018 (patch: 8.1.0311) the plugin cfilter is distributed with vim in $VIMRUNTIME. It is documented under :h cfilter-plugin.
Load plugin cfilter ...
8
votes
Accepted
Import an error file to the quickfix list without leaving vim
Try :h :cfile or :h :cgetfile
:cf[ile][!] [errorfile] Read the error file and jump to the first error.
This is done automatically when Vim is started with
the -q option. You ...
8
votes
How can i compile cpp using vim
(I've answered this question so many times that I've lost the count, and impossible to find a complete answer in the lot... I'll bookmark this answer this time...)
Everything starts with Vim quickfix ...
7
votes
How to auto fix common linting errors reported via syntastic?
The solution given in Jepz's answer didn't completely work for me. eslint was correctly called with the --fix option. However, maybe it's because of internals that have changed, but it seems like ...
7
votes
How to make <enter> open new tabs for the quickfix window when it is opened with "tab copen" including the first time?
This mapping does what I think you want, put it in ~/.vim/after/ftplugin/qf.vim.
nnoremap <buffer> <CR> :tabnew\|cc <C-r>=line(".")<CR><CR>
7
votes
Accepted
How to load list of files in commit into quickfix
You could use the following function which has the advantage of not changing the state of your local git repo:
function! CommitQF(...)
" Get the commit hash if it was specified
let commit = a:...
7
votes
autocmd with quickfix window
Just remark to Martin Tournoij answer.
When you just open quickfix buffer/window (not switch from another buffer/window) &buftype variable isn't setted yet, so may be useful one more autocmd ...
7
votes
Accepted
how to check whether the location list for the current window is open
how to check whether the location list for the current window is open
You could try to inspect the 'winid' property of the location list. If the location window is open, the value of the property ...
7
votes
Accepted
Skip the quickfix list when buffer switching using :bn
You can adapt either of the answers here to skip the quickfix:
Here's my one:
function! BSkipQuickFix(command)
let start_buffer = bufnr('%')
execute a:command
while &buftype ==# 'quickfix' ...
7
votes
Accepted
How to navigate vim buffers using quickfix list?
VimScript makes a difference between commands and expressions.
Whatever you type in the command-line is a command. Commands can output some text, but they cannot "return" anything, and so ...
6
votes
Keeping quickfix jumps in the jump list
I don't think you took the time to read :help quickfix.
Your :grep results populate the "quickfix list" which is then optionally displayed in the "quickfix window". The whole quickfix mechanism is ...
6
votes
Accepted
uneven quickfix window output from Ack/Ag
Yes, it is annoying.
When Vim creates a quickfix list from the output of a program such as Ack, it creates a buffer for each file in the quickfix list using the name provided by the other program. ...
6
votes
How to save quickfix list per Neovim session using :mksession?
Quickfix lists (shortened to "qflist" from here on) are not saved with
:mksession. Probably because the list is saved in a temporary file
which is scrubbed when exiting the current vim ...
5
votes
How to make <enter> open new tabs for the quickfix window when it is opened with "tab copen" including the first time?
The quickfix/location list is an interesting beast. I'd recommend reading into :help quickfix for some inner workings of these two features (pretty much interchangeable; list commands are prefixed ...
5
votes
Accepted
How do I make list of search results editable?
You definitively should try the plugin QFGrep plugin, which was created after the similar question mentioned in the comments: Is it possible to grep Vimʼs quickfix?.
I've been using it for a year and ...
5
votes
Accepted
Calling vimgrep so that results from the current file are on top?
You can sort the resulting quickfix list to give priority to current buffer, then run uniq() on it. Sadly you need to handle sorting quickfix items almost completely. For example the following will ...
5
votes
How to change the cursor line higlighting only for one window (namely the quickfix one)?
Patch 8.0.0641 introduced a separate highlight group for the quickfix line, called QuickFixLine. With patch 8.0.0653 this group is linked to the Search highlight by default, because for some color ...
5
votes
How to load list of files in commit into quickfix
Plugin Fugitive v3.2 (Jan 2020)
vim-fugitive has added new commands since the OP raised this question which can do exactly what the OP has asked.
Now you can call
:Git difftool
or the abbreviated ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
quickfix × 154makeprg × 17
errorformat × 14
vimrc × 13
vimgrep × 10
vimscript × 9
buffers × 8
autocmd × 7
location-list × 7
neovim × 5
search × 5
functions × 5
key-bindings × 4
make × 4
gvim × 3
replace × 3
tags × 3
error × 3
grep × 3
command-line × 2
substitute × 2
vim-windows × 2
microsoft-windows × 2
highlight × 2
external-command × 2