Skip to content

Instantly share code, notes, and snippets.

@AvinashKrSharma
Last active July 13, 2017 13:06
Show Gist options
  • Save AvinashKrSharma/cd3f7a15989081e8ab16 to your computer and use it in GitHub Desktop.
Save AvinashKrSharma/cd3f7a15989081e8ab16 to your computer and use it in GitHub Desktop.
Initial vimrc helpful to get started with vim
" This will install Vundle
" Setting up Vundle - the vim plugin bundler
let iCanHazVundle=1
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle.."
echo ""
silent !mkdir -p ~/.vim/bundle
silent !git clone https://github.com/VundleVim/Vundle.vim ~/.vim/bundle/vundle
let iCanHazVundle=0
endif
" Basic settings
set nocompatible
filetype off
syntax enable
set autoindent
set backspace=indent,eol,start
set colorcolumn=80
set cursorline
set encoding=utf-8
set fileencoding=utf-8
set gdefault
set hlsearch
set ignorecase
set incsearch
set nolist
set noswapfile
set nobackup
set laststatus=2
set background=dark
set number
colorscheme default
set showmatch
set smartcase
set smartindent
set mouse=a
set wildcharm=<TAB>
set wildmode=list:longest,full " pressing tab takes to next command
set wildmenu " show available option in command mode
let mapleader = "\<Space>"
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'kien/ctrlp.vim'
Plugin 'docunext/closetag.vim'
Plugin 'bling/vim-airline'
Plugin 'tomtom/tcomment_vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
if iCanHazVundle == 0
echo "Installing Vundles, please ignore key map error messages"
echo ""
:PluginInstall
endif
call vundle#end() " required
filetype plugin indent on " required
" open NerdTree by default
autocmd VimEnter * NERDTree
" some handy mappings
map <leader>c :TComment<cr>
nnoremap <leader>i gg=G''
nnoremap <leader>n :NERDTreeToggle<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment