Skip to main content

Questions tagged [vim-windows]

A Vim window is a view of a buffer. A tab page comprises one or more windows. For questions about interaction with the Microsoft operating system, use [microsoft-windows]. For questions about interaction with the desktop windowing system, use [window-management].

Filter by
Sorted by
Tagged with
77 votes
4 answers
29k views

How to save window, split, and buffer layout?

I have several tasks I am working on in one repository. I would like to create "workspaces" for working on them. One "workspace" or "buffer layout" would have all files I need to work on open in the ...
Nebril's user avatar
  • 3,497
32 votes
3 answers
11k views

What is the order of WinEnter, BufEnter, BufRead, Syntax, FileType events?

I've gone through the autocmd.txt help, but the information about this is scattered and not always present (eg. with BufRead). Could someone who understands this well list the order of these events -...
Sundar R's user avatar
  • 781
244 votes
6 answers
183k views

How do I change the current split's width and height?

I am working on split (using ^w+v, ^w+s) buffers, but sometimes I would like to widen a current split or change its height. How can I achieve that?
Nebril's user avatar
  • 3,497
87 votes
1 answer
38k views

How to open multiple files in split mode?

I know how to split windows in vim, but it's possible to open multiple files using vim in split mode (at startup) from the command line? In example: vim file1 file2 file3 or: vim *.cpp
kenorb's user avatar
  • 18.6k
17 votes
7 answers
4k 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 ...
statox's user avatar
  • 50.1k
7 votes
4 answers
3k views

How to convert all windows into horizontal, vertical or tab splits?

It is possible to convert all windows into different split mode while editing? Instead of one by one? In example (having multiple windows) from horizontal to vertical split and opposite, or from tab ...
kenorb's user avatar
  • 18.6k
40 votes
1 answer
14k views

What are the new "popup windows" in Vim 8.2?

The latest version of Vim, 8.2, has a new feature called "popups" or "popup windows". They sound interesting but I'm not quite sure what they're good for. Can you enlighten me...preferably with some ...
B Layer's user avatar
  • 20k
18 votes
1 answer
2k 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
Tom Hale's user avatar
  • 2,711
18 votes
2 answers
5k views

How to repeat a mapping when keeping key pressed

I have in my .vimrc some simple mappings to resize split windows easily: noremap <Leader><UP> <C-w>+ noremap <Leader><DOWN> <C-w>- That works pretty fine but ...
statox's user avatar
  • 50.1k
130 votes
4 answers
196k views

Is it possible to split Vim window to view multiple files at once?

When working with multiple files, it would be very handy if we can see more than one file in the screen at once. Is there any way in Vim to split the window (horizontally or vertically) so each split ...
thameera's user avatar
  • 17.6k
46 votes
4 answers
30k views

How can I work with splits in Vim without Ctrl-W?

My terminal doesn't allow me to type Ctrl+W, because that's a shortcut for closing a terminal tab. I like working with splits, but I can't find any way to do so without using C-W. This forced me to ...
Mateon1's user avatar
  • 563
28 votes
5 answers
8k views

How can I make Vim open help in a vertical split?

I usually work in a drop-down terminal, running about 25 characters high. Since I prefer tabs to windows1, usually a lot of horizontal space is wasted - around half of the terminal width. On top of ...
muru's user avatar
  • 25k
5 votes
2 answers
831 views

Open multiple files in custom split layout

I want to open three files file1.txt file2.txt file3.txt in vertical and horizontal split combination, like this: +-------------------------------+ | | | | file1.txt | ...
Przemysław Czechowski's user avatar
66 votes
17 answers
27k views

How to "full screen" browse Vim help?

I know I can browse Vim help with :help, but this opens a split. Sometimes, I just like to study documentation. How can I read the Vim documentation in a "full screen" mode?
Ruslan Osipov's user avatar
30 votes
1 answer
7k views

How can I get both splits to scroll left or right at the same time?

I want to open up two different parts of a document in horizontal splits (using :sp) and scroll both of them left and right together. For vertical scrolling, you would use scrollbind. However, I'm not ...
Christopher Bottoms's user avatar
20 votes
2 answers
7k views

How to exit Vim from split mode?

How to efficiently exit Vim when editing multiple files in the split mode at one go? It seems when I'm having e.g. 10 split windows, I've to repeat 10 times :q! command for each window which is a bit ...
kenorb's user avatar
  • 18.6k
11 votes
2 answers
3k views

How to lock a window height / width?

