2022 Developer Survey is open! Take survey.

Questions tagged [split]

Questions about splitting current window into multiple viewports.

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

How to split view all buffers in vim with equal distribution vertical horizontal

How can I split view all buffers in vim with a distribution between vertical and horizontal? Is there a plugin? I know how to make all buffers appear in either horizontal or vertical splits: :ball :...
user avatar
  • 11
1 vote
2 answers
24 views

Make vim splits always positioned in the same place

Lets say there are multiple splits at the following layout. Is it possible to keep the last two placed in their position when the editing area is closed or unloaded from the buffer list, and fill its ...
user avatar
0 votes
0 answers
27 views

Is it possible to fix a section of buffer fixed on top even when scrolling?

I need to open 4 different files on my screen to consolidate data on diff file . I kept forgetting which tile is which file.. All my files has file name on line 1.. Is there way to keep the line 1 ...
user avatar
0 votes
1 answer
31 views

How to change [esc] behavior only in normal mode?

I'm hoping I phrased the question correctly as I'm not too sure how to ask my question. When I work in vim I use multiple "splits" (eg. :vsp, :sp). To navigate through the splits I have it ...
user avatar
2 votes
1 answer
38 views

Set split to size of file

I have a file that is 9 lines long called foo.txt . I use :split foo.txt and the new split takes up a full 50% of the editor, which results in a lot of wasted space. I can resize it with :resize ...
user avatar
  • 267
0 votes
1 answer
87 views

Splits on different monitors

I'd like to edit the same file at two different locations, let's say at the beginning and at the end of the file. Splits (:sp) are a natural way to do this. I have two monitors available and it sure ...
user avatar
2 votes
1 answer
37 views

Vim seamless file split with same features over the split windows

I have been searching for a way to do the following but haven't found exactly what I need, not sure if it's possible. I want to be able to split a file, but have the same features over the two splits ...
user avatar
0 votes
1 answer
33 views

How to properly set up ftplugin files for working with different filetypes in different windows?

$ vim --version VIM - Vi IMproved 8.1 I set up the following vim configuration files: " .vim/ftplugin/text.vim set textwidth = 0 " .vim/ftplugin/python.vim set textwidth = 99 set ...
user avatar
  • 23
0 votes
0 answers
22 views

After opening all args with :ba, go back to a single split

Generally when opening more than two or three files in vim, I use a single split, navigating between the files/buffers with :n/:N. Sometimes, however, I want to open all of them in visible splits at ...
user avatar
1 vote
2 answers
138 views

Make the default behavior of split window resize consistent

I use the keybinding Ctrl+W >/< to increase/decrease width of the split window, and that works just fine when the split window is in the left. However when I switch to any split beside the one ...
user avatar
1 vote
1 answer
122 views

Split and switch to bottom window when opening vim

When I open a file of a given filetype I want it to split into two windows with the cursor in the bottom window. I can get this to work when opening the file from an existing vim session. But when I ...
user avatar
0 votes
0 answers
39 views

Why does my syntax highlighting disappear after so many splits?

I can successfully run :sp *filename* several times per vim session, but after a seemingly-random number of splits (5-10) all future splits will no longer have syntax highlighting until I fully quit ...
user avatar
3 votes
4 answers
1k views

Open another file in split view that sits within the same directory as the currently opened file

I know there's a file called handler.ts in the same directory as the currently opened file handler.test.ts. How do I open that file in a split window (horizontal or vertical) without doing this: Ctrl+...
user avatar
  • 179
1 vote
1 answer
349 views

How to disable scrollbind and cursorbind after using vimdiff?

I have this issue where I need to both compare files, which I do using vimdiff, but also work on individual files with vertically split screens (vs). However, after I call vimdiff on a file, opening ...
user avatar
  • 113
1 vote
1 answer
29 views

How can I make Packer ignore the splitright setting?

I have splitright set in my init.lua so that when I run :vs, the new split opens on the right. Using Neovim 0.5-HEAD, Packer follows this setting and opens its splits on the right. I would like these ...
user avatar
1 vote
1 answer
137 views

navigate between current and previous tab or split

Is it possible to navigate between two previously used tabs and/or splits? I understand why buffers are best to use, and that I can use :b# to achieve what I want, but I have wondered if this was ...
user avatar
  • 23
0 votes
1 answer
357 views

How do I change focus in vim split through the command mode?

