Short for vim advanced topic (iab, AB, abbreviate)
Source: Internet
Author: User
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. Abbreviations: Used in insert, replace, and command line mode. If you enter a abbreviated word, it... 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 ;;
"Test;" not extended
"Test;" extended to "test "
Note:
: AB hh hello
"Hh "Expanded to" Hello "
"Hh
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
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.