sponsor Vim development Vim logo Vim Book Ad

quickfix-reflector.vim : Change code right in the quickfix window

 script karma  Rating 13/4, Downloaded by 510  Comments, bugs, improvements  Vim wiki

created by
Stefan Dotterweich
script type

In the quickfix window, simply edit any entry you like. Once you save the quickfix buffer, your changes will be made in the actual file an entry points to.

You can also delete lines in the quickfix window. This way, you can first review the quickfix list, remove all entries you don't care to change, and then use `%s/foo/bar` (or anything else) on the rest.


* Works in location list windows, too
* The quickfix buffer is now `modifiable`
* The usual write commands can be used (`:w`, `:x` etc.), but they won't save the buffer to a file. Instead they will trigger replacement for any changes you made.
* If you specifically want to save the quickfix buffer to a file, you can still do that the same way as before `:write my_qf_list`
* Adding and removing lines in the quickfix buffer breaks each line's link to Vim's internal quickfix entry. After making such changes, you need to write the quickfix buffer. This will rewrite Vim's internal quickfix list. Otherwise, pressing `<Enter>` may jump to the wrong entry.

Limits to text replacement

Whenever a replacement fails, you get an '[ERROR]' in the corresponding quickfix entry.

Replacement only works if the text that was modified actually exists in the corresponding text file and line number. So it may fail if the file was modified since the quickfix list was built.

If the quickfix entry contains only part of a line, replacement should work as long as there is a substring of that line with at least three characters.

Example: The quickfix entry `Missing ; at: xyz` can be used to replace in a line `a = xyz`. However, it cannot be used in a line `xyz = 1+xyz` because it is not clear which xyz would need to be replaced


install details
Copy the contents of the plugin and doc directories into the corresponding directories of your Vim runtime.
Alternatively, use Vundle, Pathogen etc. to make the installation easier.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
quickfix-reflector.zip 0.1 2014-03-16 7.4 Stefan Dotterweich Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.