Skip to main content

Questions tagged [events]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

How to set the foldlevel differently for function and class when loading a Python file?

To have an overview of a Python script I like to have: The global functions folded (foldlevel 0) The classes unfolded and all their methods folded (foldlevel 1) def foo(): print("foo") ...
2 votes
1 answer
209 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 ...
1 vote
1 answer
58 views

What is the reason to not have <C-c> trigger InsertLeave event?

In the past, I had a problem with the diagnostics virtual text not coming back after exiting insert mode. After a few hours of searching I just gave up. Today I have spend 2 hours trying to get my ...
3 votes
2 answers
957 views

Detecting the Enter and Leave of Visual mode event

Are there any events similar to InsertEnter and InsertLeave that I could use for visual mode? Looking through the helpfiles, I did not fine any. If not, how would I be able to detect if Vim enters or ...
1 vote
0 answers
722 views

How to lazy-load `oil.nvim` on `FileExplorer` event?

I have next oil.nvim setup (in lazy.nvim of course): return { { 'stevearc/oil.nvim', cmd = { "Oil" }, event = { "FileExplorer" }, opts = { ...
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 ...
0 votes
1 answer
137 views

Specifying filetype in ModeChanged event autocmd

I'm using stylua as the code formatter for lua files. I do not usually get used to its formatting style but sometimes I do need a little help with it, so I decided to make it the formatprg during the ...
0 votes
2 answers
385 views

How to close Terminal and NERDTree windows if they are the last windows?

If I close all buffers, I'm left with the terminal window, which automatically opens whenever I open Vim. I would like it close automatically when I exit Vim. I see that on the NERDTree repo, they ...
1 vote
1 answer
62 views

Is it correct that between a CmdlineLeave and a CmdwinEnter there must be a CmdlineEnter?

Given augroup Dummy autocmd! autocmd CmdLineEnter / echom "CmdLineEnter /" autocmd CmdwinLeave / echom "CmdwinLeave /" autocmd CmdLineLeave / echom "CmdLineLeave /&...
2 votes
1 answer
460 views

How can I execute a command after searching with `/`?

After a search command / (i.e., in normal mode) is done, I would like another command to be executed automatically. At the moment the other command should be :normal! zz, in order to center the found ...
1 vote
1 answer
16 views

How can I deactivate CR only if its effect is to move to the next line?

I don't use arrow keys, but to avoid the cursor moving should I hit them by mistake, I have this in my vimrc: inoremap <Left> <NOP> inoremap <Right> <NOP> inoremap <...
3 votes
2 answers
112 views

What is the pattern matched against for events CmdwinLeave and CmdwinEnter?

More in general I'm always in doubt about what's the meaning of the {aupat} argument of autocmd for a given {event}. From :help :autocmd I read (my emphasis) Add {cmd} to the list of commands that ...
7 votes
1 answer
1k views

How do you manually trigger an event?

I have case where I would like to trigger the TextChanged event manually without actually changing the text. Would that be possible? How? I know it's hacky, but it would make my life easier right now. ...
3 votes
1 answer
128 views

Is there going to be a VimConf this year?

Since Covid-19 hit, many conferences have been canceled or moved online. Are we going to have a conference for Vim and NeoVim in 2020?