Thursday, December 10, 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 :TlistToggle
" Builds tags for current directory
nmap :!/usr/bin/ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .

" Bufexplorer plugin toggle
nmap \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.

No comments:

Post a Comment