Questions tagged [tabbed-user-interface]

A tab page holds one or more windows. Questions about how to use and customize the behavior of Vim tabs.

Filter by
Sorted by
Tagged with
72
votes
3answers
24k views

Open filename under cursor like gf, but in a new tab (or split)?

The normal mode command gf go to a file with the path the cursor currently is at. But it does so in the current window, replacing the current text. That means you need to navigate back explicitly ...
31
votes
1answer
9k views

How do you open a new buffer in the current window?

I've got a few tabs open with different window setups. I'd like to open a new blank buffer in the current window, without having any more splits/windows or tabs Is there any way to do this? I know ...
22
votes
7answers
5k views

Move existing window to existing tab

Sometimes I need to move windows into an already existing tab, and I was wondering if there was a command/keyboard shortcut that could do this. I know I can close the window, switch to the tab, and ...
18
votes
1answer
2k views

How do I reorder open tabs?

Let's say I have four open files: file0.txt, file1.txt, file2.txt, and file3.txt. I open all of them in that order as tabs. So my tab ordering is this: file0.txt file1.txt file2.txt file3.txt Then ...
17
votes
5answers
3k views

How can I open multiple tabs at once?

If I use: :tabedit file1 file2 I get: E172: Only one file name allowed Is there any way to use :tabedit with multiple file names? Or another way to open multiple tabs at once?
15
votes
7answers
3k views

How to bind a set of buffers to a tab?

When I need to work on different projects at the same time I have the folowing workflow: I create one tab for each project. In each tab I open the files that I want to edit, which makes several ...
15
votes
1answer
1k views

What is the difference between a tab, viewport, window, split and buffer?

What is the difference between the following in vim: buffer window viewport split tab
13
votes
3answers
2k views

How do I make opening new tabs the default?

When I open vim with multiple files (vim f1 f2 ...), how can I make it open them in tabs directly, without using -p? I'm looking to separate out shell behaviour from vim behaviour, removing vim-based ...
11
votes
3answers
6k views

Reopen the most recently closed buffer

When writing to a file, I often accidentally type :wq instead of :w since the two keys are right next to each other. But since I almost always have more than one buffer open, Vim stays up and whatever ...
11
votes
2answers
1k views

Duplicate buffer into new tab instead of moving it

I frequently want to temporarily maximize a buffer in a tab page and then go back to the old buffer configuration that I was looking at. My current workflow for doing something like this is either to ...
10
votes
1answer
6k views

How do I open a file to view in a new tab?

How do I open a file to view in a new tab? Specifically, I want the read-only equivalent of :tabe[dit] <filename>. I have tried :tab :view <filename> but that does not create a new tab ...
10
votes
1answer
1k views

Buffers vs tabs vs arglist vs windows

So many choices! So confusing! When should one be used in preference to another? How do these relate to each other? What are the differences between them, anyway? How do they affect commands you ...
8
votes
3answers
4k views

How can I open a buffer in a new tab leaving the current window and buffer intact?

Often when coding I have this window layout - which is mapped to the flow of the program I am editing. Tab1 +------------+--------------+ | | | | | B |...
8
votes
2answers
2k views

Is it possible to open a tab in a window and not a window in a tab?

The question in short: Is it possible to open a tab in a window and not a window in a tab?. Like this: Instead of this: Some background related to the question: I'm used to the interface like the ...
8
votes
2answers
6k views

Mouse click navigation in vim tab

Now I navigate from one tab to another tab in Vim using the gt command, but it's little frustrating for me, because so far I've worked with editors that support mouse navigation. Is there a way that ...
7
votes
3answers
7k views

Open multiple files in tabs from Explore mode

While navigating file system in :Explore mode, is it possible to select and open multiple files, each in a new tab? Edit: I ended up using a function proposed by Jair López, because it works pretty ...
7
votes
2answers
1k views

Limit buffer list to current tab

Is there a way to list the buffers specific to the tab that is open currently in vim or macvim?
7
votes
1answer
572 views

Is there a way to move n tabs forward?

I'm familiar with ngT, which will move n tabs backward. Is there an equivalent way to move forward? I know that if I have 5 tabs open and I'm on tab 3, I can use 3gT to move backwards to tab 5. ...
6
votes
1answer
5k views

how to close tab and remove this file from buffers

I often use :tab sball to open all buffers as tabs, but sometimes after doing so I would like to close the tab and remove file from buffers at the same time. How can I achieve that? I know already ...
6
votes
2answers
2k views

Duplicate tab with windows

I have opened several files in vim (particularly, in vimdiff). They are opened in multiple (vertically split) windows. Is there a simple way, in which I can duplicate all this to another tab? I ...
6
votes
1answer
122 views

How can I make sure all buffers end up as tab or force remaining buffers into tabs?

I am using Vim 7.3 for no particularly compelling reason on an old system I am forced to work on. It's an internal system and it will eventually be replaced by a more modern version of the same distro....
6
votes
3answers
3k views

Prevent NERDTree from switching tabs when opening a file node?

In NERDTree, if I select a file node and hit o, it opens the file in a window in the current tab. However, if that particular file is already open in another tab, NERDTree switches to that tab. I find ...
5
votes
3answers
2k views

What can I do with more tabs than fit in one (airline) tab-line?

I use airline to manage my status-line and tab-line. This worked great until I started to code for an MVC project that has way too many modules and files going on. I now have tabs coming out my ears. ...
5
votes
1answer
856 views

Spread already open files into split view

Suppose I open multiple files in vim like this: vim a.cc b.cc x.cc vim will open all files, but show only one at a time, the rest being accessible using the :next command. After having these files ...
5
votes
3answers
3k views

How do I open a shell in only one tab in Vim?

I usually work on tabs in Vim, and on many occasions, I end up requiring a shell to do run some command, etc. (Escape -> :!sh). Is there any way I can open the shell in only one tab in Vim? I would ...
5
votes
2answers
4k views

Can I move my current tab to a split in a different tab?

This happens to me semi-frequently. I have two tabs open, and I would like to merge them into one tab with a vertical split. Essentially, I want to do the opposite of CTRL-w_T. Right now, I have to ...
5
votes
1answer
97 views

Empty first tab lost when using sessions

I'm creating a session with mksession, and when I restore the session, if the first tab was empty ([No Name]), it's gone in the restored session. Other empty tabs are restored fine; it seems to only ...
5
votes
1answer
248 views

Different autocmd behavior when using --remote-tab-silent?

This question is a follow-up to Switching to the local directory after loading a file? I have the following in my .vimrc: autocmd BufReadPost *.tex lchdir %:p:h with the intent of setting the ...
4
votes
1answer
785 views

Navigate to tag in a new tab if not already opened, like `tab drop`?

What I expect from "tab-tag" navigation is the following behaviour: when need to jump to a tag: if the corresponding file is already opened in a window, navigate to it if it is not, open the buffer ...
4
votes
1answer
1k views

Retitling tab labels

