Questions tagged [split]

Questions about splitting current window into multiple viewports.

Filter by
Sorted by
Tagged with
2 votes
3 answers
57 views

Join two buffers into a single buffer

I'm looking for a way to: combine two buffers into single buffer using columns [1, winwidth] from left buffer and columns [1, eol] from right buffer. close buffer 2 so left with same contents in ...
Matthew Webb's user avatar
0 votes
0 answers
30 views

How to edit file as vsplit panels?

As Vim user, it is useful to view more lines of source code. Are there any tools which combine left and right panels when using :vsplit to split into two windows. Then move the cursor up/down.
user50473's user avatar
0 votes
1 answer
40 views

Quickly arrange split windows into a grid layout?

Does vim have a way of arranging split windows in a grid pattern? (Preferably, without closing existing splits, and without using a plugin.) Tmux has some predefined windowpane layouts. For example, ...
m_mlvx's user avatar
  • 109
1 vote
1 answer
62 views

How can I sync cursor movement in two vertical windows of the same file?

I can vertically split windows for the current file by :vs. Is there any way that I can sync cursor movement in the two windows? E.g. if the cursor in the left window moves up two lines, I want the ...
cat's user avatar
  • 33
0 votes
1 answer
120 views

Resizing split panes in vim with {n}Ctrl-W +/- not working as described on MacOS

I am using vim on MacOS. I have one vertical split down the middle and two panes split horizontally on the left side ( :Vex Ctrl wh :Sex ). From my understanding nCtrl w +|- should resize the focused ...
ThinkingInBits's user avatar
3 votes
1 answer
115 views

How can I run an autocmd before (!) a window is split?

TL;DR: I want to avoid split windows and tabs. Is there a way to intercept a split command with an autocommand that translates every window split, including those of plugins, into a simple buffer ...
TheGiwi's user avatar
  • 47
0 votes
2 answers
54 views

How to convert a string into a list of matching and non-matching substrings?

I have a list that I'm trying to filter. I'm planning to separate a string into parts of the string that matches a pattern and parts that doesn't. Like if the string is: <h1>hello</h1> ...
Samuel Bacay's user avatar
0 votes
0 answers
29 views

Why does `Ex` apply to both splits? [duplicate]

I noticed that when I split multiple times in combination with Ex, for example I run the following commands :Sexplore :q :Sexplore It will open netrw in both splits. I expected it to only open in the ...
slayer's user avatar
  • 11
0 votes
1 answer
50 views

Vim - open wrong path when I run command ':vs .' run in Vim

When I run the :vs . command in Vim for the current working directory window split, the parent directory opens, not the current directory. Example: A/B/C$ vi test.c in Vim: :vs . Split window ...
linuxias's user avatar
  • 109
1 vote
3 answers
145 views

How to Directly Go to Editor Groups?

Currently, I'm using C-wC-h-type of shortcuts to navigate through open editors. However, in VS Code, I'm also used to using shortcuts like C-1 to go to the first editor group, instead of hopping ...
psygo's user avatar
  • 135
0 votes
2 answers
233 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
1 answer
23 views

Starting from three horizontally split windows in Vim, how to have a new window vertically split to the left of all three initial windows?

Let's say we have three windows split horizontally in Vim and we want to have a new window that is split vertically to the left of all three current windows. How can this be achieved?
xoux's user avatar
  • 125
0 votes
2 answers
134 views

How to open files from terminal in desired pattern (tabs, vertical and horizontal splits on desired files)

So, I wrote next bash script: #!/bin/bash if [ "$#" -gt 1 ]; then path=$1 else path=$(cat subject.txt | tr -d '\n') fi nvim -p 1 "setup/$path/body.tex" -p 1 preamble/...
Vladyslav Rehan's user avatar
0 votes
0 answers
205 views

Vim vertical split window not rendered correctly

Not sure if it's related to vim configuration, tmux settings or ssh config, I opened a file with vim on a remote server, and every time when I use :vsp command to split a vertical window, the right ...
kuixiong's user avatar
  • 101
2 votes
1 answer
7k views

Splitting windows

