vimrc [My vimrc file]

” The following are commented out as they cause vim to behave a lot
” differently from regular Vi. They are highly recommended though.
“set showcmd ” Show (partial) command in status line.
“set showmatch ” Show matching brackets.
“set ignorecase ” Do case insensitive matching
“set smartcase ” Do smart case matching
“set incsearch ” Incremental search
“set autowrite ” Automatically save before commands like :next and :make
“set hidden ” Hide buffers when they are abandoned
“set mouse=a ” Enable mouse usage (all modes)

” Source a global configuration file if available
“if filereadable(“/etc/vim/vimrc.local”)
” source /etc/vim/vimrc.local
“endif

” the call to :runtime you can find below. If you wish to change any of those
” settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
” will be overwritten everytime an upgrade of the vim packages is performed.
” It is recommended to make changes after sourcing debian.vim since it alters
” the value of the ‘compatible’ option.

” This line should not be removed as it ensures that various options are
” properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

” Uncomment the next line to make Vim more Vi-compatible
” NOTE: debian.vim sets ‘nocompatible’. Setting ‘compatible’ changes numerous
” options, so any other options should be set AFTER setting ‘compatible’.
“set compatible

” Vim5 and later versions support syntax highlighting. Uncommenting the next
” line enables syntax highlighting by default.
syntax on

” If using a dark background within the editing area and syntax highlighting
” turn on this option as well
set background=dark

” Uncomment the following to have Vim jump to the last position when
” reopening a file
if has(“autocmd”)
au BufReadPost * if line(“‘\””) > 1 && line(“‘\””) <= line(“$”) | exe “normal! g’\”” | endif
endif

” Uncomment the following to have Vim load indentation rules and plugins
” according to the detected filetype.
“if has(“autocmd”)
” filetype plugin indent on
“endif

” The following are commented out as they cause vim to behave a lot
” differently from regular Vi. They are highly recommended though.
set showcmd ” Show (partial) command in status line.
set showmatch ” Show matching brackets.
set ignorecase ” Do case insensitive matching
set smartcase ” Do smart case matching
set incsearch ” Incremental search
set autowrite ” Automatically save before commands like :next and :make
set hidden ” Hide buffers when they are abandoned
“set mouse=a ” Enable mouse usage (all modes)

” Source a global configuration file if available
“if filereadable(“/etc/vim/vimrc.local”)
” source /etc/vim/vimrc.local
“endif
“@Anukul
“filetype plugin on
set nocompatible
syntax enable
set path+=**
set wildmenu
set hlsearch
set paste
filetype plugin indent on
” show existing tab with 4 spaces width
set tabstop=2
” ” when indenting with ‘>’, use 4 spaces width
set shiftwidth=2
” ” On pressing tab, insert 4 spaces
set expandtab

” ctags shortcut keys
map <F2> <c-t>
map <F3> g]
map <F4> <c-]>
” Removes trailing spaces
function! TrimWhiteSpace()
%s/\s\+$//e
endfunction

“nnoremap <silent> <Leader>rts :call TrimWhiteSpace()<CR>

autocmd FileWritePre * :call TrimWhiteSpace()
autocmd FileAppendPre * :call TrimWhiteSpace()
autocmd FilterWritePre * :call TrimWhiteSpace()
autocmd BufWritePre * :call TrimWhiteSpace()

” Pathogen load
filetype off

call pathogen#infect()
call pathogen#helptags()

filetype plugin indent on
syntax on

let g:ycm_global_ycm_extra_conf = “~/.vim/.ycm_extra_conf.py”
let g:ycm_key_list_select_completion=[]
“let g:ycm_key_list_previous_completion=[]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s