Context: I tend to use tabs to contain splits of files that are grouped around some purpose (e.g. in a typical MVC framework, I'll have the model/view/controller files for a given part of the app open ...
4
votes
1answer
171 views

How can I make Neovim return to the tab that was active before running `:Git diff`?

How can I make Neovim automatically return to the tabpage that was active before running :Git diff %? Before I commit my work in git, I often run :Git diff to review changes (the :Git command is ...
4
votes
1answer
1k views

How to change color of tabs in the tab-bar in gvim?

Here is what my tab-bar in GVim looks like: I'm having a hard time to identify which of the tabs is the active one. How can I configure the color of the tab-bar, for example I'd like to use a ...
4
votes
3answers
543 views

Focus previous tab/window when closing current

I tend to open multiple tabs in vim and multiple windows within a tab. I have a habit of traversing the code in a tree format - I open a tag in a new tab, so that my current view of the window ...
4
votes
1answer
1k views

How do you set the name of a tab page?

I have a couple of tabs open. Is it possible to set custom tab page names for each individual tab page? For example, I want to name one tab "database", another "backend", and another "frontend". I ...
3
votes
2answers
478 views

How does one put currently open files into tabs?

When I open a large number of files in vim with tabs only the first tabpagemax files are in tabs and any more than that are available by doing :n. After I close several of the open tabs how do I '...
3
votes
2answers
267 views

Open a filename given by an external command

Tabnew works when the filename is given directly. I want to open a file using Its alias since the file is far away from the current file path and difficult to remember or type. I use alias command ...
3
votes
1answer
266 views

How to not close MacVim after the last tab is closed?

Can this be done by editing the .vimrc file? What I need is that after closing all tabs, a new tab is there like notepad++ does.
3
votes
1answer
237 views

How can I drag a file onto MacVim and make it open in a split, not a new tab?

I have MacVim 7.1 (patch level 903). When I drag a file onto it from the Finder, desktop, etc., it opens in a new tab. However, I would prefer that it open in a split. According to :help drag-n-drop, ...
3
votes
1answer
2k views

Open new file as tab on current vim instance through double-click

I currently open my text files with GVim by double-clicking them in my file manager (Thunar, in Xubuntu 16.04). However, when opening a new file, I want GVim to open it as a new tab rather than a new ...
3
votes
1answer
106 views

How do I run gVim in a single instance per desktop workspace on linux?

I like running gVim in a single instance, i.e. a single gui window with separate tabs for each file I'm editing. I also run a linux desktop environment that has multiple desktop workspaces. E.g. ...
3
votes
1answer
412 views

Plugin nnoremap insert <CR> instead of executing command

I am writing a vim plugin that at one point define a buffer only mapping : function! s:DoStuff() tabnew " ... nnoremap <buffer> q :tabclose<CR> endfunction call s:DoStuff() ...
3
votes
0answers
75 views

:tabonly does not close all unmodified tabs if there is a modified tab in the way

Create some test files, touch a b c d and open each in a tab, vim -p a b c d Modify file b. Go to tab c and issue :tabonly. Expected behavior: a and d tabs are closed. b is not closed because it is ...
3
votes
0answers
90 views

How to keep lcd from affecting other windows?

I usually have one tab containing the code I am working on, and another containing vimwiki. I mostly use neovim. For the code I prefer the working directory sticking to the project root. For vimwiki ...
3
votes
2answers
105 views

How to close all tabs with windows and terminals so I can quit

I have multiple tab pages. Some tab pages only have open files, some only have :terminals open, and some have a mix of files and terminals. At the end of the day, I want to quit Vim. Normally, I go ...
3
votes
0answers
1k views

How can I undo last command in command line?

In general, is there a way to UNDO the last "meta" command (I mean a command entered in command line to manage a window ), or some equivalent keystroke sequence ? Btw, I know the u (= undo) and CTRL-...
2
votes
2answers
351 views

How do I open multiple files from find each in a separate tab in vim?

I would like to find multiple files and open them all in tabs within the same vim instance.
2
votes
2answers
665 views

How to create a new tab or window from a buffer?

I have several open buffers and want to open a buffer in :ls in a new tab or window. I have found a way to do accomplish this, either by first executing tabnew or C-w v and then selecting the buffer ...
2
votes
1answer
170 views

What is the X that appears on the top right corner when multiple tabs are open?

What is that X on the corner? What is it for and what does it do? I opened Vim with vim -p tab1 tab2 on Windows 10 and in WLS with Ubuntu and they both have it.
2
votes
2answers
122 views

How do I make the h key go to prev tab if at start of file?

And, to get back again: how do I make the l key go to next tab, if at end of file? I'd also like to make hh go to previous buffer, and ll go to next buffer. I know that'll add a delay to recognising ...
2
votes
1answer
88 views

Rather than tabnext and tabprevious can I get a list of tabs and select the one to switch to?

Instead of using tabnext and tabprevious is there a command or a plugin which can list your tabs vertically so you can navigate up and down and choose the one to switch to? I am thing along the lines ...