2 votes

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

When Vim opens help page it does the following: Split current Switch to new help buffer Follow the tag And so, Why do the first time I do :h and the second time generate different output? For the ...
Matt's user avatar
  • 20.4k
2 votes
Accepted

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

:so %, short for :source %, is: the :help :source command, which is used to "source" vimscript files, %, which is a shortcut for "the current file". Therefore, it means "...
romainl's user avatar
  • 39.1k
2 votes
Accepted

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

As 3n4N hints in the comments, your code is 90% of the way there; you just need to replace the command that opens the window in a new tab with one that makes the current window the only window. vim....
Rich's user avatar
  • 31.3k
1 vote
Accepted

LeftMouse focus window without moving cursor

Ok, I think I've figured it out. Here's the mappings I've come up with: noremap <expr> <LeftMouse> getmousepos().winid==win_getid() ? '<LeftMouse>' : '<Cmd>call win_gotoid(...
thirstyice's user avatar
1 vote

LeftMouse focus window without moving cursor

You can set the option mousefocus :set mousefocus When you move the cursor on the window the window is activated but the cursor is not changed (not exactly what you ask but close). You can use the ...
Vivian De Smedt's user avatar
1 vote

rightbelow not exhibiting the correct behavior

"Rightbelow" (or "belowright") here means "right or below whichever is applicable". So in your case you have to type all three words vert rightb term (or below vertical ...
Matt's user avatar
  • 20.4k
1 vote

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

I would try: set lazyredraw Remark: in my experience it has only an effect on Vim and not on gVim.
Vivian De Smedt's user avatar
1 vote
Accepted

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

Pseudocode: Try to move to window in <direction> If successful: done (it was not a boundary window) Else: move to the window in the extreme opposite of <direction> function! CircularMove(...
3N4N's user avatar
  • 5,544
1 vote

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

I would: Create a fourth horizontal split: Ctrl ws Move it to the left: Ctrl wShift h
Vivian De Smedt's user avatar
1 vote

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

It turns out the answer is wincol(), or written in Lua vim.fn.wincol().
1 vote

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

I believe the following call gives you the value you are searching: let col = win_screenpos(winnr())[1]
Vivian De Smedt's user avatar
1 vote

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

An alternative to Ctrl-w= is: :wincmd = To resize the other windows to equal height with the exception of the current one you could do: set winfixheight wincmd = set nowinfixheight The total script ...
Vivian De Smedt's user avatar
1 vote
Accepted

@: does not work to repeat the :qa command

The "colon" register tracks last command typed during current session. As you type :qa to quit from Vim, you cannot reuse it later. So you need to do something else. Maybe create a mapping, ...
Matt's user avatar
  • 20.4k
1 vote

How can I change undo behavior in Vim?

One way to get a behavior to want you want is to have the following mapping: inoremap <space> <C-g>u<space> It create a new undo operation each time you insert a space.
Vivian De Smedt's user avatar
1 vote
Accepted

How can I change undo behavior in Vim?

The undo action is per-line if you write a bunch of lines in insert-mode. This is natural as most languages use 1 statement per line (usally). To override this behavior while in insert mode use Ctrl-g ...
Gustav Blomqvist's user avatar
1 vote

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

The Termdebug Winbar is not a window and does not contain a buffer. Instead it's based on a built-in vim feature :menu. " Install the window toolbar in the current window. func s:InstallWinbar() ...
Mass's user avatar
  • 13.9k
1 vote

How can I make Vim open help in a vertical split?

Here's an autocmd in lua for neovim. -- Open help window in a vertical split to the right. vim.api.nvim_create_autocmd("BufWinEnter", { group = vim.api.nvim_create_augroup("...
Steve Ward's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible