vi

How to set and use a vim color scheme

In an earlier vim color configuration tutorial I described how to have fine-grained control of your vi and vim color settings. In this article I’ll take an easier route and just show how you can use existing color schemes in your vi editor sessions.

Using a vim color scheme

Using a vim color scheme is actually pretty simple. If you’re in a vim editor session, just issue the vim colorscheme command from last line mode, like this:

My vi/vim tutorial goes over 200,000 views

Way back when I lived in this low-income apartment complex in Wasilla, Alaska — technically I had no income at the time, and it’s ridiculously hard to find a place to live in Alaska in the summer — and spent as much time as I could meditating in the mountains, I created a vi/vim editor video tutorial and put it on YouTube. I just noticed that video has now exceeded 200,000 views. It feels a little weird to think that over 200K people have started to learn vi/vim from that video.

A funny thing about making that video is that the walls in that apartment complex were paper-thin. I could hear everything my neighbors did in their apartments (use your imagination and you won’t be wrong), and they could hear me, so I intentionally tried not to talk too loud in the video. I had to edit the video at several points to crop out some of my neighbors yelling at each other.

Free Unix/Linux and vi/vim cheat sheets

Way back in the 1990s I created some “cheat sheets” for Unix training classes that I taught. Somewhere in the 2000s I updated them to make sure they worked with Linux as well, Here then are two Unix/Linux cheat sheets I created (way back when) that you can print out if you’re just learning Linux and the vi/vim editor:

Scary thought of the day

A scary thought for me is that as many as 138,664 people may have learned about the Unix/Linux vi editor by watching my old vi/vim tutorial on YouTube. That was one of the first video tutorials I ever created, and what I should have done is (a) never publish it, and (b) keep re-recording it until I got a lot better.

(I was reminded of this when YouTube sent me an email last night to congratulate me on having over 1,000 followers.)

How to control/configure vim colors

vim colors FAQ: Can you provide details on how to control/configure 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.

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: