-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
292 lines (233 loc) · 6.99 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
"
" This .vimrc is automatically sourced on save. For most changes, you won't need
" to restart vim.
"
" Vundle bundles
" https://github.com/gmarik/vundle
"
" Some bundles depend on ctags: `brew install ctags`
"
" Brief Vundle Help
" :PluginList - list configured bundles
" :PluginInstall(!) - install(update) bundles
" :PluginSearch(!) foo - search(or refresh cache first) for foo
" :PluginClean(!) - confirm(or auto-approve) removal of unused bundles
"
" See :h vundle for more details
" Comments after Bundle command are not allowed
" Both required by Vundle:
" (Not strictly necessary, since this appears in a user .vimrc where
" nocompatible is set by default, unlike the system-wide .vimrc.)
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Let Vundle manage Vundle
" Required!
Plugin 'gmarik/Vundle.vim'
" Github Bundles
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Plugin 'emcmanus/snipmate.vim'
Plugin 'msanders/cocoa.vim'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'Lokaltog/vim-powerline'
Plugin 'sjl/gundo.vim'
Plugin 'scrooloose/nerdcommenter'
Plugin 'xolox/vim-session'
Plugin 'duff/vim-scratch'
Plugin 'vim-ruby/vim-ruby'
Plugin 'mileszs/ack.vim'
Plugin 'emcmanus/vim-checkbox'
Plugin 'tomtom/tcomment_vim'
Plugin 'pangloss/vim-javascript'
Plugin 'scrooloose/syntastic'
Plugin 'kien/ctrlp.vim'
Plugin 'othree/html5.vim'
Plugin 'kchmck/vim-coffee-script'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'mhinz/vim-startify'
Plugin 'leafgarland/typescript-vim'
Plugin 'xolox/vim-misc'
Plugin 'groenewege/vim-less'
Plugin 'andreimaxim/vim-io'
Plugin 'fatih/vim-go'
Plugin 'junegunn/vim-easy-align'
Plugin 'vim-scripts/AnsiEsc.vim'
" tpope the man!
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-ragtag'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-markdown'
" To get YCM to build had to first uninstall brew's Python (I later reinstalled).
" See https://github.com/Valloric/YouCompleteMe/issues/18
"Bundle 'Valloric/YouCompleteMe'
" Transparently make gui color schemes compatible with terminal vim
Plugin 'godlygeek/csapprox'
" Vim-scripts.org
" To find the proper name, search https://github.com/vim-scripts/repositories
Plugin 'DrawIt'
Plugin 'cecutil'
Plugin 'matchit.zip'
Plugin 'php.vim'
Plugin 'Rainbow-Parenthesis'
Plugin 'cmdalias.vim'
Plugin 'dbext.vim'
Plugin 'psql.vim'
Plugin 'R.vim--Nijs'
Plugin 'csv.vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" End of vundle config
" *.ts extension
au BufNewFile,BufRead *.ts set filetype=typescript
" *.io extension
au BufNewFile,BufRead *.io set filetype=io
" Disable session autosave
let g:session_autosave = 'no'
" Most plugins expect bash, not Fish
set shell=bash
" CtrlP
let g:ctrlp_map = '<c-i>'
" Allow ctrlp to replace netrw window
let g:ctrlp_reuse_window = 'netrw\|help\|quickfix'
let g:ctrlp_max_files = 5000
" Root directory markers and ignore patterns from peepopen
let g:ctrlp_root_markers = ['.git', '.hg', 'Rakefile', 'Makefile', 'README\.?.*', 'build\.xml', '.*\.xcodeproj', '.*\.bbprojectd']
unlet! g:ctrlp_custom_ignore
" Note pipes need to be escaped per https://github.com/kien/ctrlp.vim/issues/58
let g:ctrlp_custom_ignore = {
\ 'file': '\v(\.git|\.hg|.*\.xcodeproj|.*\.bbprojectd)$',
\ 'dir': 'node_modules\|bower_components\|dist\|\.git\|\.hg\|\.svn\|\.sass-cache\|build\|tmp\|log\|vendor\/(rails\|gems\|plugins)\/\|proxy_cache',
\ }
" Start interactive EasyAlign in visual mode (e.g. vip<Enter>)
vmap <Enter> <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
" Per https://github.com/junegunn/vim-easy-align
" Change insert mode cursor shape
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
" Note fold settings are specified in ftplugin/text
" HTML Syntax highlighting in erb files
autocmd BufRead,BufNewFile *.erb set filetype=eruby.html
" YankRing
let g:yankring_warn_on_truncate=0
" RagTag
let g:ragtag_global_maps=1
" EasyMotion
let g:EasyMotion_leader_key='`'
" DBExt Profiles
let g:dbext_default_profile_yardsale_development = 'type=PGSQL:user=:passwd=:dbname=yardsale_development'
let g:dbext_default_profile = 'yardsale_development'
" Tagbar - hotkey `
"nnoremap <silent> ` :TagbarToggle<CR>
"let g:tagbar_autofocus=1 " Only set after opening
"let g:tagbar_autoclose=1 " Close after jumping
" Vim-Ruby Complete
"let g:rubycomplete_rails=1
let ruby_space_errors=1
let c_space_errors=1
" Cleanup trailing whitespace
:nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
" Source vimrc on save
au! BufWritePost .vimrc source %
" Disable error and visual bells
set noerrorbells visualbell t_vb=
" Remove toolbar in MacVim
if has("gui_running")
set guioptions=-t
endif
"
" Great defaults: http://stevelosh.com/blog/2010/09/coming-home-to-vim/#making-vim-more-useful
"
let mapleader = ","
set modelines=0
set tabstop=2
set shiftwidth=2
set expandtab
set smarttab
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set cursorline
set ttyfast
set backspace=indent,eol,start
set laststatus=2
" Requires v7.3
set relativenumber
set undofile
" Git commit message width:
set colorcolumn=72
" Center line on search
map N Nzz
map n nzz
nnoremap / /\v
vnoremap / /\v
set gdefault
set showmatch
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
set wrap
set textwidth=79
set formatoptions=qrn1
nnoremap j gj
nnoremap k gk
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
" Awesome, fast recursive text search of current directory
nnoremap <leader>a :Ack -i --type=nohtml
" JJ brings you back to normal mode
inoremap jj <ESC>
" Reduce timeout after <ESC> is recvd, helpful in terminal mode
set ttimeout
set ttimeoutlen=20
set notimeout
" Don't update screen when executing macros
set lazyredraw
" Create vertical split and give it focus
nnoremap <leader>w <C-w>v<C-w>l
" http://blog.infinitered.com/entries/show/8
set background=dark
colorscheme vivid_black_terminal
" Expand split width
nnoremap <leader>m 15<C-w>>
let filetype_m='objc'
" The following are from http://items.sjbach.com/319/configuring-vim-right
set hidden
set history=1000
runtime macros/matchit.vim
set wildmenu
set wildmode=list:longest
set ignorecase
set smartcase
set title
set scrolloff=3
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
nnoremap <C-e> 3<C-e>
nnoremap <C-y> 3<C-y>
set ruler
syntax on
filetype on
filetype plugin on
filetype indent on
set hlsearch " highlight search
set incsearch " search dynamically while typing
set shortmess=atI
" Create vertical split, give it focus, fire CtrlP
nnoremap <C-t> <C-w>v<C-w>l<cr>
" Buffer cycle
nnoremap <C-j> :bnext<cr>
nnoremap <C-k> :bprevious<cr>
" Exit insert mode and save current buffer, great for tight edit/test loops
inoremap kj <ESC>:w<cr>
inoremap jh <ESC>:w<cr>
" Quick scratch buffer
nnoremap <leader><tab> :Scratch<cr>