-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
293 lines (242 loc) · 7.71 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
293
" ----------------------------------------
" important
" ----------------------------------------
if has('python3')
command! -nargs=1 Py py3 <args>
set pythonthreedll=/usr/local/Frameworks/Python.framework/Versions/3.6/Python
set pythonthreehome=/usr/local/Frameworks/Python.framework/Versions/3.6
else
command! -nargs=1 Py py <args>
set pythondll=/usr/local/Frameworks/Python.framework/Versions/2.7/Python
"set pythonhome=/usr/local/Frameworks/Python.framework/Versions/2.7
endif
set nocompatible
set viminfo=%,'100,<50,s10,h
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.Vim'
" Editor features
Plugin 'w0rp/ale'
Plugin 'mhinz/vim-startify'
Plugin 'kshenoy/vim-signature'
Plugin 'CycleColor'
Plugin 'Raimondi/delimitMate'
Plugin 'tpope/vim-commentary'
Plugin 'tpope/vim-vinegar'
Plugin 'tpope/vim-repeat'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'mileszs/ack.vim'
Plugin 'kien/ctrlp.vim'
" Git
Plugin 'tpope/vim-fugitive'
Plugin 'arkwright/vim-manhunt'
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
" Misc
Plugin 'arkwright/vim-shotput'
Plugin 'arkwright/vim-whiteboard'
Plugin 'tpope/vim-projectionist'
Plugin 'tpope/vim-surround'
" Snippets
Plugin 'SirVer/ultisnips'
Plugin 'aalvarado/ultisnips-snippets'
Plugin 'honza/vim-snippets'
Plugin 'rstacruz/vim-ultisnips-css'
" HTML
Plugin 'othree/xml.vim'
Plugin 'tmhedberg/matchit'
Plugin 'mattn/emmet-vim'
Plugin 'mustache/vim-mustache-handlebars'
" CSS
Plugin 'hail2u/vim-css3-syntax'
Plugin 'groenewege/vim-less'
Plugin 'ptrin/JumpToCSS'
" JavaScript
Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'
call vundle#end()
filetype plugin indent on
set autochdir
set hidden
set noeb
" ----------------------------------------
" moving around, searching and patterns
" ----------------------------------------
set incsearch
set ic
" ----------------------------------------
" tags
" ----------------------------------------
" ----------------------------------------
" displaying text
" ----------------------------------------
" ----------------------------------------
" syntax, highlighting and spelling
" ----------------------------------------
au BufEnter * :set synmaxcol=400
autocmd BufRead,BufNewFile *.tag set filetype=jsp
autocmd BufEnter,BufRead,BufNewFile *.jss set filetype=javascript
autocmd FileType jsp setlocal commentstring=<\%--\ %s\ --\%>
" ----------------------------------------
" multiple windows
" ----------------------------------------
" Switch windows with ctrl + hjkl
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" ----------------------------------------
" multiple tab pages
" ----------------------------------------
" Meta+1-0 jumps to tab 1-10, Shift+Meta+1-0 jumps to tab 11-20:
let s:windowmapnr = 0
let s:wins='1234567890!@#$%^&*()'
while (s:windowmapnr < strlen(s:wins))
exe 'noremap <silent> <D-' . s:wins[s:windowmapnr] . '> ' . (s:windowmapnr + 1) . 'gt'
exe 'inoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-O>' . (s:windowmapnr + 1) . 'gt'
exe 'cnoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-C>' . (s:windowmapnr + 1) . 'gt'
exe 'vnoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-C>' . (s:windowmapnr + 1) . 'gt'
let s:windowmapnr += 1
endwhile
unlet s:windowmapnr s:wins
" ----------------------------------------
" terminal
" ----------------------------------------
" ----------------------------------------
" using the mouse
" ----------------------------------------
" ----------------------------------------
" GUI
" ----------------------------------------
set nowrap
set number
au WinEnter * :setlocal number
au WinLeave * :setlocal nonumber
set background=dark
colorscheme hybrid
set cursorline
au WinEnter * :setlocal cursorline
au WinLeave * :setlocal nocursorline
set lines=200
set columns=120
set linespace=2
" ----------------------------------------
" printing
" ----------------------------------------
" ----------------------------------------
" messages and info
" ----------------------------------------
" ----------------------------------------
" selecting text
" ----------------------------------------
" Mapping gp to select last pasted text (like gv)
nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
" ----------------------------------------
" editing text
" ----------------------------------------
au InsertEnter * set isk+=-
au InsertLeave * set isk-=-
" delimitMate config
let delimitMate_expand_cr = 2
let delimitMate_expand_space = 1
let delimitMate_jump_expansion = 1
" ----------------------------------------
" tabs and indenting
" ----------------------------------------
"set smartindent
set tabstop=4
set expandtab
set shiftwidth=4
set softtabstop=4
" ----------------------------------------
" folding
" ----------------------------------------
" Save views (fold state of buffers)
au BufWinLeave * silent! mkview
au BufWinEnter * silent! loadview
nmap <Space> za
" ----------------------------------------
" diff mode
" ----------------------------------------
" ----------------------------------------
" mapping
" ----------------------------------------
imap jj <Esc>
command W :w
noremap <C-TAB> :tabnext<CR>
noremap <C-S-TAB> :tabprev<CR>
noremap <Left> :bp!<CR>
noremap <Right> :bn!<CR>
map <F1> :Vex<CR>
command Bdall :bufdo bd
map ,cd :cd %:p:h<CR>
nmap ,e :Lex<CR>
" ----------------------------------------
" reading and writing files
" ----------------------------------------
set backupdir=$VIMRUNTIME/temp/
set directory=$VIMRUNTIME/temp/
set nobackup
set nowritebackup
" ----------------------------------------
" the swap file
" ----------------------------------------
set noswapfile
" ----------------------------------------
" command line editing
" ----------------------------------------
" ----------------------------------------
" executing external commands
" ----------------------------------------
" ----------------------------------------
" running make and jumping to errors
" ----------------------------------------
" ----------------------------------------
" language specific
" ----------------------------------------
" ----------------------------------------
" multi-byte characters
" ----------------------------------------
" ----------------------------------------
" various
" ----------------------------------------
" Ultisnips
let g:UltiSnipsSnippetDirectories=["UltiSnips", "user-snippets", "ultisnips-snippets"]
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
" Zen coding
let g:user_emmet_leader_key = '<c-m>'
" Ack
let g:ackprg="/usr/local/bin/ack -H --nocolor --nogroup --column"
" CtrlP config
let g:ctrlp_match_window_bottom = 0
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_extensions = ['dir']
let g:ctrlp_custom_ignore = '\v(_site|target|tomcat)'
nmap ,f :CtrlP<CR>
nmap ,b :CtrlPBuffer<CR>
" Source: https://github.com/kien/ctrlp.vim/issues/280
let g:ctrlp_buffer_func = { 'enter': 'MyCtrlPMappings' }
func! MyCtrlPMappings()
nnoremap <buffer> <silent> <c-@> :call <sid>DeleteBuffer()<cr>
endfunc
func! s:DeleteBuffer()
let line = getline('.')
let bufid = line =~ '\[\d\+\*No Name\]$' ? str2nr(matchstr(line, '\d\+'))
\ : fnamemodify(line[2:], ':p')
exec "bd" bufid
exec "norm \<F5>"
endfunc
" JumpToCSS config
nnoremap ,jc :JumpToCSS<CR>
let g:jumptocss_autoclose = 1
" Indent Guides configuration
let g:indent_guides_color_change_percent = 2
" Startify
let g:startify_bookmarks = ['~/dev/kijiji/kijiji.ca','~/dev/kijiji/kijiji.ca/box-core-db-changelog/src/main/resources/ca/kijiji/db/changelog/config/db.changelog-master.xml']
let g:startify_change_to_dir = 1
let g:startify_custom_header = []