Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions about splitting current window into multiple viewports.

0
votes
0answers
21 views

How could I rearrange the splitted buffer equally after opening the tagbar

I use thee command :vs to split the buffer vertically into two buffers. Then I use :TagbarToggle to open the tagbar buffer. However, the two splitted buffers no longer have same width with the tagbar ...
0
votes
1answer
29 views

Split resizing with mouse not working after upgrade from ubuntu 16.04 to 18

I use to be able to resize my vim splits using the mouse in the terminal by clicking on the borders and dragging. Now I can't. How can I make it work again? edit: still works in gvim but doesn't work ...
3
votes
1answer
38 views

How could I maintain split layout when deleting buffers?

I opened 5 buffers and in one of them I use the command :vs to spit the current buffer screen into two. The I use the command <leader>d to close one of the spitted buffers, the consequence is ...
0
votes
1answer
37 views

Is it possible to manage tabs only within the single window in split mode?

Here is my situation. I launch tmux on iTerm2 and then split the window vertically (left and right), then make the right side of the window split horizontally. So now, there are 3 windows, one big at ...
6
votes
0answers
83 views

Vi and Vim default to split left and split above. What is the history and motivation behind this?

When a window is split, given that Vi/Vim splits are not stored in a tree structure, the "direction of the split" is basically "the window in which the cursor is placed after the command". Update ...
2
votes
1answer
131 views

Carets in status line

When splitting the editor window, the caret symbols appear in the status line of the current window. This happens when StatusLine and StatusLineNC have the same highlighting. For example, when cterm=...
4
votes
1answer
60 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&...
0
votes
0answers
42 views

Execute an autocmd inside a particular window split

I am trying to achieve a layout similar to the one below. I can do it manually but I want Vim to start in this layout. There are three screen splits. On the left, NERDTree is displayed. On the top, ...
1
vote
1answer
66 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 ...
0
votes
2answers
117 views

Buffer variable is not set after :vs <file>

I've noticed that after I use :vs <file> or :sp <file> I have no buffer variables defined for this buffer. So I get E121: Undefined variable: b:Var after :echo b:Var there. But in the ...
1
vote
1answer
91 views

How to open a vertical split to the main view not just next to the current one in case of horizontal splitted viewport? [duplicate]

I have 2 buffers on eachother covering top and bottom of the screen. I want ot open a third buffer on right split but the problem is is I make a right split it will only split the top right or bottom ...
0
votes
0answers
31 views

problem with copying and pasting with vim vsplit [duplicate]

background I usually split my screen in vim (using vsplit) and sometimes I show the menu tree etc.. Problem suppose I have 3 panels open (two vsplit windows and a tree browser).. when I want to ...
4
votes
1answer
290 views

How can I open a split at whose height is a percentage of the main window?

Is there a Vim function or variable that would return 1/3rd (or any dynamic value) of the current window height? I'm using Neoterm, and it's terminal splits open at half the current window height by ...
1
vote
2answers
33 views

How to split the page adding a page from buffer (combining :sp/vs with :b)

How can I open a page from buffer below or to the right of the page I'm already viewing? By the way I want to open split the whole page not only the page I'm currently in. imagine I have to rows and I ...
1
vote
2answers
169 views

Setting custom statusline for help window

I've been trying to set a custom statusline for help files. I tried: set statusline=%!StatusLine() function! StatusLine() if &ft == 'help' let b:status = "%#error#[HELP]%*" else ...
1
vote
1answer
77 views

completely disable vertical splits

I usually use vim inside screen over ssh and sometimes I notice problems with the entire line "shifting over" when inserting text in a vertical split. Any one of these programs could be responsible ...
0
votes
2answers
133 views

shortcut of the current directory path when vsplit/split

I very often need to open files through vsplit/split. Very often I want to open files in the same directory. Still, I must pass their paths to vsplit/split. :vsplit @/siblingfile.txt @ is an alias ...
1
vote
1answer
63 views

Custom mapping for ex command -> still show typing in ex console

After I do a :sp or :vsp I find myself always turning off wrapping in the resulting window. My first attempt at automating this action looks like this (for the vertical situation): function! ...
6
votes
4answers
217 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 ...
2
votes
3answers
453 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 ...
1
vote
1answer
48 views

vim split files in new tab

I'm looking for something like :tabsplit file1 file2 which will open the two files in a new tab that is split with file1 in one split and file2 in another split I really want something like ...
1
vote
1answer
292 views

A fixed position for preview windows

Is it possible to setup vim to open all preview windows on a specific location. I want them to open on the right side.
0
votes
0answers
50 views

preview windows disturb text in the main window

In vim whenever a preview window or a loclist pops up, the text in the main window moves up a couple of lines. How can I disable this?
0
votes
0answers
32 views

How to make `:set wrap linebreak` work for splits that are *not* in focus

I have two files open in vertical splits. Each one is set to "wrap" and "linebreak" and it works fine for the split that's in focus, but only for that split. The non-focused split will not wrap ...
2
votes
1answer
139 views

:vsplit does nothing, sometimes

In a specific context, typing :vsplit does nothing. Typing :split still splits the screen horizontally. And if I open a new file e.g. vi foo.txt then :vsplit works. EDIT: steps to reproduce Type /...
1
vote
1answer
166 views

Open multiple files in split mode from within Vim (not command-line)

From within an existing Vim session, I am looking for a technique to achieve the equivalent of -o file1 file2 file3. The :sp[lit] command just seems to create a single new split--it doesn't allow for ...
1
vote
2answers
130 views

How to obtain fine-grained control over split sizes when using a large number of splits?

Let's say I have ten splits as follows: |0|1|2|3|4| |5|6|7|8|9| I now try to reduce the width of split 1 to be able to increase split 3 quite a bit (whoever wrote that particular file, used fairly ...
3
votes
0answers
59 views

:sbr opens buffers with horizontal split, even with switchbuf set to vsplit

I've set switchbuf to vsplit but when I use :sbr, vim uses a horizontal split to open the new buffer. This seems directly contrary to what :help sbr says: :sbr[ewind] [+cmd] Split window and go ...
4
votes
1answer
119 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. ...
1
vote
2answers
692 views

map a key to open Tagbar and NERDTree at the same time

I want to be editing a file like this: --------------- | | | | | DOC | | | | | | | --------------- And then press F5 and open ...
4
votes
2answers
108 views

Two seperate diff sessions on one screen

I would like to compare File1-v1.txt with File1-v2.txt and File2-v1.txt with File2-v2.txt at the same time. I tried to create the following layout: +------------------+------------------+ | ...
2
votes
1answer
148 views

Can I make all “resize split” commands take a default count?

While reading through this answer, I found these useful commands: Ctrl+W +/-: increase/decrease height Ctrl+W >/<: increase/decrease width These are super useful, but I hate how it defaults to ...
5
votes
1answer
245 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 ...
3
votes
1answer
48 views

allow splits to have 0 width and height

Any way to do this? I'm attaching a pic so you can see what I mean. There is one column on the left that I can't get rid of when re-sizing the split. I want the dashed bar to go all the way to the ...
2
votes
1answer
228 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 ...
1
vote
3answers
2k views

how to use Netrw Directory Listing in VIM split window without exiting it when a file has been read

When using VIM, it is possible to get a file listing in one split window by doing this: :vsp :e. Then you have something that looks like this: However if you open a file then how can you get back ...
0
votes
1answer
71 views

Vertical split keymap suddenly broken

In my vimrc I have a shortcut for opening a vertical split: let mapleader = ',' map <leader>v :vsplit<CR> " ,v for vsplit map <leader>s :split<CR> " ,s for split This has ...
7
votes
1answer
346 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
1
vote
1answer
698 views

Is it possible to obtain the displayable area, width and height of current buffer in Vim?

I know Vim provides functions to display window's dimensions. But does it also provide ways for me to know current buffer/split's dimensions? Like how many lines and columns in displable area? ...
1
vote
1answer
121 views

Assign shortcut to a Split window resize Ctrl+w+|

I can expand a vertical split screen to occupy most of the area using Ctrl+w+| Now I would like to map that shortcut to Ctrl+m. I tried the following but it failed. nnoremap <C-m> <C-W&...
2
votes
2answers
1k 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 ...
1
vote
1answer
674 views

How to remap <C-W>hjkl to navigate tmux panes and vim splits

I'm trying to use vim-tmux-navigator. I'd like to use default key bindings to move between vim and tmux splits. Which is <C-W>hjkl. But it isn't working. Either you can't remap anything with C-...
3
votes
1answer
308 views

Working with error lists while compiling

When I try to get a program to compile, I use the following process: :sh to open a shell make scroll up to see the compilation errors exit to get back to vim fix errors that I remember (usually 2 or ...
11
votes
2answers
1k 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?
2
votes
3answers
683 views

How to open a file from active buffer into a split window?

I have some files in my vim buffer. :ls shows the list of active buffer, I want to open a file from buffer into a vertically/horizontally split window. I know :vsp or :sp open split window in vim ...
1
vote
1answer
117 views

How to change the entry split from the .vimrc?

set scrollopt+=hor set scrollopt-=ver set nowrap set mouse=a 2split windo set scrollbind set statusline=%F%m%r%h%w[%{&ff}]%y%p%%\ %04l\/%04L\ Oc:Hx\ %b:%B%=%qF[%n]%t Above .vimrc is working quite ...
0
votes
0answers
39 views

how to change the window size when split or vs split [duplicate]

When I use vs or split command to open 2 windows, how can I resize the window size of each window? No mouse please.
5
votes
1answer
369 views

How to auto save file when moving between split?

I'd like to automatically save buffer after moving into another split. If you're interested why I'm interested in that read section below. I've started using vim and then neovim not so long ago, so ...
3
votes
1answer
98 views

Problem when assigning a keybinding to open the output of a shell command in vim

I wanted to have the output of a(any) shell command to open up in a vim split. Did a bit of research and found out that the command to do so was: :new | 0read | ! ls --- (or ...
4
votes
0answers
230 views

Persistently fix the height of a split in vim

So I searched the web far and wide and I can not for the life of me figure out how to do this. I have the following key binding: nnoremap <leader>o :below 10sp term://.//$SHELL <cr> :set ...