Closed Konfekt closed 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.
For example, I find
autocmd BufWinEnter * if !&modifiable | nnoremap <buffer> x :x<cr> | endif
convenient.
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.
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.
Perfect.
By the way, autocmd FileType qf nnoremap <buffer> r :set modifiable<cr>
suggests itself.
I take that back. Now editing by r
afterwards is impossible.
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.