My .vimrc

Posted By Weston Ganger

I figured I would share my .vimrc file. I will be keeping it current it as it changes.

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'

" Custom Plugins
Plugin 'scrooloose/syntastic'
Plugin 'slim-template/vim-slim'
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-haml'
Plugin 'digitaltoad/vim-jade'
Plugin 'kchmck/vim-coffee-script'
Plugin 'scrooloose/nerdcommenter'

call vundle#end()
filetype plugin indent on

" Additional Syntax highlighting
au BufNewFile,BufRead *.prawn set filetype=ruby
au BufNewFile,BufRead *.axlsx set filetype=ruby

" Custom non-plugin config
set pastetoggle=<F5>

"for clipboard support install vim-gnome
set clipboard=unnamedplus

set expandtab       "Use softtabstop spaces instead of tab characters for indentation
set shiftwidth=2    "Indent by 2 spaces when using >>, <<, == etc.
set softtabstop=2   "Indent by 2 spaces when pressing <TAB>
set autoindent      "Keep indentation from previous line
set smartindent     "Automatically inserts indentation in some cases
set cindent         "Like smartindent, but stricter and more customisable
set mouse=a
set viminfo='20,\"1000 "increase buffer size for yanking and putting to another file"
set synmaxcol=400 "speed up vim"
set noswapfile
set number

syntax enable
set background=dark
colorscheme ron
highlight LineNr ctermfg=grey
set hlsearch
:hi Search ctermbg=yellow

set undofile
set undodir=~/.vim/undo

cmap w!! w !sudo tee > /dev/null %
cmap json %!python -m json.tool

"jump to previous position in file
if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif

"always paste to new line
:nmap p :pu<CR>

Article Topic:Software Development - Linux

Date:August 21, 2015