Questions tagged [split]

Questions about splitting current window into multiple viewports.

Filter by
Sorted by
Tagged with
2
votes
2answers
22 views

Add buffer space on line wraps

Is there a way to add some buffer space between the vertical separator and the content of a file in vertical split mode? Another way to say this: How do I force vim to not let a line touch a vertical ...
2
votes
1answer
23 views

Trouble mapping <control-pipe> in new keybinds

I've recently decided to improve my multiple-pane Vim workflow, so I'm adding some new mappings to avoid the awkward <C-W> command. Here's what I have currently: " split-pane navigation remaps ...
0
votes
1answer
20 views

How can I specify “split or move” logic for <C-W><C-L> and similar move commands?

Is it possible to make <C-W><C-L> command to make split on the right, if it's the rightmost pane opened? Otherwise, it would behave like regular move. It's something like "conditional ...
1
vote
3answers
125 views

Command to copy from current window and paste the text into terminal buffer

I am having trouble crafting a command that would copy the text from the current window and paste this text into a terminal buffer opened in the split below. Here are a few things I tried: normal ...
1
vote
1answer
33 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 ...
1
vote
2answers
53 views

How can I focus on one vimsplit fullscreen?

Say I've got three splits open with code in, and I suddenly want to make the one I'm in fullscreen, temporarily. How can I do that?
0
votes
1answer
33 views

How to open same file in multiple window but with changes present only in one window?

I want to view the initial copy of the file in a separate window while I make changes to the same file in another window. Is this possible?
1
vote
0answers
24 views

How to pin a file to a window(/viewport)

When I have multiple files open in multiple splits, when I open a new file via quickfix ( or Ctrl-P ), it sometimes ends up placing the new file in a window that I don't want to be changed. Is there ...
2
votes
1answer
36 views

Split same file into multiple windows “extending” each other

Suppose I have a long python file which is limited to 79 character or so in width. One very helpful feature would be if I could view the whole file separated into multiple vertical splits which "...
-1
votes
1answer
63 views

Vim split screen opens blank split

I am trying to open a different file at some different location while i am working on a file in vim using split screen feature using vsp:cd.. / folder/filename after I hit enter it just shows me ...
0
votes
1answer
35 views

Equivalent of emacs `winner-undo` and `winner-redo`

Vim's C-w o is equivalent to Emacs's ESC ESC ESC, which closes all the Vim's windows (Emacs's buffers), except the current open one. In Emacs, with the command winner-undo and winner-redo one can ...
0
votes
0answers
24 views

How to stop Vim changing color of the empty space on its own?

I didn't know what is the best title for this question. This problem is annoying me so much. I'm on Windows 7 and using nvim-qt. When I search for a word in the project or for example open NERDTree ...
3
votes
1answer
91 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 ...
0
votes
0answers
29 views

Using different listchars in splits

I have normally set up my listchars to make tab characters and trailing spaces visible. In my ~/.vim/vimrc I have: set listchars=tab:»\ ,trail:· Now there are certain file types where tabs are ...
2
votes
1answer
43 views

How to scroll two vertical splits at the same time?

I am not sure if it is even possible but, when I am working with vertical splits, sometimes, I want both of them to scroll up/down at the same time rather than using this combination: scroll down ...
1
vote
2answers
293 views

How to toggle between split window layouts?

I am looking for a way to toggle between these two layouts: ------- | | | ------- ------- | | ------- | | ------- I only have two windows and I need to switch the layout often. I need a ...
0
votes
1answer
89 views

Open ctrl+] in a new split?

How can I open the result of ctrl+] in a new split? similar: How do I open a tag with ctrl+] but open it in an existing split?
1
vote
0answers
200 views

How to close splits automatically when changing file or closing VIM?

I am trying to create my own IDE like setup inside of VIM. This is what I have. I am also using Tmux here if you wonder about the bottom terminal screen. If I change file to another CPP within ...
0
votes
1answer
86 views

Why do windows not have syntax after split?

I am trying to create my own C++ environment inside of VIM. So far, this is my setup when I run $ vim ~/shape.cpp: for example: As you can see, only NERDTree has full syntax highlighting (which isn'...
3
votes
2answers
109 views

From one split, how can I get the filename of the file in another split?

I have two files open, each one is in a split. From file one, how can I get the filename of the file in split two ? In command mode, I can get the reference of the filename I'm currently editing by ...
-1
votes
1answer
78 views

Why does :new create a split?

Why does :new create a split? What is the use case for that functionality? Normally when I open a new scratch buffer, I don't want it to be in a split.
0
votes
1answer
46 views

What's the Vim equivalent of Emacs's other-window command?

What's the Vim equivalent of Emacs's other-window command?
0
votes
1answer
200 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
2answers
159 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 split the current buffer screen into two. When I use the command <leader>d to close one of the splitted buffers, the consequence is ...
0
votes
1answer
91 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
200 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
309 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
408 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&...
1
vote
1answer
141 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
265 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
442 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 ...
3
votes
1answer
371 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
37 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
314 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
126 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 ...
1
vote
2answers
431 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
72 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! ...
7
votes
4answers
335 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
815 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
114 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 ...
2
votes
1answer
572 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.
2
votes
1answer
387 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
352 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
178 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 ...
2
votes
0answers
83 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
469 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
1k 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 ...
3
votes
2answers
161 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
258 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 ...
4
votes
1answer
466 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 ...