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
8 votes
2 answers
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?
  • 193
7 votes
3 answers
8k 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 ...
0 votes
1 answer
134 views

Open One File-type per Tab

In vim you can open all files in present directory with vim *. All of a specific file type in directory with vim *.py. Recursively we use vim **/* and vim **/*.py. To open all files in tabs vim -p *...
1 vote
0 answers
61 views

How can I get my tabs to spread to the width of my window?

I can't see a number of the tabs at the top, even though there's space to show them all. How can I fix this?
  • 143
1 vote
1 answer
520 views

:hi TabLine ctermfg=Whatever not working on Windows

I'm on windows, using vim 8.0. When I do :hi TabLine ctermfg=Red ctermbg=Black The background of the unselected tabs changes, but not the foreground. It stays Cyan. It works properly for TabLineSel ...
  • 176
1 vote
1 answer
432 views

How can I keep the Tab title text fixed, during movement through separate split panes/panels?

Generally, I only use split panes inside of a Tab when using plugins like NerdTree, TagBar, and Codi, or when opening up helptags with :help. When I enter one of these panes, the Tab title text ...
  • 1,287
1 vote
1 answer
159 views

Can I display a list of the tabs in a side-pane?

can I display a list of the tabs in a side pane, so you can switch by selecting from it? Something similar to NERDTree's pane. I want to be able to toggle it into view, select the tab I want in ...
  • 847
2 votes
1 answer
92 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 ...
  • 847
1 vote
0 answers
44 views

Vim - relative tab navigation [duplicate]

Is there a way to make gt work in the opposite way of gT when given a count? 2gT moves two tabs to the left. 2gt moves to the second tab, but I would like to instead move two tabs to the right. How ...
  • 195
1 vote
1 answer
57 views

How do I select the other files in a tab?

When I run the tabs command the file mix.exs in the same tab as NERDTree, (i.e. tab 2), but I can't access it, as it seems to be in the background or hidden in some way. How can I bring mix.exs to the ...
  • 847
0 votes
1 answer
295 views

What are viewport, layout and workspace in relation to tabs

I'm making tentative steps into using tabs in Vim. It seems a bit ridiculous, I've been using tabs in everything for the last 18 years: Visual Studio Every browser since Opera came up with them ...
  • 493
7 votes
1 answer
663 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. ...
0 votes
1 answer
1k views

Print full filename in tabs when using terminal Vim

I use Vim 8.0 (homebrew) from iTerm 3. How do I use full filenames instead of these abominations that Vim seems to print by default? Some context as filenames: sidebar.php sponsors.php donate....
  • 103
9 votes
2 answers
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 ...
4 votes
1 answer
193 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 ...
  • 279
5 votes
2 answers
2k 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 ...
12 votes
2 answers
2k 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 ...
  • 1,745
3 votes
1 answer
305 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.
  • 1,095
5 votes
1 answer
101 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 ...
1 vote
2 answers
164 views

Is it possible to increase the number of visible tabs in MacVim (without changing the window width)?

The question is more or less in the title, until recently I have the feeling that I got a fairly large number of visible tabs in any window of MacVim. I either updated MacVim or my system or something ...
4 votes
1 answer
857 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 ...
  • 1,092
5 votes
1 answer
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 ...
  • 151
5 votes
1 answer
900 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 ...
  • 313
5 votes
3 answers
806 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 ...
  • 253
8 votes
2 answers
9k 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 ...
  • 183
11 votes
3 answers
8k 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 ...
  • 243
17 votes
1 answer
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
  • 2,411
6 votes
2 answers
5k 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 ...
  • 17.1k
5 votes
3 answers
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 ...
  • 153
-2 votes
1 answer
112 views

How to open a list of files into tabs with Tab-top-bar?

I want to open the list of visual selection's files on new tabs such that the top-tab-bar is visible Mapping based on the answer here about How do I loop over a list of files from a visual selection? ...
1 vote
1 answer
932 views

Mapping doesn't work for tabs

I have several files opened in tabs in Vim. I want to switch between tabs, so I use Ctrl+left to move left (previous) and for next also. But my mapping doesn't work. :map <C-Left> :tabprevious&...
  • 3,182
3 votes
2 answers
306 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,182
0 votes
0 answers
95 views

How can I tell NERDTree to open a file in the current window, even if its open somewhere else? [duplicate]

If I have file foo.txt open in a tab tab1 +------------+------------+ | | | | | | | file: | file: | | foo.txt | bar.txt | | | ...
6 votes
1 answer
6k 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 ...
  • 411
9 votes
3 answers
5k 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 |...
3 votes
1 answer
255 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, ...
10 votes
1 answer
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 ...
  • 4,255
2 votes
1 answer
1k views

Why is ZQ not exiting vim?

:q! and ZQ both fail. I had a file opened; I made a new tab with :tabnew (just for some register swapping); I switched back to my main file and wrote my changes to a new filename; I tried ZQ to no ...
  • 4,255
3 votes
2 answers
513 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 '...
  • 205
2 votes
2 answers
432 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.
  • 205
4 votes
0 answers
2k 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-...
15 votes
7 answers
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 ...
  • 47.8k
6 votes
2 answers
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 ...
  • 253
18 votes
1 answer
3k 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 ...
  • 283
2 votes
1 answer
127 views

Open multiple files in new tabs as read only

I would like to open new tabs for each file matching an expression, each file in a new tab and as read only. I do not want to replace my current buffer, just append the new tabs. This comes very ...
  • 131
3 votes
1 answer
435 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() ...
  • 15.5k
0 votes
1 answer
74 views

Moving a visual range to a new tabpage?

I would like to make a new tab page from part of the current text. I would use visual selection, or other means to specify a text range. Is there a single command like "New tab from selection"? ...
26 votes
7 answers
6k 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 ...
87 votes
3 answers
27k 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 ...
33 votes
1 answer
10k 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 ...
  • 1,131