-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
102 lines (90 loc) · 2.72 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
" Vundle stuff
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
set updatetime=100
let mapleader = "\\"
let g:AckAllFiles = 0
let g:rspec_runner = "os_x_iterm"
let g:rspec_command = "!bundle exec rspec {spec}"
let NERDTreeShowHidden=1
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 ""'
let g:ackprg = 'ag --nogroup --nocolor --column'
" " ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
Plugin 'VundleVim/Vundle.vim'
" Bundles
Bundle 'vcscommand.vim'
Bundle 'altercation/vim-colors-solarized'
Bundle 'sickill/vim-monokai'
Bundle 'scrooloose/nerdtree'
Bundle 'bufexplorer.zip'
Bundle 'tComment'
Bundle 'mileszs/ack.vim'
Bundle 'kien/ctrlp.vim'
Bundle 'thoughtbot/vim-rspec'
Bundle 'slim-template/vim-slim.git'
" Bundle 'sjl/vitality.vim'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'airblade/vim-gitgutter'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'wincent/terminus'
" Plugin 'tmux-plugins/vim-tmux-focus-events'
call vundle#end() " required
filetype plugin indent on " required
syntax enable
set mouse=a"Let mouse scrolling work in tmux
set ttymouse=xterm2"Let mouse scrolling work in tmux
set ignorecase
set smartcase
set tabstop=2
set shiftwidth=2
set expandtab
set hlsearch
set incsearch
set autoindent
set nrformats=
set background=dark
set bs=indent,eol,start
set colorcolumn=80
" set relativenumber
set number
set ttymouse=sgr
nnoremap <F5> :tnext<CR>
nnoremap <F4> :tprev<CR>
nnoremap <Leader>t :CtrlP<CR>
nnoremap <Leader>nt :NERDTreeToggle<CR>
nnoremap <Leader>nf :NERDTreeFind<CR>
nnoremap <Leader>nh :nohlsearch<CR>
nnoremap <Leader>rd Orequire 'pry'; binding.pry<Esc>
nnoremap <Leader>rt :!ctags -R --exclude=vendor --exclude=node_modules<CR>
nnoremap <silent> <Leader>cc :TComment<CR>
nnoremap <Leader>aw :Ack! '<C-R><C-W>'
nnoremap <Leader>st :call RunNearestSpec()<CR>
nnoremap <Leader>ss :call RunCurrentSpecFile()<CR>
nnoremap <Leader>sl :call RunLastSpec()<CR>
nnoremap <Leader>sa :call RunAllSpecs()<CR>
function! <SID>StripTrailingWhitespace()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
nmap <silent> <Leader>ws :call <SID>StripTrailingWhitespace()<CR>
colorscheme monokai
set re=1