It’s pretty common that I’m in a quickfix, nerdtree, or other special window and hit Ctrl-O, thinking I’m in my main window. What I’m trying to do is go back to my previous location in my main window. I tend to also make this mistake by opening up by bufexplorer in my quickfix window, and that causes some really strange problems.
Is there an easy way to ignore certain commands in certain kinds of buffers?
You can always map certain things to
<NOP>(no operation),for example in netrw (:e .)
Applicability of this will, of course, depend on a case in question. Combined with Filetype and
<buffer>in autocommands this may give good results.