I am writing a function which splits open vim in three parts but the focus shifts towards the newly opened window and I don't want that that to happen is there any way to stop this? or is there a ...
user avatar
0 votes
1 answer
38 views

How to Start vim with splits open

I want IDE-like look when I start vim. 3 columns. Leftmost, at 15% width, file & symbol browser, then 60% width of main editor space and 25% showing debug points and run logs on right most part. ...
user avatar
0 votes
1 answer
59 views

nowrap option on a file opened in split window

I use set nowrap option in my config file, but when I open a file in a vertical split it has no effect. If I redo set nowrap after open the file (in the split windows) it takes effect Why? I try with ...
user avatar
0 votes
1 answer
88 views

Open vim with vsp and tabs on startup

I want the following configuration: Tab1: file 1 || file 2 Tab2: file 1 || file 3 I can open vsp with vim using vim -O file1 file2 I can open tabs with vim using vim -p file1 file2 Can I combine the ...
user avatar
  • 113
0 votes
0 answers
27 views

Put previous jump location in other buffer

I have multiple interesting buffers in my jumplist, but I would like to view two of them side-by-side. How would you do that? That's the general case of this question. In my particular case, it is ...
user avatar
-1 votes
1 answer
155 views

Split Navigation in vim terminal [duplicate]

I use vim splits quite a bit. To switch faster, I use this shortcut instead of doing ctrl + w + h/j/k/l/ " Quicker window movement nnoremap <C-j> <C-w>j nnoremap <C-k> <C-w&...
user avatar
  • 1
0 votes
1 answer
68 views

What is the vim equialent of CTRL+B, CTRL+<arrow-key> in tmux? [duplicate]

In tmux you can resize a pane gradually using the key combination CTRL+B CTRL+<arrow-key> to resize a split between panes. Can the same be done in vim between a split-buffer pane?
user avatar
  • 3,081
1 vote
1 answer
41 views

Synchronize the scroll offset of a vertical split

Set up Left (L) and right (R) are two vertically split windows displaying the same file. No other windows exist in the tab. The uppermost displayed line in L is x (Lx) and the uppermost line in R is ...
user avatar
  • 2,143
4 votes
0 answers
64 views

Intermittently cannot switch from Vim terminal to other panes

I've looked at quite a few other posts and haven't found a similar problem. I've recently begun using WSL and Vim and love it. Most of the time, it works great and I use CTRL-W-h/j/k/l to navigate ...
user avatar
2 votes
1 answer
51 views

Navigating between split vi windows [duplicate]

On Windows OS, I am using Chrome web browser to ssh into a remote Linux terminal and using vi there. One can use Ctrl-w + hjkl to navigate among split vi windows. However, the problem is Ctrl-w ...
user avatar
  • 131
1 vote
0 answers
50 views

How can I overlap windows, use non-rectangular windows, or dock a window in the corner?

I'm working on a text file (my notes/todo document), and I want to have the to-do list part of the document open in one Vim window (to check things off), with another to look at the rest of the ...
user avatar
  • 163
2 votes
0 answers
32 views

Method for each split to have its own undo buffer?

Often, I want to edit multiple different parts of the same file simultaneously. This is usually done with a number of splits. Is there a way such that the undo history in each split is separate? E.g., ...
user avatar
  • 121
4 votes
1 answer
606 views

Move cursor back to previous window after splitting

After running a command that opens a new split (e.g. :botright 10new), how can I have the cursor move back to its previous position? A use case would be to show a message in a scratch buffer without ...
user avatar
0 votes
1 answer
277 views

How to expand the splitted window using short key?

I have two vertically splited windows. I see from Ctrl+W s not splitting windows in Vim that Ctrl-W-| should resize the window. But it does not. Actually, nothing happens. If I manually resize the ...
user avatar
  • 111
0 votes
2 answers
94 views

Jumping between open splits using gF?

