ranger.vim icon indicating copy to clipboard operation
ranger.vim copied to clipboard

"Overwrites" previous buffer when closing ranger without opening a file

Open lkmill opened this issue 7 years ago • 12 comments

If you quit ranger without opening a file, jumping to the previous buffer (:b#<CR>) does not wor; it errors with:

E86: Buffer XX does not exist

I assume ranger creates a buffer, which is wiped on close. Do you have any idea how to fix this?

lkmill avatar May 04 '17 22:05 lkmill

Yes it is exactly what happens... but I have no idea how to find a workaround. I use fzf to move between the buffers and I didn't see this issue.

francoiscabrol avatar May 10 '17 19:05 francoiscabrol

Well i use fzf to move between buffers too! But i do use the previouis buffer command as well, just saying that :b# breaks after exiting ranger without opening a file.

lkmill avatar May 11 '17 15:05 lkmill

Sorry, I can reproduce it but I don't see any workaround... It is a weird vim behaviour since if the buffer does not exists anymore, it should go to the previous existing one. I can reproduce it only with Bclose and Neovim.

  • Open a terminal in nvim with :te
  • Then close it with :Bclose!
  • Then try :b#

francoiscabrol avatar Jun 05 '17 23:06 francoiscabrol

@lohfu

I use fzf to move between the buffers 😮 how?

mauroporras avatar Sep 23 '17 21:09 mauroporras

@mauroporrasp press Ctrl + B!

you need fzf set up... install fzf in your OS and add fzf vim to vim

EDIT: hmmm i realised Ctrl + B is not default keybinding in fzf... furthermore Ctrl + B is used by vim so you would be overriding a default keybinding.

lkmill avatar Sep 23 '17 22:09 lkmill

@lohfu Any particular advantage over https://github.com/ctrlpvim/ctrlp.vim ?

mauroporras avatar Sep 23 '17 23:09 mauroporras

@mauroporrasp

it's A LOT faster

lkmill avatar Sep 25 '17 06:09 lkmill

I am experiencing the same problem, but in my case it only happens when I call Ranger from the first buffer. Otherwise, when I hit q I'm back to the original buffer.

alienbogart avatar May 25 '18 22:05 alienbogart

I find this plugin is better for me https://github.com/rafaqz/ranger.vim

mauroporras avatar May 25 '18 23:05 mauroporras

That last comment can be taken with a grain of salt. It offers some functionality this one doesn't but it has the exact same problem with the alternate buffer, when using neovim, that is. When using regular Vim neither plugin has the problem, regarding this issue there is no difference. The extra functionality it offers is in my opinion pretty useless, for the simple reason that as far as a quick look tells me, this is the sort of stuff for which one could better use vim-dirvish. Seeing who wrote that, you are going to have a hard time finding a better implementation. Also, a fix for for the alternate file is on the horizon...

enthudave avatar Jun 14 '18 16:06 enthudave

better for me

mauroporras avatar Jun 15 '18 17:06 mauroporras

yeah yeah, but when you make that comment you are clearly encouraging others to use that one. I believe they shouldn't for the reasons I've stated, and if not for those reasons, consider this: instead if starting his own version he could have just contributed to this one, I guess he never saw Brian Lunduke talk about "Why Linux Sucks" (Check Youtube)

enthudave avatar Jun 15 '18 17:06 enthudave