Vimr: Open files in buffers rather than tabs

Created on 3 Sep 2017  ·  9Comments  ·  Source: qvacua/vimr

I use ap/vim-buftabline and have Tab and ShiftTab mapped to :bn and :bp, so I don't really ever have a use for tabs. It would be great if there was an option to have

vimr a b c
vimr 1 2 3

open the 6 files in buffers rather than tabs, so I can Tab my way through them. I understand from vimr -h that By default all files are open in tabs, and I'd be happy for an option somewhere that disables that. If there's already an option somewhere I missed then sorry in advance!

Most helpful comment

@qvacua ah I see, so that half-works.

It opens the files in buffers not tabs, but when you open more tabs it opens another instance of vimr, rather than adding to the existing one.

Is there an option to preserve the "add to existing vimr window" default, but also have buffers as well?

vimr --nvim a b c
vimr --nvim d e f

image

All 9 comments

What you probably can do is the following (please correct me if I'm wrong):

$ vimr --nvim SOME_OPTIONS

where SOME_OPTIONS would contain all arguments you would use to achieve what you want using nvim in terminal. So if

$ nvim --some --option file1 file2 file3

would do what you want in terminal, you can use

$ vimr --nvim --some --option file1 file2 file3

Would this help?

@qvacua I _think_ (I'm not a super-vim-expert :grin: ) that I won't be able to do that, the problem is that I want to do the default, which would be:

nvim a b c

but vimr automatically converts that to:

nvim -p a b c

which makes everything open in new tabs rather than buffers. I'm not aware of a command to counteract that setting (which from vimr -h I guess is set in vimr's source code).

If you want to do nvim a b c, then try

$ vimr --nvim a b c

(make sure you have the newest version of the command line tool vimr 😀)

@qvacua ah I see, so that half-works.

It opens the files in buffers not tabs, but when you open more tabs it opens another instance of vimr, rather than adding to the existing one.

Is there an option to preserve the "add to existing vimr window" default, but also have buffers as well?

vimr --nvim a b c
vimr --nvim d e f

image

+1 for this. I just got bitten by it today. It seems better to use the nvim defaults, but I would be OK with a command-line option as well.

As a workaround, autocmd VimEnter * silent! tabonly can be used to prevent vim from being started with tabs.

@ptzz that option works for me in neovim, but not in Vimr. Not sure why (or if I'm doing something wrong).

+1
This is currently the last remaining thing preventing me to move entirely over to VimR for my OSX NeoVim needs.

+1 This would be awesome!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

numbcoder picture numbcoder  ·  3Comments

risentveber picture risentveber  ·  4Comments

crisidev picture crisidev  ·  7Comments

mikl picture mikl  ·  3Comments

laur1s picture laur1s  ·  5Comments