vim

How to control vim colors

vim colors FAQ: Can you provide details on how to control colors in the vim editor (vim color settings)?

When using vim syntax highlighting, a common complaint is that the default color scheme is a little too bold. In this article I'll try to demonstrate how you can change the colors in vim to be a little more pleasing, or at least be more in your control.

vim word completion - automatic word completion in the vim editor

vi/vim FAQ: How do I use the vim completion (word completion) feature?

When using the vi/vim editor I'm surprised how many people don't use its built-in vim completion (vim auto complete or vim code complete) feature.

vi/vim case insensitive search (how to)

vim search FAQ: How do I perform a case-insensitive search in vim? (Or, How do I ignore case with a vi/vim search?)

Using the vi (or vim) editor you can perform a case-insensitive search by first issuing this "set" command:

:set ignorecase

As its name implies, this set command tells the vim editor to ignore case (uppercase or lowercase characters) in your vim search.

The Vim goto line number command

Vim FAQ: What is the Vim go to line number command? (Or, how do I go to a specific line number in vim?)

In short, you use the capital letter 'G' in Vim command mode to move to a specific line number. Here are several Vim goto line number example commands:

The Vim next file command

Vim FAQ: I've opened multiple files in Vim; how do I move to the next file?

When you have multiple files open, to move to the next file in Vim, use this command:

:n

(Just think of "next", and you can remember this Vim command.)

Or, if you want to save your changes to your current file and also move to the next file, use this Vim command:

:wn

This Vim command means "write the current file to disk, and move to the next file".

I hope these "Vim next file" examples have been helpful.

The Vim page up and page down keystrokes

Vim FAQ: What are the Vim page up and page down keystrokes?

Short answer:

The Vim page up keystroke is [Control][b]. You can remember the 'b' by thinking "back".

The Vim page down keystroke is [Control][f]. You can remember the 'f' by thinking "forward".

More Vim page up and page down keys

I use those two Vim keystrokes most of the time, but you can use other keystrokes in Vim to move up and down, as shown here:

Vim insert commands

Vim FAQ: What is the Vim insert command?

Short answer: Type the letter 'i' while in Vim command mode. You'll then be able to type text into your document, right where the cursor is currently positioned.

Vim insert commands

Longer answer: There are several other variations of the Vim insert command you can use:

The Vim end of line command

Vim FAQ: What is the Vim end of line command?

Short answer: The '$' key.

Longer answer: Use the '$' key in vim to move to the end of the current line. Also, you can use the '0' key (the number zero) to move to the beginning of the current line.

You can find these answers and many more in our Vim navigation video tutorial, and in our collection of Vim tutorials.

The vim copy and paste commands

Vim FAQ: What are the vim copy and paste commands?

In vim you can copy and paste content fairly easily, but being an older text editor, these commands aren't obvious. Let's take a look at how to use copy and paste in vim.

The vim cut and paste commands

Vim FAQ: What are the vim cut and paste commands?

In vim you can cut and paste content fairly easily, but being an older text editor, these commands aren't obvious. Let's take a look at how to use cut and paste in vim.

The vim cut command

In short, the vim cut command is "dd" -- the letter 'd', typed twice. This command deletes the current line, but places it in a buffer, so you can easily paste it somewhere else. You use this command while in the vim command mode.

Syndicate content