Im trying to make a setup where I can open a vertical split, preferably in the /tmp/ directory in readonly mode(so you cannot write changes) read the shell output from a linter/compiler (in my case, ...
user avatar
0 votes
1 answer
66 views

Adapt side panels to different screen resolution (aspect ratio)

How can I adopt side panel plugins (TagBar, TagList, NerdTree, etc) width to current screen aspect ratio? Using Vim with many different computers makes me a bit trouble to write one portable config ...
user avatar
  • 376
0 votes
1 answer
211 views

How to open a command in a split window?

I'm using grep in vim to do something such as: :grep pattern file and have a key-map for it that looks like that: function! Escaped() call inputsave() let result = escape(@", '\\/.*$^~[]#...
user avatar
5 votes
1 answer
122 views

Why are there no rightabove / leftbelow commands?

Referring to the existing leftabove and rightbelow commands, which do the following: execute a command if the command results in a split, it will be either opened on the left, or above the current ...
user avatar
  • 317
0 votes
0 answers
11 views

Opening multiple files both vertically and horizontally from the command line [duplicate]

I'm trying to open vim in a format like this, from the command line. |----------------| | | 2 | | |------| | 1 | 3 | | |------| | | 4 | |----------------|...
user avatar
0 votes
1 answer
54 views

Split causes the original viewport to scroll

Below, I call V1 the original viewport and V2 the new one. Start vim and write 5 sample lines. Leave the cursor in the last line. Issue :split. Expected behavior: V2 is opened below. V1 is inaltered,...
user avatar
  • 2,143
5 votes
2 answers
459 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 | ...
user avatar
0 votes
2 answers
32 views

Vim misses a few files when opening multiple files

I use vim -o a* to open 25 files (filenames starting with 'a') together and search & replace (:windo %s/old/new/gcI) some common word in these files. Later I found that not all of them have been ...
user avatar
0 votes
1 answer
221 views

How to map command+shift+right to widen vim split?

When I use 5<C-w>> in vim it makes my currently selected split increase by '5'. When I try to create this mapping on my Mac: noremap <silent> <D-S-Left> 5<C-w><<CR>...
user avatar
  • 101
4 votes
3 answers
860 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....
user avatar
0 votes
2 answers
58 views

Open some files in split and some other in tab at the vim invocation

I have four files file1, file2, file3, & file4. So I want to open them with vim directly from command line and get the following structure: Tabulation 1: file1 taking whole tab Tabulation 2: ...
user avatar
  • 111
1 vote
0 answers
134 views

Using fzf inside vim with double star completion

I wonder if it is possible to use fzf inside vim the same way it can be used on the command line. So, on the command line I can do vim file** and it will use fzf to search 'file'. I wonder if this is ...
user avatar
2 votes
2 answers
57 views

Vsplit in resized GUI Window in .vimrc

When I'm in the GUI, I like to have a large-ish vim window: 161 columns, so I can :vsplit it into two 80 column windows (with 1 extra column for the gutter.) This works perfectly fine if I do it by ...
user avatar
1 vote
1 answer
139 views

BufLeave: Auto save split file not working

I usually keep *.in files open in split and edit them. I would like vim to autosave the *.in files whenever I switch between splits. Searching other answers I found BufLeave that suits my case. I ...
user avatar
  • 323
2 votes
1 answer
94 views

Is there a way to resize a split such that it exactly fits its content (plus/minus N lines of buffer-space.)

I often find myself doing something like this with a tiny header file with only a few lines: Ctrl-W, ^ Ctrl-W, j 50, Ctrl-W, - 50, Ctrl-W, - 30, Ctrl-W, - 10, Ctrl-W, - … or similar, to slowly "zero ...
user avatar
2 votes
1 answer
522 views

Change cursor position in another window

Is there a function like setpos that lets change the cursor position in a different window (split), given the window number? Or, even better, is there a command to execute a command in specific ...
user avatar
3 votes
2 answers
1k views

How to make :Vex / :Hex open on the right side / below

When working on a file, I often open another file by looking for the file by opening the file browser in a vertical split with :Vex Opening the file it's actually nice to have the file browser show ...
user avatar
  • 151
1 vote
0 answers
38 views

No automatic scrolling when opening splits

When using plugins, splits are often created to show something, e.g. a quickfixlist or the taglist. If the split is opened (especially for horizontal splits), the original window is automatically ...
user avatar
  • 133
2 votes
1 answer
376 views

Ctrl w +/- not working as expected

I'm trying to use Ctrl w + and - to change my split width and height, but it's changing the font size instead. Any ideas about what's going wrong?
user avatar
1 vote
1 answer
39 views

Why are split and tab navigations distinct?

Known: <Ctrl>w then any of hjkl. Known: :tab_<CR> where _ is either rlpn. Why is there not a <Ctrl> navigation for tabs nor a : for splits? Why do the navigation commands differ ...
user avatar
  • 233