Login | Sign up

May 17


0

Vim basic modes

Comments (0)

Vim has 6 basic modes each serving a different purpose with different commands available. Learn the basics and differences of each mode.

Normal/Command

This is the default mode when you start vim. In this mode you can move the cursor around using the arrow keys on your keyboard. To enter a command in this mode, you simply type the letter(s) of the command. To get back to this mode from any other mode, press Esc.

For example, pressing dd in this mode will cut out a line.

Insert

This mode allows you to insert text into the document. To get into this mode, press i or a from Normal mode.

Cmdline

This mode is meant for more complicated commands than Normal mode. Commands in this mode require that you press Enter when done. The most common types of commands in this mode start with : or /. When you press one of those starting characters from inside Normal mode, your cursor will be moved to the very bottom of the vim window and anything you type will be a cmdline command.

Ex

Ex mode allows you to enter several Cmdline : commands. After you enter the command, you can continue typing : commands without typing : again. You won't see your commands take effect until you leave this mode. To enter this mode, press Q from Normal mode. To leave the mode, you type visual.

Visual

Visual mode allows you to highlight a portion of the file. Once you highlight text, you can do several things such as copying or overwriting. To enter Visual mode, press v, V, or Ctrl+v from Normal mode. You can then move the cursor around and you will see the highlighted text. And finally press an operator command to do something with the highlighted text.

Select

Select mode is similar to Visual mode except you have different command options you can operate on the selected text. There are a few ways to enter Select mode depending on your configuration. It can be set to highlight using the mouse, arrow keys while Shift is pressed or using the same keys as Visual mode.

Tags:

Comments

There are no comments yet.


Post a new comment

Note: Items marked * are required fields

Post a comment

You must login before you can do that.

If you don't have an account, register for free. It's completely private.

Why register

  • rate posts and comments
  • ask questions about posts
  • request new topics/tutorials
  • mark posts as favorites to easily find them again