viernes, 1 de abril de 2011

My Vim configuration. Part 4 - Vim as an IDE

Today I'm going to finish my Vim configuration explanation (Have a look at the previous articles). The final part of my configuration is related to the "IDE behaviour" in Vim.

Encoding
First of all, I have set my encoding to utf-8 with:
set encoding=utf-8

Indentation
I prefer spaces to tabs, so this is how I configure it in Vim.
filetype indent on
set tabstop=2
set softtabstop=2
set smarttab
set expandtab
set autoindent

Line numbers
If you want to see the line numbers in Vim you only need to do:
set number

Backspace
Default backspace behaves in a strange way :P I've changed it so it behaves in a more "normal" way:
set backspace=indent,eol,start

Search
One of the most important features in Vim is searching. I've configured mine so it is case insensitive (except if what I search has an uppercase character, then it is case sensitive)
set ignorecase
set smartcase

I also want Vim to highlight my search terms:
set incsearch
set hlsearch

And I have a shortcut to remove the highlighting:
nnoremap <leader><space> :noh<cr>

There are some more little things that can help you in making a more "personal" Vim, but I'm going to stop here :) Feel free to have a look to my vimrc file or, you know, google it :P

Thanks for reading :)

No hay comentarios:

Publicar un comentario