Skip to content

Instantly share code, notes, and snippets.

@nategraves
Last active April 24, 2017 16:48
Show Gist options
  • Save nategraves/711e47a5e719a6d51ea59d8f632833bc to your computer and use it in GitHub Desktop.
Save nategraves/711e47a5e719a6d51ea59d8f632833bc to your computer and use it in GitHub Desktop.
syntax on
set ruler
set tabstop=4
set shiftwidth=4
set softtabstop=4
set history=1000
set undodir=~/.vim/undodir
set undofile
set undolevels=1000 "maximum number of changes that can be undone
set undoreload=10000 "maximum number lines to save for undo on a buffer reload
" set number
set cursorline
set mouse=a
set list
set listchars=tab:>-
set nocompatible " be iMproved, required
filetype off " required
" Create window splits easier. The default
" " way is Ctrl-w,v and Ctrl-w,s. I remap
" " this to vv and ss
noremap <silent> vv <C-w>v
noremap <silent> qq :q<cr>
noremap <C-A><C-A> :set invnumber<CR>
nnoremap <silent> ss <C-w>s
map <C-n> :NERDTreeToggle<CR>
vmap r "_dP
" vnoremap <silent> <C-c> "*y
" Disable temp and backup files
set noswapfile
" 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'
" Sane tab widths
Plugin 'tpope/vim-sleuth'
" Ruby highlighting
Bundle 'vim-ruby/vim-ruby'
" Rails highlighting
Plugin 'tpope/vim-rails'
" Javascript indentation and syntax
Plugin 'pangloss/vim-javascript'
" Handlebars and Mustache modes
Plugin 'mustache/vim-mustache-handlebars'
" File search
Plugin 'kien/ctrlp.vim'
" Nerd tree
Plugin 'scrooloose/nerdtree'
" Trailing whitespace
Plugin 'bronson/vim-trailing-whitespace'
" Dash Integration
Plugin 'rizzatti/dash.vim'
" Use silver surfer in vim
Plugin 'rking/ag.vim'
" Make non-existent directories
Plugin 'pbrisbin/vim-mkdir'
" CtrlP
let g:ctrlp_by_filename = 0
let g:ctrlp_working_path_mode='a'
let g:ctrlp_match_window = 'top,order:ttb'
" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher
if executable('ag')
" Use Ag over Grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
call vundle#end() " required
filetype plugin indent on " required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment