Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening files with CtrlP while in Fern Buffer #803

Open
alexandersokolow opened this issue Sep 18, 2021 · 1 comment
Open

Opening files with CtrlP while in Fern Buffer #803

alexandersokolow opened this issue Sep 18, 2021 · 1 comment

Comments

@alexandersokolow
Copy link

Hi,

when opening a file with CtrlP while in Netrw, the file would open in the current buffer.

Now I am using fern (https://github.com/lambdalisue/fern.vim) as my filebrowser & wanted to achieve the same behavior.
However, when I am in a fern buffer and open a file with CtrlP, it opens in a vertical split.

I found a very hacky fix for that. In the main ctrlP file in the ctrlp#normcmd function I've changed the last line from
retu a:0 ? a:1 : 'bo vne'
to
retu a:0 ? a:1 : 'e'

Obviously that suppresses the vertical split, but it probably produces some other problems. Haven't noticed any so far, when in a file with unsaved changes new files still open in a split, no problem there.

I'm pretty sure, that the problem arises because fern is using a custom buffertype / name (or whatever you'd call it). What I mean by that is, that when I am in fern and write :file I get something like "fern://...".

So ...
Will this cause problems?
If yes, is there another, better fix for it?
Ideally it would be something, that I can put into my .vimrc, so that I don't have to change the code everytime I install the plugin on some machine ...

Greetings,
Alexander

@alexandersokolow
Copy link
Author

Yep, causes problems ... but that was predictable lol.
Help would be appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant