vimr
vimr copied to clipboard
Open files in buffers rather than tabs
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!
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

+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!
Hi, I just started using vimR. Seems like it might be just what I want, once I get inevitable configuration issues worked out. Not vimr's fault. So thank you. I wanted to put in a few more remarks on this issue.
In my case, I don't ever want files to open in separate tabs. Given that vim, nvim, and MacVim GUI don't do this by default, it would be nice if there were an obvious way to turn the behavior off (or even if it defaulted to off). --nvim
does work, that's a solution, but it was difficult to find it in this issue. (I'm not sure what I am missing if "--cur-env, --line, --dry-run and --wait" aren't passed to nvim. But I don't know what those do--I don't use them--so I guess it doesn't matter.)
Would it be possible to add a section to the documentation page about how to configure tabs on/off?
A related issue: It's OK to have one tab left, but for me it's kind of a wasted line of space. Turning off "Use custom tab implementation" gets rid of it, but causes the vim status bar to be misplaced until I resize the window with the mouse.
(By the way, I'm happy that vimr opens a new gui window each time it's run from the command line.)
Thanks!
If you're looking to open a new buffer (versus a new tab) from inside a neovim terminal:
- Install https://github.com/mhinz/neovim-remote.
- Add the following to your
.bashrc
:
# Open new files in current neovim instance, if available.
if [ -n "$NVIM_LISTEN_ADDRESS" ]; then
alias vimr='nvr'
fi
Then vimr
will open files in a new buffer inside of the current vimr instance.
Has anyone gotten this to work?
-
vimr --nvim foo.txt
opens files in a new window, not in the same tab of the current window -
autocmd VimEnter * silent! tabonly
doesn't seem to change the behavior at all
This worked for me:
autocmd TabEnter * silent! tabclose