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
0 votes
2 answers
26 views

How can I rebalance splits after the window size of the terminal changed?

I sometimes like using splits. Both vertical and horizontal, depending on the files I'm looking at. When creating a split, vim automatically halves the available size of, in my case, a terminal ...
bitmask's user avatar
  • 145
0 votes
1 answer
49 views

Get an exact copy of the buffer as it appears in the window

Main Question For a plugin I'm developing, I want to show a floating window somewhere within the buffer view, but want to work out exactly which rows and columns in the window are already taken up by ...
KamielDev's user avatar
  • 101
0 votes
2 answers
38 views

Any commands to switch to the window on the far left or right?

Let's say I have a grid of 3x2 windows open and I am focused on the bottom right one. I want to switch to the one on the bottom left with one command, not move left twice. Vice versa as well. There's &...
Oneechan69's user avatar
0 votes
1 answer
63 views

Is it possible to run a command on a specific buffer without switching to it?

A command to run on a buffer given its number or titled printed in :ls. This doesn't seem to be possible with :bufdo.
Oneechan69's user avatar
0 votes
2 answers
40 views

How can I create a new vsplit to the left of the topmost window with the same height with only commands?

Let's say I have two windows on the top and bottom, full width. I want to create a new window to the left of the top one and the same height. If there are two windows on the top taking up half width ...
Oneechan69's user avatar
1 vote
2 answers
309 views

Can I open Neotree in the current window instead of a in a new one?

When I do a command like :Neotree reveal it opens it in a new window on the left, when I want to it to show in the current window and hide the buffer that was there.
Oneechan69's user avatar
1 vote
1 answer
34 views

Command line to open list of files in as many buffer viewports

When I use a command like as: vim file1 file2 file3 ... file1 is opened and I can navigate with :next and :previous I would like all the files listed to be opened each in a different buffer viewports ...
Joce's user avatar
  • 161
1 vote
2 answers
71 views

Store a windows path in a global variable and access it later?

I want to store a path in a global variable and then change to a directory. :let g:OneDriveB='C:\Users\bram\SomeDrive\ -\ Das\ Company\ Name\' # Works. :cd g:OneDriveB # This second ex fails as the ...
leeand00's user avatar
  • 3,621
1 vote
0 answers
33 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
55 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
61 views

How do you change the window title line text in Vim?

How do I change where is says [No Name] or where it says gibbersh-letters-of-base64 to a text of my choosing?
leeand00's user avatar
  • 3,621
0 votes
1 answer
107 views

When I use helpgrep, how can I highlight my search results?

I'm using :helpg session in my Vim. I would like to highlight the pattern in the results like :set hls does for normal search. Is there a way to do this?
mohamadi_arch's user avatar
1 vote
1 answer
172 views

Why so % does not work when vimrc changes with another editor?

I opened a file in Vim. Then opened vimrc file with another editor (VsCode) and made some changes. I would like those changes to be reflected in my Vim session. I tried :so % but it didn't work ...
mohamadi_arch's user avatar
0 votes
0 answers
26 views

How do I instruct plugin BufExplorer to open a buffer in an existing window?

How do I instruct Vim plugin BufExplorer to open a buffer in a specific existing window rather than open the buffer in a new horizontal (key f or F) or vertical (key v or V) window?
Derek Mahar's user avatar
0 votes
1 answer
33 views

rightbelow not exhibiting the correct behavior

I am not seeing the correct behavior when I use the rightbelow command. If I run :vertical term then a terminal opens in a vertical split (terminal on the left, existing pane on the right), but the ...
Tyler Durden's user avatar
  • 2,131
1 vote
1 answer
38 views

Pause the rendering/refreshing/drawing of the gVim/Vim screen

I am developing a gVim plugin that manages/reorganizes panels, buffers and tabs. However, while most programmatic re-arranging take milliseconds, they can still look very messy to the eyes while you ...
Louis15's user avatar
  • 133
0 votes
1 answer
33 views

How to make left,right,up,down window movement behave like if windows were a ring?

This is, in the current window layout: +---+---+---+ | | | | | A | D | C | | | | | +---+---+---+ | E | F | G | +---+---+---+ If the focused windows is A, then moving to the left should ...
ax ax's user avatar
  • 35
3 votes
1 answer
166 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
148 views

Cannot get block-wise visual selections in vimscript?

I am searching for how to get visual selection in vimscript. And I found this: https://stackoverflow.com/a/61486601/4438921, it is great, but the only issue is that, in block-wise visual mode, I ...
linrongbin's user avatar
1 vote
2 answers
211 views

LeftMouse focus window without moving cursor

Is there a way for clicking on a Vim window to focus that window if inactive (without moving the cursor), then move the cursor if the window is already active? Here's what I've got so far: function ...
thirstyice's user avatar
0 votes
2 answers
42 views

Misunderstanding of interaction between local options, moving between windows, and WinLeave, WinEnter, BufLeave, BufEnter events

This what is logged in :messages when I'm printing the value of nu and rnu upon the 4 events WinLeave, WinEnter, BufLeave, BufEnter during the action, done twice, of opening :help and closing it. The ...
Enlico's user avatar
  • 2,244
0 votes
1 answer
24 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
114 views

How to re-open the same window with the same buffer therein?

Consider the following snippet: vim9script # Set stuff in the newly created window var my_win_nr = winnr('$') var my_win_id = win_getid(my_win_nr) win_execute(my_win_id, 'wincmd L') win_execute(...
Barzi2001's user avatar
  • 650
0 votes
2 answers
333 views

How to get the number of columns to the left border of the current window?

As title. I want to know the offset regardless of the current buffer. It's not the column number of the current buffer.
NeoZoom.lua's user avatar
  • 1,530
0 votes
1 answer
66 views

How to always open the `:h` as a split from the current window?

As title. Say I have A|B and already called :h foo on B then if I call :h bar on A it will not create a new split under A but change the content of the split from B instead. What I expect is that I ...
NeoZoom.lua's user avatar
  • 1,530
1 vote
0 answers
39 views

How to map both keymaps `<C-w>q` and `<C-w><C-q>` to do nothing?

As title. I usually mistyped <C-w> into <C-w><C-q> and it close the window I was working on. That is really annoying... I have tried mapping this keymap into <nop> but it didn'...
NeoZoom.lua's user avatar
  • 1,530
0 votes
2 answers
45 views

Can I copy options (everything shown when I run `:set` with no arguments) between active windows

I have two windows opened in the same terminal. These are actual vim windows within the same vim instance. The first window is a .py file which has many options set by default, plus additional options ...
Z4-tier's user avatar
  • 153
1 vote
0 answers
257 views

Is it possible to resize a floating window?

As title. Say I just created a floating window and some lines of it are too long to be displayed properly(to me), then in this case I would prefer to resize that window to make it larger instead of ...
NeoZoom.lua's user avatar
  • 1,530
0 votes
2 answers
777 views

Is it possible to prevent the buffer of a window from being changed?

As title. In fact, I just encountered a situation where I cannot change the buffer of the current window, which is created by some plugin. So I guess there might be some window/buffer option(s) to ...
NeoZoom.lua's user avatar
  • 1,530
0 votes
0 answers
319 views

vim-plug error on Windows

Longtime Linux, vim and vim-plug user, setting things up on Windows for the first time. For debugging, I've reduced my .vimrc to just this: call plug#begin() Plug 'lifepillar/vim-solarized8' call plug#...
Jeff Leyser's user avatar
1 vote
1 answer
42 views

How to increase one window and make all others equal height?

I use Vim version 8.2 I have e.g. 5 windows. I have made these of equal height by normal command CTRL-W = first question: How to write this to be executed as :excommand in the EXcmd line? second ...
Anton Wessel's user avatar
1 vote
1 answer
63 views

@: does not work to repeat the :qa command

I open the diff files between 2 code revisions using git difftool. I can use :qa to close the current diff and go to the next one. Rather than pressing :qa repeatedly, I would like to use @:, but I ...
Abhilash's user avatar
  • 113
1 vote
2 answers
416 views

How can I change undo behavior in Vim?

I'm new to Vim and install that in windows 10. I write this instructions in Vim then in normal mode pressed u and all the instructions disappeared. console.log(899) hello you can write some simple ...
mohamadi_arch's user avatar
0 votes
2 answers
39 views

