Questions tagged [autocommand]

Vim autocommands are executed automatically by vim when certain events occur.

autocommand
5 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
287 views

Vim: opening new buffer changes file

I think I observe a weird behaviour in Vim autocommands, in which opening a new buffer changes the result of past commands (!). Here is a simple example (VIM 7.3 2010 Aug 15). I just created a file ...
Circonflexe's user avatar
0 votes
1 answer
762 views

Nvim: Error detected while processing BufReadPost Autocommands for "*":

I have been using nvim for a couple months now and 90% of the time everything works smoothly. Sometimes when I open nvim on my laptop (the same config works fine on my PC) I get the following error: ...
Fergus Johnson's user avatar
0 votes
0 answers
44 views

How to start every opening of a file on some text label

I would like for my vim (actually, neovim) to jump always to a label I leave in the text (or the first one, if there is more than one). So, I have setup this autocommand: au BufNewFile,BufRead * call ...
mcepl's user avatar
  • 2,729
0 votes
1 answer
81 views

How can I auto-format a git mailmap file on save in Vim?

I use mailmap files for some git repos. The lines in the files can be in one of these formats: Proper Name <[email protected]> <[email protected]> <[email protected]> Proper Name <...
planetp's user avatar
  • 15.2k
0 votes
0 answers
80 views

Why does my `au bufadd` prevent Vim from opening multiple files?

So, I've had the following chunk in my vimrc for a few years: " This toggles the hilighting of trailing-whitespace. fun! ToggleExtraWhitespace() if exists('b:ews') && b:ews == 1 "...
ELLIOTTCABLE's user avatar
  • 17.6k