-
Notifications
You must be signed in to change notification settings - Fork 3
/
.vimrc
288 lines (261 loc) · 7.27 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
" File: .vimrc [Vim resource script]
" Description: Settings, commands and mappings for Vim
" Maintainer: Pete Johns <paj-vim@johnsy.com>
" URL: http://github.com/johnsyweb/dotfiles/blob/master/.vimrc
"""" I'm having some terminal problems under Solaris.
"""" These mappings help:
map <Esc>[1~ <Home>
map <Esc>[2~ <Insert>
map <Esc>[3~ <Delete>
map <Esc>[4~ <End>
map <Esc>[5~ <PageUp>
map <Esc>[6~ <PageDown>
map <Esc>[A <Up>
map <Esc>[B <Down>
map <Esc>[C <Right>
map <Esc>[D <Left>
map <Esc>[11~ <F1>
map <Esc>[12~ <F2>
map <Esc>[13~ <F3>
map <Esc>[14~ <F4>
map <Esc>[15~ <F5>
map <Esc>[17~ <F6>
map <Esc>[18~ <F7>
map <Esc>[19~ <F8>
map <Esc>[20~ <F9>
map <Esc>[21~ <F10>
"" F11 and F12 are the same as S-F1 and S-F2, respectively
map <Esc>[23~ <S-F1>
map <Esc>[24~ <S-F2>
map <Esc>[25~ <S-F3>
map <Esc>[26~ <S-F4>
map <Esc>[28~ <S-F5>
map <Esc>[29~ <S-F6>
map <Esc>[31~ <S-F7>
map <Esc>[32~ <S-F8>
map <Esc>[33~ <S-F9>
map <Esc>[34~ <S-F10>
"""" And sometimes on my Mac, too...
if has('multi_byte')
try
imap <BS>
cmap <BS>
endtry
endif
"""" Handy keys on the command-line from, ahem, some other system...
cnoremap <C-A> <Home>
cnoremap <C-E> <End>
cnoremap <C-F> <Right>
cnoremap <C-B> <Left>
cnoremap <Esc>b <S-Left>
cnoremap <Esc>f <S-Right>
set autoindent
set autowrite
set background=dark
set backspace=indent,eol,start
set browsedir=buffer
set cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,ps,t0,+s,(s,)20,*30,g0,is,Ws,U4
set cinwords=
set clipboard=exclude:.*
set cmdheight=2
set nocp
set dictionary=/usr/share/dict/words
set diffopt+=iwhite
set display=uhex
set equalalways
set expandtab
if executable('ack')
set grepprg=ack
endif
set helpheight=15
set history=10000
set hls
set ignorecase
set incsearch
set nojoinspaces
set laststatus=2
set matchpairs=(:),{:},[:],<:>
set matchtime=2
set mousehide
set mousemodel=popup_setpos
if has('multi_byte')
try
set showbreak=↪
catch
endtry
endif
set relativenumber
set showcmd
if has('spell')
set spell
set spelllang=en_au
endif
set nostartofline
set nottyfast
set nrformats-=octal " Don't bother with octal, I never use it
set report=0
set scrolloff=4
set shiftround
set shiftwidth=4
set shortmess=filmnxtToO
set showfulltag
set showmatch
set smartindent
set smarttab
set statusline=[%n]\ %<%f%h%m
if exists('fugitive#statusline')
set statusline+=\ %{fugitive#statusline()}
endif
set statusline+=\ %#warningmsg#
if exists('SyntasticStatuslineFlag')
set statusline+=%{SyntasticStatuslineFlag()}
endif
set statusline+=%*
set statusline+=\ %r%=%b\ 0x%B\ \ %l,%c%V\ %P
set tags+=$WKSPACE/tags,$WKSPACE/src/tags
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
set viminfo='8,f1,"8,n${HOME}/.viminfo
set virtualedit=block
set visualbell t_vb=
set wildmenu
set wildmode=longest:list
filetype plugin indent on
" ToHTML options
let html_use_css=1
let html_no_pre=1
let use_xhtml=1
let g:xml_syntax_folding = 1
if (&t_Co > 1)
syntax on
if (&t_Co >= 256)
let g:solarized_termcolors=256
endif
let g:solarized_termtrans=1
endif
if ($OS =~"Windows")
let g:netrw_scp_cmd="\"c:\\Program Files\\PuTTY\\pscp.exe\" -q"
endif
let g:netrw_browsex_viewer='open'
nnoremap <Leader>/ :<C-U>nohlsearch<CR>
nnoremap <Leader>rls :%s/^\s\+//e<CR>
nnoremap <Leader>rts :%s/\s\+$//e<CR>
nnoremap <Leader>date a<CR>=strftime("%Y%m%d")<CR><Esc>
nnoremap <Leader>time a<CR>=strftime("%H:%M")<CR><Esc>
nnoremap <Leader>stamp a<CR>=strftime("%Y%m%d%H%M%S")<CR><Esc>
nnoremap <Leader>vimrc :e $MYVIMRC<CR>
cabb W w
if has('multi_byte')
try
abbreviate (snowman) ☃
abbreviate --> →
abbreviate :-( ☹
abbreviate :-) ☺
abbreviate <-- ←
abbreviate <== ⇐
abbreviate ==> ⇒
catch
endtry
endif
abbreviate JOhns Johns
abbreviate adn and
abbreviate flase false
abbreviate teh the
abbreviate whre where
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkgray', 'DarkOrchid3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
let g:rbpt_max = 16
let g:rbpt_loadcmd_toggle = 0
let g:dbext_suppress_version_warning = 1
call pathogen#infect()
try
colorscheme solarized
catch
colorscheme desert
endtry
syntax match Italic /\<paj\>/
syntax match Smiley /[8:;][-*o][(){}\[\]\/\\|p]/
function! ToggleWhitespace()
setlocal lcs=tab:>-,trail:-,eol:$ list! list?
if &list
match ErrorMsg /\s\+$/
else
match none
endif
endfunction
function! RunMake()
if exists(':Rake')
update
Rake
else
make
endif
endfunction
" [F1] :help. Built-in.
nnoremap <F2> :call ToggleWhitespace()<CR>
" [F3] toggles between (header, ) source and test files.
nnoremap <F3> :<C-U>TUT<CR>
" [F4] Go to next quick-fix
"[Shift-F4] Go to previous quick-fix
noremap <F4> :<C-U>cnext <CR>
noremap <S-F4> :<C-U>cprevious <CR>
nnoremap <F5> :call RunMake()<CR>
inoremap <F5> <Esc>:call RunMake()<CR>
" [F6] Break a line and right-align it
nnoremap <F6> <Esc>i<CR><Esc>:ri <CR>
" [F7] Toggle Vim v7.0 Spell-Checking
if v:version >= 700
nnoremap <F7> :<C-U>set spell! spell?<CR>
endif
nnoremap <silent> <F8> :TlistToggle<CR>
" Comments are lies (exception that proves the rule).
nnoremap <Leader>ic :<C-U>highlight! link Comment Ignore<CR>
nnoremap <Leader>sc :<C-U>highlight! Comment ctermfg=14 guifg=#80a0ff<CR>
" \1 git: show first commit where term under cursor was added:
nnoremap <Leader>1 :!git log --reverse -p -S<cword> %<CR>
inoremap <Leader>k <C-O>D
let g:syntastic_check_on_open=0
let g:syntastic_error_symbol='X'
let g:syntastic_warning_symbol='>'
if has('multi_byte')
try
let g:syntastic_error_symbol='✗'
let g:syntastic_warning_symbol='⚠'
catch
endtry
endif
let g:snips_author = 'Pete Johns'
inoremap <Leader>] <Esc>:update<CR>
nnoremap <Leader>] :update<CR>
if exists('RainbowParenthesesToggle')
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
end
let s:clang_library_path='/Library/Developer/CommandLineTools/usr/lib'
if isdirectory(s:clang_library_path)
let g:clang_library_path=s:clang_library_path
endif
let g:NERDSpaceDelims=1
let g:makeshift_chdir=1
let g:rspec_command = "compiler rspec | set makeprg=zeus | Make rspec {spec}"
nnoremap <Leader>ra :call RunAllSpecs()<CR>
nnoremap <Leader>rl :call RunLastSpec()<CR>
nnoremap <Leader>rs :call RunNearestSpec()<CR>
nnoremap <Leader>rt :call RunCurrentSpecFile()<CR>