Customize Vim

Ever since I have decided to change my primary work platform from Windows to Arch Linux, I started looking for decent replacement of Source Insight.

The major problem is that I only want a fast EDITOR integrated with beautiful syntax highlighting, ability of jumping to definition (and jump back as well) and navigating through files or classes within the file, but not an IDE. I like to handle the Makefile, debuging and sort of things by myself. Therefore, not taking too much time for investigation, all the trails lead me to the Vim.

So this article will be continuously updated for how I use customize Vim (or basically how I revise .vimrc).

First of all, I took following great articles as reference:

 General Settings

Vim will start in default compatible with Vi and that will disable all the improved features (although I don’t know what are they). So set them no-compatible.

modelines is interesting feature that will initialize Vim by first and last few lines from the opened file. But I don’t want it. So set it to zero.

TABs are most concerned by programmers, huh?

Also I’d like to have auto indentation.

Sometimes I want to adjust the indentation of a block of codes. With following lines I can do it with < to reduce indentation and > to increase indentation.

Turn on Syntax Highlighter, set colors to 256 and use wombat256 color scheme. Meanwhile, place wombat256mod.vim into ~/.vim/colors

As a programmer, I definitely want to see the line numbers all the time.

As for automatically wrapping, there was a good article introducing textwidth and formatoption. However, strangely that they seems no effect on my settings. So I’ll just leave them there with automatically wrapping shut off.

Further, I think it’s good idea to display a line indicating me where the 80th column is.

Don’t let Vim backup files. Especially when I’m running the Arch on the USB key. I do want to reduce writing cycles.

OK. This one is good. To enter or exit Paste mode with F2. If not in the Paste mode, you may get bothered by auto-indent when trying to paste a lot of codes. You know what I’m talking about.

Vim has its own clipboard, adding this line will let me access system clipboard with Vim.

And also I want to use Mouse and normal Backspace.

Some more common and general settings.

And last one to automatically re-source the .vimrc file.

Plugin Settings

To be updated.

Leave a Reply