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
1 vote
0 answers
6 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
15 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,061
1 vote
1 answer
20 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
30 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
  • 25
3 votes
1 answer
48 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
  • 33
0 votes
2 answers
76 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
148 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
38 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,162
0 votes
1 answer
19 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?
evianpring's user avatar
0 votes
2 answers
71 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
  • 440
0 votes
2 answers
90 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,242
0 votes
1 answer
47 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,242
1 vote
0 answers
29 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,242
0 votes
1 answer
27 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
  • 143
1 vote
0 answers
162 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,242
0 votes
2 answers
300 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,242
0 votes
0 answers
159 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
34 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
37 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
1 vote
2 answers
192 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
20 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,242
0 votes
1 answer
87 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,242
0 votes
3 answers
44 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
51 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
89 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
3 votes
1 answer
153 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
  • 65
1 vote
0 answers
33 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
152 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
  • 241
1 vote
1 answer
270 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
0 votes
2 answers
351 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
663 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
283 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
334 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
17 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 ...
Ramon Moraes's user avatar
1 vote
0 answers
91 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
169 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
14 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
  • 485
1 vote
0 answers
163 views

How to detect split window resized?

I'm aware that the VimResized event happens the main vim window is resized. Is there any event that happens when a split subwindow is resized? I'm looking for something like WinResized. I'd like to ...
Jasha's user avatar
  • 493
0 votes
1 answer
57 views

Prevent subwindow height from shrinking to zero

Working from home on a travel laptop makes one very stingy with screen space. I often have Vim taking up the right-most third of the screen and split up into 2-3 vertically stacked subwindows. ...
user2153235's user avatar
0 votes
1 answer
167 views

Backslashes being removed from file paths when changing terminal to wsl on Windows gvim

On gvim for Windows I wanted to change the termial from cmd to wsl, so I added this to my gvimrc. which I got from an answer on another StackExchange site: " Use WSL as terminal on Windows if has(...
paradroid's user avatar
  • 241
2 votes
1 answer
224 views

In a vimrc, how do you preload a register with a string containing Special characters, like a newline?

In a vimrc file I want to preload register C with a string I regularly need when coding. The string has a newline in it but no success in getting it to work properly. Here is an example vimrc snippet ...
BentChainRing's user avatar
1 vote
1 answer
156 views

How do I use the \+ quantifier?

Running Windows 10 (Home) and VIM - Vi IMproved 8.1 (2018 May 18, compiled May 18 2018 18:36:07) MS-Windows 32-bit GUI version with OLE support Included patches: 1 Compiled by mool@tororo. I have ...
query-01's user avatar
0 votes
0 answers
996 views

Getting Server languageserver.ccls failed to start: error, when ever I open cpp file inside neovim

I get the following error: Server languageserver.ccls failed to start: Launching server "languageserver.ccls" using command ccls failed. I have installed coc-ccls, and I have pasted this ...
themujahidkhan's user avatar
0 votes
1 answer
135 views

Auto resize Vim focused window when open it the first time

I'm using vim-autoresize for resize windows. It uses: augroup _vim-autoresize autocmd! autocmd WinEnter * call autoresize#resize() augroup end But WinEnter just changes behavior when your ...
Pham Hung's user avatar
  • 113
1 vote
0 answers
21 views

Vader for testing plugin that eases window navigation

Some time ago I wrote a plugin for easy window navigation, and now I was trying to write some test for it, using Vader, which I knew nothing about until a few hours ago. Basically, with my plugin ...
Enlico's user avatar
  • 2,162
1 vote
1 answer
2k views

How do I open an existing file in a floating window?

For a plugin, I want to open an existing file situated in lua/myPlugin/ in a floating window, so whatever the actual working directory is, this file is always the one to be opened. It sounded easy, ...
Ludo's user avatar
  • 31
3 votes
1 answer
885 views

What's the difference between `BufWinEnter` and `BufEnter`?

I need an example to differentiate the two events in Vim, as I'm having a hard time understanding them.
NeoZoom.lua's user avatar
  • 1,242
3 votes
1 answer
209 views

Preventing extra window split

:help in Vim will do a window split if there is no help window. If there is a single window, this is fine. But when there is already a split (vertical or horizontal), I would like to see the help in a ...
Igor Bukanov's user avatar
1 vote
1 answer
103 views

BufDelete running after window is closed

For some reason, the BufDelete autocommand is being executed right after a window is created, instead before, and i think it shouldn't be like that, according to the docs: Before deleting a buffer ...
henriquehbr's user avatar
0 votes
1 answer
46 views

Meta-Model: Shrinking In Correct Direction

This questions sounds ridicolous, but is there any (mental?!) aid for my struggle when resizing windows? Since the earliest days of my vi/m usage, I have struggle shrinking windows in the correct ...
Tomes's user avatar
  • 78

1
2 3 4 5
7