Is there any way I can split the window as illustrated in the image?
SuperNoob's user avatar
1 vote
2 answers
82 views

Open the same file in two vertical splits: one editable, the other not

I need to refactor some paragraphs from an article. I would like to have: One split with the original version (not editable) Another split with the document to edit Is it possible?
Mafsi's user avatar
  • 225
0 votes
1 answer
64 views

vert command works but v doesn't

To open a buffer in a vertical split, you can use the word "vert". For example : :vert term #it opens a terminal in a vertical split :vert sb1 #it opens the buffer 1 in a vertical split ...
floupinette's user avatar
0 votes
2 answers
731 views

Is there a way to switch files in split screen?

I've been reading a lot about split screens in vim, but actually getting your cursor over to the other document is still a problem. You can create a vertical split screen with :vsplit <file-name>...
user avatar
-1 votes
1 answer
132 views

Edit a file in two different terminal windows

It's nice to edit the same file from two different views. I use a vsplit for this, as described here, and it works well. However, I'd like to have the two views open in different terminal windows, ...
Adam Selker's user avatar
0 votes
2 answers
172 views

QuickFix window default postion

It seems that the QuickFix window is created on the bottom of the upmost right vertical split. If I start with two splits: When I open the QuickFix window (:copen) the QuickFix windows is created as ...
Vivian De Smedt's user avatar
1 vote
1 answer
428 views

Showing text info in window split separators

(I'm using nvim 0.7 and have recently moved from a init.vim to lua, which is baffling me slightly.) In my old set-up a split would look like this: → note that the bar that splits the two windows ...
artfulrobot's user avatar
1 vote
0 answers
131 views

Neovim 'tab' or 'vert' no longer splits, just creates buffer

When I start a neovim session, my first command is to startup a terminal session within vim. However lately (perhaps due to an OSX update?) any use of vert or tab no longer performs a vertical split, ...
Doug T.'s user avatar
  • 111
2 votes
0 answers
195 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 :...
Polo's user avatar
  • 41
1 vote
2 answers
33 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 ...
xquilt's user avatar
  • 81
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 ...
purityKEF's user avatar
0 votes
1 answer
58 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 ...
hermancain's user avatar
2 votes
1 answer
42 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 ...
Joe's user avatar
  • 287
1 vote
1 answer
1k 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 ...
Matthias Braun's user avatar
2 votes
1 answer
41 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 ...
riordant's user avatar
1 vote
1 answer
513 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 ...
Quappas's user avatar
  • 63
0 votes
0 answers
30 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 ...
judeanpeoplesfront's user avatar
2 votes
2 answers
696 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 ...
xquilt's user avatar
  • 81
1 vote
1 answer
314 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 ...
Rob Mosher's user avatar
0 votes
0 answers
152 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 ...
squarebase's user avatar
5 votes
4 answers
9k 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+...
J86's user avatar
  • 225
1 vote
1 answer
1k 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 ...
mivkov's user avatar
  • 113
1 vote
1 answer
102 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 ...
user247824's user avatar
1 vote
1 answer
1k 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 ...
5c0tt's user avatar
  • 23
3 votes
1 answer
2k 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 ...
Aditya Kurdunkar's user avatar
0 votes
1 answer
142 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. ...
chocolate's user avatar
0 votes
1 answer
447 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 ...
Marco Andreolli's user avatar
0 votes
1 answer
197 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 ...
gust's user avatar
  • 113
0 votes
0 answers
43 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 ...
TamaMcGlinn's user avatar
-1 votes
1 answer
349 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&...
Kavin's user avatar
  • 1
0 votes
1 answer
141 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?
leeand00's user avatar
  • 3,577
1 vote
1 answer
168 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 ...
Quasímodo's user avatar
  • 2,466
5 votes
0 answers
154 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 ...
Christina Nguyen's user avatar
2 votes
1 answer
105 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 ...
ewr3243's user avatar
  • 131
1 vote
0 answers
100 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 ...
interfect's user avatar
  • 163
2 votes
0 answers
37 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., ...
Walt W's user avatar
  • 121