We already discover what is the easiest way to learn Vim and we learn how to navigate on a document so it’s time to try base commands used for editing.

Deleting text

If you want to delete a single letter you have to move to it and then press x key. I think it’s very intuitive because x it’s always used to close banners, popups and other windows in most of the systems.

Inserting text

If you want to insert given text you have to move to the right place which is the first character after the character where you want to put your text and then press i - remember that inserting would not end unless you press esc to quit inserting mode.

If you have Rd green string and you want to fix the first word you have to place your cursor at d and then press i

You can also use press a which will activate append mode. The only difference between insert and append mode is that the first mode insert text before letter you are currently on and append mode inserts text after the letter you are currently on.

Want to receive useful tips, information about new Ruby gems and articles on a daily basis? Make sure you follow me and say hello!

Practicing

You already know how to navigate, delete and insert so it’s time to practice!

Want to become a better Rails developer?
Download for free the Introduction Rails patterns book and dive into the world of refactoring and easy-testable Ruby code today.
Join over 1,000 developers already subscribed to my newsletter and download the book. You can unsubscribe anytime:

Subscribe and get the book!