Vim Techniques 08 - autocmd

Опубликовано: 18 Июнь 2026
на канале: haxpor
1,306
11

autocmd can be very useful to automated task to do something after you have modified the file, or even just open to read it. autocmd can be hooked to various many events when Vim starts to read the file. It can work with Vim's command, or even shell commands. Now possibility can be endless to make use of it.


This video expands on top from the previous video to automate the task of indentation with autocmd. In additionally, it also presents with other 2 example use cases; incrementally increases the complexity that autocmd can handle quite well.


Chapters
0:00 Introduction
0:19 Relate to previous video of Indentation
1:02 Problems at hand
1:47 autocmd overview setup in ./vimrc
1:58 What is autocmd
3:29 3 examples agenda
3:40 Chain multiple commands with |
4:27 Result of 1st example
5:14 Why autocmd didn't warn about modification?
6:10 No write or mess with original file
7:05 2nd example
9:37 3rd example
14:22 starstar + star (tripple stars)
16:59 another autocmd style for 3rd example
18:16 Recap


#vim #techniques #autocmd

** Follows Wasin on socials **
Website: https://wasin.io
Twitter: @haxpor
Github: https://github.com/haxpor