My .vimrc File

Spurred on by my recent experiences with the vi editor, I havedecided to shift from gedit to vi. The insert, command and visual notion was a bit difficult to get hang of at the beginning, but with some practice I am getting the hang of it. There’s so many more features in it than I have used till now. It needs a bit of getting used to.

The first thing I did was to customize my .vimrc file to suit my programming style. I like my code to be syntaxically coloured, indented and prefer spaces over tabs. Also I keep the width of my tabs to 2. I must mention here that most of my programming habbits are because of Udit Sajjanhar – the one semester that he was our TA for the course of compilers.

So here is my vimrc file :

" do not keep a backup file
set nobackup

" wrap off
set nowrap

" tabs are only 2 characters
set tabstop=2

" auto indent uses 2 charaters
set shiftwidth=2

" spaces instead of tabs
set expandtab

" set auto-indentation on
set autoindent

" expand command line using tab
set wildchar=

" show line numbers
set number

" fold using markers
set foldmethod=marker

" powerful backspaces
set backspace=indent,eol,start

" highlight search terms
set hlsearch

" dont wrap words
set textwidth=0

" history
set history=50

" 1000 undo levels
set undolevels=1000

" show partial commands
set showcmd

" show matching braces
set showmatch

" auto-detect the file type
filetype plugin indent on

" on the syntax by default
if has("syntax")
syntax on
endif

" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\   exe "normal g`\"" |
\ endif

Here’s the file in case you want to download it : vimrc

Reblog this post [with Zemanta]

Popularity: 2% [?]

Related posts:

  1. A Logger In C
  2. Printing The Last 50 Lines Of A File
  3. Bashrc Alias
  4. Amarok 2.1 … Now We Are Talking :)
  5. The So Called Coders

6 Responses to “My .vimrc File”


Leave a Reply