So I like vim a lot, and I've been using it on and off for a few years, but recently I've been using it full-time to code in Python. I learned a few things along the way and I made vim a better IDE for myself. Here's how.
You can follow along or go straight to download my .vimrc file. Place the .vimrc file in your home folder and enjoy the goodies.
The first step is to make sure you have the equivalent power of jedit, textpad, gedit and the like.
Syntax highlighting, indentation, stats...
Make sure you install the full vim package. That will give you syntax highlighting for free, for every language you'll ever code in.
Then you can tweak the indent and the tabs as you wish. see vim's help (:help 'searchterm') for tabstop and autoindent. Also make sure your vimrc starts with:
set nocompatible " must be the first line filetype on filetype indent on filetype plugin on set laststatus=2 set statusline=%<%f\%h%m%r%=%-20.(line=%l\ \ col=%c%V\ \ totlin=%L%)\ \ \%h%m%r%=%-40(bytval=0x%B,%n%Y%)\%P
The last line will make vim display stats of the file in the status bar.
You want to see the line numbers? set nu
You want to highlight the cursor's line? set cul
Having problems pasting text into your buffer now that autoindent is on? see :set paste
NERDTree is started by typing :NERDTree and it will give you a much better file explorer than any other IDE. BufExplorer is started by typing \be and it will allow you to access a list of recently used files, and switch between them quickly.
You might also want to bone up on windows and tabs (:help windows and :help tabs)
This one is the first complicated item so I will leave it to you to figure it out. Just know that Vim has got all sorts of completion: keywords/filenames/current buffer/previous lines. The easiest one is to type Ctrl-X-N in insert mode. It will give you a list of the words in the current buffer that start with what you just typed.
You need incsearch set to show search matches as you type. Also, use * on a word to search for it in the current document. Use # to search backwards.
You should also copy this following code into your vimrc. It will allow you to place the cursor on a word, type \* and see a list of files that contain the word, recursively from your working directory. If it takes too long, you can change the cwd with the :cd command.
Once you can see the list of files, just type the number of the file you want to visit, and vim will take you there, at the line where the match occurred.
This function will also ask you for a second pattern, which you can use to make the search better/faster. For example if you know you are looking for a Python function definition, specify 'def' as the second pattern. (credits to a vim script that I can't find anymore)