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 ...
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 "...
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....
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(...
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 ...
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 ...
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.
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(...
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
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().
Community wiki
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]
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 ...
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, ...
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.
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 ...
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()
...
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("...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
vim-windows × 308buffers × 44
split × 36
vimscript × 31
vimrc × 30
neovim × 27
gvim × 24
key-bindings × 20
tabbed-user-interface × 18
window-management × 14
plugin-nerdtree × 11
autocmd × 10
terminal × 9
microsoft-windows × 7
netrw × 7
command-line × 6
terminal-buffer × 6
scrolling × 6
help-system × 6
colorscheme × 5
normal-mode × 4
functions × 4
plugin-system × 4
macvim × 4
options × 4