May 21, 2024

The .vimrc file

This is a file in your home directory named .vimrc (note the leading "dot" that causes this file to be hidden on many systems).

This can be short and simple or incredible complex, and will probably get bigger and more complex as your knowlege grows.

Take a look at an example file by starting vim and typing:

:r $VIMRUNTIME/vimrc_example.vim
Also try:
:help starting
:help vimrc-intro
I particularly recommend "starting" as it discusses how vim starts up, and the place of the .vimrc file in editor startup -- putting things in context.

My notes and comments

Vimscript is a language created specifically to configure Vim. It did not start out as a general programming language, and it is not clear that it has ended up being one. I works well doing what it was designed to do.

You can set options via:

set number
set nonumber
set shiftwidth=4
set number?
"number" is a boolean option, so you now know how to set it true or false. Putting a question mark at the end is how you ask what the value is. Other options (like shiftwidth) have numeric values.

You can put comments into vimscript by starting with a double quote mark.


Have any comments? Questions? Drop me a line!

Tom's vim pages / tom@mmto.org