Closed fomichev closed 12 years ago
The s:normcmd()
is there to do exactly that, preventing the new buffer being opened in windows created by plugins. These windows are often small or very small (NERDTree, Gundo, MiniBufExpl ...) and user obviously doesn't want them to be replaced by mistake.
But it looks like netrw is an exception, so I think I'll add an option to force :e
for some plugins.
Just added an option for this. You can use this to add some exceptions to s:normcmd()
:
let g:ctrlp_dont_split = ['Netrw']
Let me know how that works for you.
Nope, it doesn't work. The problem here is that netrw buffer is not named 'Netrw'; its name is path that's currently shown.
I extended the option to include filetype as well. Let me know how this works:
let g:ctrlp_dont_split = 'netrw'
Yes, now it works! Thank you for such a nice fix and quick response!
Hi,
When I run vim via
vim .
to open it with the current directory listing and then ctrl-p to another file, the new split window is opened instead of using the current one.I explicitly set the following options:
After some digging in the code I found that netrw sets
noma
,nobl
andbf=nofile
. This "breaks"s:normcmd
call in thectrlp#acceptfile
and executesbo vne ...
instead ofbo e ...
.Maybe there is some work around for such an issue? Netrw lets me redefine its buffer settings via
g:netrw_bufsettings
but honestly I don't want to see its buffers in the 'ls' and make them modifiable.I'd appreciate your help, thanks!