6/28/2013 - 6:27 AM

vimrRC for Getting Stuffs Done [VIM on Steroids] Basic VIM optimization + Few Common Mappings

vimrRC for Getting Stuffs Done [VIM on Steroids] Basic VIM optimization + Few Common Mappings

" Basics

syntax on
set background=dark
set ruler                     " Show the line number on the bar
set showmatch                 " Show matching parenthesis
set more                      " Use more prompt
set autoread                  " Watch for file changes
set confirm                   " Dialog Box to Confirm
set number                    " Display Line Numbers
set hidden                    " Re-use the same window and switch from an unsaved buffer without saving it first
set showmode
set showcmd                   " Show partial commands in the last line of the Screen
set wildmenu                  " Better command line completion
set autoindent smartindent    " Auto/smart indent
set wrap                      " Wrap lines
set smarttab                  " Tab and Backspace are smart
set tabstop=4                 " 6 spaces
set shiftwidth=4
set expandtab                 " Using spaces instead of tabs
set hlsearch                  " Highlist Searches
set ignorecase smartcase      " Use case insensitive Search, except when using capital letters
set scrolloff=5               " keep at least 5 lines above/below
set sidescrolloff=5           " keep at least 5 lines left/right
set history=200
set backspace=indent,eol,start
set linebreak
set cmdheight=2               " command line two lines high
set undolevels=1000           " 1000 undos
set updatecount=100           " switch every 100 chars
set complete=.,w,b,u,U,t,i,d  " do lots of scanning on tab completion
set ttyfast                   " we have a fast terminal
set noerrorbells              " No error bells please
set shell=bash
set fileformats=unix
set ff=unix
filetype on                   " Enable filetype detection
filetype indent on            " Enable filetype-specific indenting
filetype plugin on            " Enable filetype-specific plugins
set wildmode=longest:full

" Mapping

" Yank till end of line
map Y y$

" Map <C-L> (redraw screen) to turn off search highlighting until the next
" search
nnoremap <C-L> :nohl<CR><C-L>

" Map <Space> to / (Search) and <Ctrl>+<Space) for ? (Backward Search)
map <space> /
map <c-space> ?

" Remove the Windows ^M - when the encodings gets messed up
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm