From the course: Learning Vim

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Abbreviations

Abbreviations - vi Tutorial

From the course: Learning Vim

Start my 1-month free trial

Abbreviations

- [Instructor] I wrote my book, Forging Python, in vim. The book is written as a dialogue between Greybeard, a seasoned developer and Youngstar a bright young developer. As you can imagine, writing these names got old very quickly. To solve this, I used abbreviations. You can define an abbreviation with :abb command. So let's start vim and then :abb _ys, which is the abbreviation, space and then what it's going to expand to, Youngstar: and then enter. And now when I write, I for insert mode _ys and when I do space it will be replaced with Youngstar and now I can continue writing. And how do I do that? Try to pick an abbreviation that can't be part of a regular word. That's why I used underscore at the beginning of the abbreviation. However, if you'd like to stop an abbreviation from expanding, use Control + V. So, enter _ys and then Control + V and space, not expanded. Another use for abbreviation is to fix common typos. Let's say I often misspell receive as recieve. I can do, escape…

Contents