| |
Learning the VIM Editor
I would like to help you learn how to use a VIM Editor.
You may have seen or heard about the unix text editor.
I hope the following links will help fill in the gaps between what you know and what you want to learn.
I recommend you take the time to climb the learning curve of this cross platform, widely installed, customizable, very capable text editor tool.
I have found knowing this editor is essential as I move from machine to machine.
The main URL for this page is https://www.grantbow.com/vim.html.
It was started in June 2019.
Thank you to all the contributors who have helped me keep this page updated.
Email is encouraged to Grant Bowman
<grantbow@grantbow.com>
I found knowing these editor commands is useful in other contexts besides the editor.
It can feel intimidating getting started because of the lack of context
but only a few commands are really needed to start, edit and quit VIM.
Here is a quick sample session.
$ vim filename The editor starts in Normal mode, not Insert mode.
Normal mode can almost always be entered by pressing <Esc> twice.
- Press the <arrow keys> or vim movement keys "h" (left) "j" (down) "k" (up) "l" (right) to move around.
When the fingers are in the standard typing positions you can press three of these without moving your fingers.
For one page at a time press <CTRL-f> for forward and <CTRL-b> for backward.
The other most common mode is Insert Mode.
- Press / to begin a regex search.
Type the text you wish to find.
Press <Enter> to jump to the first match.
- Press n for next and N for previous match in Normal mode.
You can match or substitute text with regular expressions.
- Press x to delete the character under the cursor and remain in Normal mode.
- Press i to begin insert mode.
Type characters you wish to add to the file.
Press <Esc> to get back to Normal mode.
- Type :w to tell the editor you are entering a command in Command mode, specifically write the file to the disk.
- Type :q to quit.
In Normal mode you can also:
- Type dd to delete the current line.
- Type p paste the most recent deletion.
- Type u to undo the most recent change.
- Type <CTRL-r> to redo an undone change.
- Press * to search for the word under the cursor.
This will allow you to edit a file.
That's all that's needed at first.
The creator of vim had this to say (video) (pdf) about learning more, sharpening the saw.
First Commands
| Link | Comments | Updated |
| vimtutor |
This is a 30-minute interactive course about using vim inside of vim with examples. |
20230915 |
| Learn Vim Progressively |
Starts from the beginning. |
20190608 |
| vim waz ere |
also starts from the beginning. |
20190608 |
| :help |
Extensive help exists inside vim. Includes Basic manual, User manual, detailed Reference manual and plugin help. |
20230916 |
| vim-adventures.com |
This is an online, browser-based game that starts from the beginning and it's fun. |
20190608 |
Next steps
Please email inquiries & suggestions to Grant Bowman <grantbow@grantbow.com>
Last update: 20230915
|