stefandtw / quickfix-reflector.vim

Change code right in the quickfix window
MIT License
340 stars 19 forks source link

Make qf-window modifiable only on demand #6

Closed Konfekt closed 9 years ago

Konfekt commented 9 years ago

How about an option to leave the qfwindow nonmodifiable by default ? People might use autocmds executed if a buffer is nonmodifiable.

Then a map could make it modifiable to use qf-reflector.

stefandtw commented 9 years ago

Can you give an example of such an autocommand? If you want things triggered on opening a quickfix window you can listen to events on the buffer "quickfix" instead.

Konfekt commented 9 years ago

For example, I find

autocmd BufWinEnter * if !&modifiable | nnoremap <buffer> x :x<cr> | endif

convenient.

Konfekt commented 9 years ago

Of course, after installing your plugin one could work around every such instance.

But perhaps there are other good reasons for the qfwindow being nonmodifiable by default, so perhaps some find it safer only to make it modifiable when they are about to modify it.

stefandtw commented 9 years ago

You can now set

g:qf_modifiable=0

in your vimrc.

To edit the quickfix buffer, type

set modifiable

manually or map it to a key.

Konfekt commented 9 years ago

Perfect.

Konfekt commented 9 years ago

By the way, autocmd FileType qf nnoremap <buffer> r :set modifiable<cr> suggests itself.

Konfekt commented 9 years ago

I take that back. Now editing by r afterwards is impossible.