Lazy Hacker Babble

Just some random babblings from a lazy hacker…

.vimrc

Posted by hsin on December 10th, 2009

I’ve been trying to set up my VIM environment to be more comfortable for me so I can be more productive. It’s getting better although I still miss having a shell inside the editor that EMACS provide. Here is my current .vimrc:

" Enable loading filetype and indentation plugins
filetype plugin on
filetype indent on

" Turn on syntax highlighting
syntax on

" Global settings
set autowrite

" Allow backspacing over everything
set backspace=indent,eol,start

" Insert mode completion
set completeopt=menu,longest,preview

" Use UTF-8 as the default buffer encoding
set enc=utf-8

" Remember up to 100 ‘colon’ commmands and search patterns
set history=100

" Enable incremental search
set incsearch

" Always show status line, even for one window
set laststatus=2

" Jump to matching bracket for 2/10th of a second (works with showmatch)
set matchtime=2

" Don’t highlight results of a search
set nohlsearch

" Enable CTRL-A/CTRL-X to work on octal and hex numbers, as well as characters
set nrformats=octal,hex,alpha

"Show line, column number, and relative position within a file in status line
set ruler

" Show matching brackets
set showmatch

" Show line numbers
set number
" case-insensitive search
set ignorecase

" Code folding
set foldenable
set foldmethod=indent
set foldlevel=100

" Have VIM recursively search upward for tag file
set tags=tags;/

" Toggle tag list
nmap <F8> :TlistToggle<cr>
" Builds tags for current directory
nmap <F9> :!/usr/bin/ctags -R –c++-kinds=+p –fields=+iaS –extra=+q .<CR>

" Bufexplorer plugin toggle
nmap <F7> \be

" Change to directory of current working file
au BufEnter * lcd %:p:h

 

I use 2 plugins: TagList and Bufexplorer along with Exuberant-Ctags to make moving around the code easier.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>