Event with the same timing as BufEnter but triggers on vsplit?

As title. I have a pair of autocmds which needs each other: One on WinLeave, this one is fine since it will be triggered when I call :vsplit. One on BufEnter, this one is NOT fine for the edge case, ...
NeoZoom.lua's user avatar
  • 1,530
0 votes
1 answer
116 views

What's the filetype of winbar? Is it a kind of window?

As title. I have some plugins that conflict with each other. If I can know the filetype of winbar then I save much time debugging.
NeoZoom.lua's user avatar
  • 1,530
0 votes
3 answers
66 views

How to read a swapfile, but not touch the file which is open in Vim?

I am using vim 9.0 (2022 Jun 20, compiled Nov 30 2022 23:37:37). I am running KDE and under Konsole I have very many windows with terminals /dev/ptsnn open with shell bash in each. Many Vim instances ...
Anton Wessel's user avatar
2 votes
2 answers
129 views

Vim change window position with precision

Currently my Vim layout is this one : ________________________ | N | | | | E | | | | R | | | | D | | | | T |---------| | | r | ...
floupinette's user avatar
-1 votes
1 answer
153 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
5 votes
1 answer
697 views

How to toggle Fugitive status window

Fugitive provides a :Git commands that opens a window with basically the output of git status. To close it, I need to switch to that window and close it, which is tedious. How do I toggle this window?
henna's user avatar
  • 85
1 vote
0 answers
39 views

how to pass all open windows to command line in vim [closed]

I want to run clang-format on all open windows. What I currently do, is: for each open window: :!clang-format --style=file -i % I have 2 issues: the clang-format runs in shell, so it doesn't ...
CIsForCookies's user avatar
1 vote
2 answers
213 views

Does gvimfullscreen.dll working with gVim 9.0 on Windows?

I used to use gvimfullscreen.dll to toggle a full screen window state on gvim for Windows. It made gvim full screen, not maximised, with no titlebar. I have not used gvim on Windows for some time ...
paradroid's user avatar
  • 377
1 vote
1 answer
518 views

How can I open netrw in a split when opening a directory?

I have figured out how to open a file browser in a split, using the following in vimrc: let g:netrw_liststyle = 3 let g:netrw_banner = 0 let g:netrw_browse_split = 4 let g:netrw_winsize = 25 let g:...
Christoffer Reijer's user avatar
1 vote
2 answers
624 views

How can I get the active window in a tab?

For example, if I do: % vim file :tabedit one :split two I end up with two tabs, and one tab with two windows. How can I get the active window of the second tab? My goal is to get a list of all tabs ...
Martin Tournoij's user avatar
0 votes
0 answers
808 views

Coc.nvim doesn't work correctly

Yesterday, I installed coc.nvim in vim on windows. I remember that it showed up the suggestion tab. But today, I removed go and visual studio, then it didn't show up anymore. I tried to reinstall Go, ...
Anh Nguyen's user avatar
1 vote
1 answer
497 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
2 votes
3 answers
397 views

How to save a file for which I have no write permissions on Windows

I would like to edit files like C:\Widows\System32\Drivers\etc\hosts that need administrative privilege to be modified. How can save the file on Windows if Vim has not been starter with administrator ...
Vivian De Smedt's user avatar
0 votes
1 answer
19 views

Plugin Dev - Keeping Track of Windows inside a single Tab

I'm trying to build a new plugin and I got myself a question about managing multiple windows inside a single tab (hope the terms are correct). So far the examples and projects I've explored trying to ...
Moraes's user avatar
  • 115
1 vote
0 answers
144 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
0 votes
1 answer
250 views

Overriding syntax highlighting for LaTeX defaults in vim

I am currently using default syntax highlighting for LaTeX in vim on a Windows machine. Here are the contents of my _vimrc file: set number set belloff=all syntax on set backspace=indent,eol,start set ...
user32882's user avatar
  • 111
0 votes
0 answers
15 views

How to window leftcol without switching to the window

winsaveview() returns multiple details about the window including the leftcol which is the amount of horizontal scroll. However you need to switch to the window to get that. getwininfo() returns ...
s1n7ax's user avatar
  • 605

1
2 3 4 5
7