Over the past few days, vim's learning has almost reached the level of fanaticism. I forgot to learn vim for programming. There is no way to do it. I just like it. I just hope this kind of fanatic feeling.
Abbreviation (abbreviations ):
The abbreviation is used in insert, replace, and command line mode. If you enter a abbreviated word, It will be replaced with the represented word. This allows you to reduce the number of times you enter long words. It can also be used to automatically correct frequent spelling mistakes. For example:
: Iab MS Microsoft
: Iab tihs this (iab is the same as AB, but only used in insert mode. In this article, the default iab = AB)
Example of a string that cannot be abbreviated: "a. B", "# def", "a B", "_ $ r"
The abbreviation is recognized only when you enter a non-Keyword character.
For example: ({CURSOR} is where you enter a non-Keyword character)
: AB foo four old otters
"Foo {CURSOR}" extended to "four old otters"
"Foobar {CURSOR}" not extended
"Barfoo {CURSOR}" not extended
: AB # I # include
"# I {CURSOR}" extended to "# include"
"> # I {CURSOR}" not extended
: AB; <endofline>
"Test;" not extended
"Test;" extended to "test <endofline>"
Note:
: AB hh hello
"Hh <Space>" extended to "Hello <Space>"
"Hh <Ctrl +]" expanded to "Hello"
If you do not want to replace the entered characters, you only need to enter Ctrl + V after the abbreviation;
To view all abbreviations, you only need to enter AB in command mode.
Abbreviations in command mode:
: Ca s set nu
: Ca sn set nonu
Clear Abbreviation:
: Una [abbreviation]
For example, una s
Clear all abbreviations:
: Abclear
References: http://vimcdoc.sourceforge.net/doc/map.html#abbreviations
Author lalor