-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
182 lines (164 loc) · 4.74 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Keithbsmiley/rspec.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'altercation/vim-colors-solarized'
Plugin 'benmills/vimux'
Plugin 'bling/vim-airline'
Plugin 'bronson/vim-trailing-whitespace'
Plugin 'derekwyatt/vim-scala'
Plugin 'dgryski/vim-godef'
Plugin 'kien/ctrlp.vim'
Plugin 'plasticboy/vim-markdown'
Plugin 'rizzatti/dash.vim'
Plugin 'rizzatti/funcoo.vim'
Plugin 'rking/ag.vim'
Plugin 'rodjek/vim-puppet'
Plugin 'scrooloose/nerdcommenter'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'sjl/gundo.vim'
Plugin 'skalnik/vim-vroom'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'thoughtbot/vim-rspec'
Plugin 'tpope/vim-bundler'
Plugin 'tpope/vim-dispatch'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-git'
Plugin 'tpope/vim-haml'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-rvm'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-unimpaired'
Plugin 'fatih/vim-go'
Plugin 'vim-ruby/vim-ruby'
call vundle#end()
filetype plugin indent on
" Do not clear sreen on exit.
"set t_ti= t_te=
set autoindent
set background=light
set backspace=indent,eol,start
set browsedir=current
set clipboard+=unnamed
set directory=/tmp
set enc=utf-8
set expandtab
set foldmethod=manual
set guicursor+=a:blinkon0
set guifont=Monaco:h12
set hidden
set history=5000
set incsearch
set laststatus=2
set lazyredraw
"set list
"set listchars=tab:\|\ ,trail:·
set mouse=a
set nobackup
set noerrorbells
set nofoldenable
set nostartofline
set noswapfile
set novisualbell
set nowrap
set nowritebackup
set number
set ruler
set shiftwidth=4
set showcmd
set softtabstop=4
set splitbelow
set splitright
set synmaxcol=256
set t_vb=
set tabstop=4
set tm=500
set ttyfast
set ttymouse=xterm
set whichwrap+=<
set whichwrap+=>
try
colorscheme solarized
catch /^Vim\%((\a\+)\)\=:E185/
endtry
syntax on
syntax sync minlines=256
let NERDChristmasTree = 1
let NERDTreeDirArrows = 1
let g:NERDTreeWinSize=60
let g:gitgutter_eager = 0
let g:gitgutter_enabled = 1
let g:gitgutter_realtime = 0
let g:go_version_warning = 1
let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': [] }
let g:vroom_detect_spec_helper = 1
let g:vroom_use_binstubs = 1
let g:vroom_use_colors = 0
let g:vroom_use_dispatch = 1
let g:vroom_use_spring = 1
map <leader>T :CtrlPBuffer<CR>
map <leader>a <Esc>:Ag!
map <leader>d <Plug>DashSearch
map <leader>gn :GitGutterNextHunk<CR>
map <leader>gp :GitGutterPrevHunk<CR>
map <leader>j :NERDTreeFind<CR>
map <leader>n :NERDTreeToggle<CR>
map <leader>t :CtrlP<CR>
map <leader>u :GundoToggle<CR>
map <leader>ws :FixWhitespace<CR>
map <F1> :!clear<CR><CR>:redraw!<CR>:GitGutterAll<CR>:SyntasticCheck<CR>
map <F2> :VimuxRunLastCommand<CR>
map <F3> :set nofoldenable<CR>
" Navigation between split windows
map <c-h> <c-w>h
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
" Don't use Ex mode, use Q for formatting
map Q gq
cmap w!! w !sudo tee % >/dev/null
if has("autocmd")
autocmd! BufRead,BufNewFile *.god set filetype=ruby
autocmd! BufRead,BufNewFile Vagrantfile set filetype=ruby
autocmd! BufRead,BufNewFile Podfile set filetype=ruby
autocmd! BufRead,BufNewFile *.podspec set filetype=ruby
autocmd! BufRead,BufNewFile Jenkinsfile set filetype=groovy
autocmd! BufRead,BufNewFile Fastfile set filetype=ruby
autocmd! BufRead,BufNewFile BUCK set filetype=python
autocmd Filetype perl nmap <leader>pt :call DoTidy()<CR>
autocmd Filetype perl vmap <leader>pt :Tidy<CR>
autocmd Filetype ruby,eruby,rspec nmap <leader>rr :Dispatch spring rspec spec<CR>
autocmd Filetype go nmap <leader>r :GoRun<CR>
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType text setlocal textwidth=78
autocmd Filetype css,eruby,haml,html,ruby,yaml,xml setlocal ts=2 sts=2 sw=2
autocmd Filetype gitcommit setlocal textwidth=72
" Put these in an autocmd group, so that we can delete them easily.
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
augroup vimrcEx
au!
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
augroup END
end
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
set hlsearch
set guioptions=egmrt
endif
if ! has("gui_running")
let g:solarized_termcolors=256
set t_Co=256
endif