I jot notes in a tiny split window (buffer) regularly: <C-W>s :enew :res 5 ... jot jot... When I create a new horizontal split in the same tab, that little window resizes, as if doing <C-W&...
Nicolai S's user avatar
  • 113
11 votes
2 answers
3k views

Vertical equivalent of "control+w n"?

I often want a new empty vertical pane (vim window / viewport ...) in my current Vim tab. I know I can get a new empty horizontal pane by doing control+w n. I know I can split the current pane into ...
hippietrail's user avatar
7 votes
1 answer
3k views

How to change the location of a new vertical split?

The question is somewhat straightforward. To open a vertical split, I use: :vs. When opening a vertical split, I'd like to initialize it with a file directly. If I do :vs myfile.txt this will move ...
solalito's user avatar
  • 373
7 votes
1 answer
1k views

Hide statusline when more than two windows open without suffering the extra hidden empty line artifact?

I want to hide the statusline, I don't ever use nor care about what is written in it. The problem is vim doesn't offer a way to achieve that in a convenient manner. If I just do set laststatus=0 I ...
vexe's user avatar
  • 281
6 votes
2 answers
174 views

Position command line under current window?

Sometimes I work with a vertically split window and I was thinking it would be cool if when I enter the command line with :, /, etc., the command I type would appear below the current window instead ...
Andy Schweig's user avatar
5 votes
1 answer
430 views

Parsing winlayout() For Toggling Multiple Windows At Once

When working in vim, I like to have a toggle-able terminal window that I can bring with me from tab to tab. This works by tracking a buffer, and opening it in a new bot split (if it isn't visible), or ...
ThoseKind's user avatar
  • 219
4 votes
4 answers
3k views

Execute external command in split window

Is there a way to get the following in Vim: If I execute a command in Vim like !make c, I would like to have a frame/split that pops up like in syntastic instead of switching to terminal view. That ...
baxbear's user avatar
  • 314
2 votes
1 answer
228 views

gvim cmd line offset issue when doing horizontal splits?

Not sure how to explain this but basically I'm using an external plugin/dll to enable fullscreen in gvim (which is very lame since this should be a built-in feature...). The problem in when I open a ...
vexe's user avatar
  • 281
2 votes
1 answer
1k views

shortcut to open definition of variable in a vertical split

I use the vertical split command a lot :vsplit, and I also have click on ctrl] to look at the definition of a variable (after generating the Ctags). I would like to do a keyboard shortcut that does ...
abbood's user avatar
  • 743
1 vote
2 answers
160 views

Split: automatically load corresponding file

I am porting autotools project to CMake. So, every directory of the project has CMakeLists.txt and Makefile.am. I want to make a split: CMakeLists.txt on one side and the corresponding Makefile.am on ...
Velkan's user avatar
  • 215
0 votes
2 answers
259 views

netrw :Sex and :Vex clear the current buffer

If I open a file in Vim and then run :Vex (or :Sex) it opens netrw in both the new split and the existing split. This happens even if I have unsaved changes, meaning the changes are lost. The ...
Hadrian Hughes's user avatar
0 votes
3 answers
90 views

Does a plugin exist which allows moving (across) the windows and split them without having to press Ctrl+w before each action?

I'm kind of fine with moving across windows using Ctrl+w followed by (sometimes a counter and) h, j, k, l, p, t, b, and I'm also fine with the similar key combinations to split the windows or to move ...
Enlico's user avatar
  • 2,224
35 votes
1 answer
11k 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 ...
JonnyRaa's user avatar
  • 1,191
34 votes
3 answers
6k views

How to apply a setting in all open tabs and windows?

Is there an option to apply a setting in all tabs and windows, e.g. apply :set number to all open tabs?
vfclists's user avatar
  • 897
30 votes
2 answers
12k views

How do I open a new buffer without opening it in a split?

I know I can use :new to open a new buffer in a split window (defined by set splitbelow and set splitright). But how can I just open a new, empty buffer without opening it in a split?
hgiesel's user avatar
  • 1,944
28 votes
2 answers
8k views

Make panes resize when host window is resized

I like to use vimdiff as a git diff/merge tool. The problem is when I resize the host terminal window to a new size: of the two split panes, the leftmost remain of the same width, while the rightmost ...
guido's user avatar
  • 1,757
28 votes
3 answers
15k views

Can the split separator in vim be less than a full column wide?

I use a tiling window manager (awesome) + a terminal multiplexer (tmux) + splits inside of vim. I have no window decorations at all, so there is no visual split between them at all if the content of ...
Caleb's user avatar
  • 2,245
28 votes
7 answers
8k 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 ...
EvergreenTree's user avatar
24 votes
2 answers
23k views

How do I change the default size of plugin window (NerdTree, Taglist, etc)?

I'm using the Taglist and NerdTree plugins quite often. Usually the window that opens in the left side is too small and I need to extend it. I usually do: 10 CTRL+w > Is there a way to change the ...
stdcall's user avatar
  • 1,059
24 votes
6 answers
22k views

What is a scratch window?

Sometimes I see a window open with name scratch. I know it is some kind of temporary buffer/window. How can I create one? :h scratch returns nothing.
wizzup's user avatar
  • 343
22 votes
5 answers
39k views

How to switch between buffer and terminal

I have a vim's buffer and a terminal in the same vim's window but each time switch to terminal I can only exit it to go back to vim's buffer, Is there a way to keep terminal session but be able to ...
raring-coffee20's user avatar
20 votes
3 answers
24k views

How to map two commands with only one key

My question comes from this two commands I added on my _vimrc file: nnoremap <C-[> :set columns+=1<CR> nnoremap <C-]> :set lines+=1<CR> As is known, it will resize your gvim (...
Alex's user avatar
  • 1,225
19 votes
4 answers
6k views

Send text from one split window to another

Recently there was an add-on to NeoVim which allows opening terminal in a vim buffer. This has appealing possibilities to send text from one vim window to another replicating, for example, a REPL like ...
Karolis Koncevičius's user avatar
15 votes
3 answers
1k views

How can I get my windows back into a grid formation?

If I have windows arranged into four quadrants, as from the following sequence of commands: :tabnew :vsplit :split <C-W>l :split then entering a command like <C-W>J will cause these to ...
wchargin's user avatar
  • 2,727
8 votes
2 answers
2k views

Open help windows in new buffer instead of split windows

Some time ago I found an interesting trick on Damian Conway's vimrc which allows to open help files in new tabs instead of split windows. The code is the following: "Only apply to .txt files... ...
statox's user avatar
  • 50.1k
7 votes
4 answers
1k views

What workflow to use when editing large multifile projects

Lately I've been shifting more nad more of my work from IntelliJ to vim. With a handful of plugins and setting tweaks, I don't miss the IDE much. One thing I do miss is the ease of navigating a large ...
Jones's user avatar
  • 171
6 votes
1 answer
2k views

What is a better way to use `windo` without changing of window?

In my vimscripts I sometimes have to use the windo command to execute an action on each open split. The problem with this command is that it cycles through all the open splits and ends on a different ...
statox's user avatar
  • 50.1k
5 votes
2 answers
1k views

How to prevent Vim from scrolling buffers when I open split?

When I open a new split Vim is scrolling both buffers up despite having enough space. Here is an asciicast This behaviour comes out-of-the box in vim -u NONE. It is really annoying. My guess it tries ...
firedev's user avatar
  • 2,422
5 votes
1 answer
2k views

How to find what is causing the command line height to be changed after opening / closing a tab?

Sometimes (I can't reproduce it reliably), after opening a tab, the height of my command line becomes excessively big. When it begins, the buffer displayed in the first newly created tab has only 10 ...
saginaw's user avatar
  • 6,826
4 votes
1 answer
2k views

Buftype=nofile when switching buffers with :Vexplore

When I open up :Vexplore in a split and open a file in it, the file in the other split ends up with buftype=nofile set so I can't write in that file or anything. But the new buffer that was opened ...
Wednesday's user avatar
4 votes
1 answer
2k views

Having issues maping <C-j> and <C-h> in vim [duplicate]

I tried to remap my split navigation like explained here. Moving to the top or right split works but ther other two just do nothing. I tried the same without a .vimrc which led to the same result. ...
Benjamin Zinschitz's user avatar
4 votes
4 answers
2k views

How to split view multiple buffers in vim

Working with big projects, I often find myself needing to view/edit several files at once. If I have multiple buffers open, is there a way to split the window to view multiple files in one command? E....
WalksB's user avatar
  • 517
3 votes
1 answer
915 views

Is it possible to simultaneously edit one file in two views?

I've been using Vim regularly for a decade, but still feel rather inexperienced because there is so much of Vim that I am not aware of and do not use. I sometimes want to see two different parts of ...
jvriesem's user avatar
  • 131
2 votes
1 answer
2k views

Replace netrw window when opening a file

I'd like to be able to :Sex when editing a file, select a file, press CR, and have that new split populated with the file I just selected. Is there an option for this? I think I became used to this ...
Alex Hirzel's user avatar