VimNotion

How to get started with the Vim of VimNotion

What is Vim?

Vim is actually just a text editor (like Microsoft Word)! Vim has a rich history that starts with text editors like ed, em, and vi written in the 1970s. Bram Moolenaar wroteVim (Vi Improved) from a vi clone and is now one of the most popular text editors, especially for programmers that work on servers.
Vim is pre-packaged in most Unix based systems. In fact, if you open your terminal and type in "vim" I would bet your marchine already has vim installed.

Why is Vim such a core piece of VimNotion?

Besides its namesake, VimNotion embraces Vim not because of its complicated commands and key combinations, but because Vim's ergonomics keep you in the flow of writing once those keybindings are muscle memory.
I've found that once I've gotten familiar with Vim and its keybindings, I'm able to type and edit notes, code, documentation, any type of text closer to the speed of my thoughts. I can navigate lines, change text, and find things extemely quickly without context switching to my mouse and instead just keep my fingers flying.
Vim is a tool I just love using. When you love your tools, it's really easier to love your work.

Some Vim basics

This guide isn't a comprehensive tutorial to all of the different Vim keybindings. It's more to help you get started.

NOTE: I actually encourage you to go into VimNotion and use the command
:vimtutor
for an interactive tutorial of Vim.

Navigating the cursor with Vim

In general, try to only use the keyboard when working with Vim.
To move your cursor, use:
  • h - to go left
  • j - to go down
  • h - to go up
  • l - to go right

Adding text

Using h, j, k, and l to put your cursor in the right spot, when you're ready to add some text, use:
  • i - to insert the cursor on the left of the fat cursor
  • a - to insert the cursor on the right
You can exit "insert mode" and go back into "normal mode" by pressing "<ESC>"

Deleting text

"x" is how you delete a character. You can use a number followed by "x" to delete multiple characters. For example, "5x" deletes 5 characters.
"d" is another way to delete, but "d" is a modifier that requires an additional motion.
Common delete commands:
  • dw - deletes word
  • dd - deletes the line
  • diw - deletes in word if your cursor is in the middle of the word
  • 2dw - deletes two words

Copying and pasting

Use "y" to yank (copy) text, and then "p" to paste. You can use a count and a motion with "y" and "p". For example, "2yw" yanks two words, and "p" pastes them after the cursor.
To cut and paste, instead of using "y" just use "d". The deleted text is saved and can be pasted with "p".

Navigating a document

You can use "j" and "k" to move up and down a document, and even use a count and motion like "10j" to move quicker.
Here are some other useful vertical navigation keybindings:
  • gg to go to the top of the doc
  • G to go to the bottom
  • <ctrl>d to move halfway down your screen
  • <ctrl>u to move halfway up your screen
  • { to move up to the next blank line
  • } to move down to the next blank line
You should also use the "/" followed by a search keyterm to search for a word in your document. After pressing <enter> you can press "n" to move to the next occurance and "N" to move to the previous one.

Additional line navigation

If you have a long line, "h" and "l" may not be the best way to move within a line.
  • _ - go to the beginning of the line
  • $ - go to the end of the line
  • w - go to the beginning of the next word
  • e - go to the end of the next word
  • b - go to the beginning of the previous word
One of the most useful motions is "f" and "F". "f" followed by a character will jump to the next occurrence of that character. "F" works the same way but jumps to the previous occurrence of that character in the line. Use ";" to jump to the next occurrence without typing the motion again.

View mode

We went over how "i" and "a" will put you in insert mode, and "<ESC>" will put you back in normal mode. The other useful mode is view mode with "v"
In view mode you can highlight text, move around with "w" or "b" or "f" or "h" before yanking or deleting.

Commands

While not directly a part of Vim motions, commands are how VimNotion, Vim, and other extensions execute an action like quitting, saving a file, and creating tabs. The most important ones in VimNotion are inspired from Vim.
  • ":q" to quit a document WITHOUT saving
  • ":w" to save a document
  • ":wq" to save and quit
  • ":split" to split your screen into two separate panels
  • ":vs" to vertically split your screen
  • ":tabnew" to open a tew tab which you can toggle between with "gt" and "gT" (forward and backward)
For more information on VimNotion"s built-in commands, see the 'Editor Features' tab in the docs