-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.old
286 lines (216 loc) · 6.11 KB
/
vimrc.old
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
" Miles Yucht's .vimrc
" Path - /home/miles/.vimrc
" Last edited: 25 Apr 2012
" Set runtimepath "
" --------------- "
set runtimepath+=/usr/share/lilypond/2.14.2/vim
set runtimepath+=/home/miles/.vim/bundle/vundle
" ------------------
" My Plugins!
" ------------------
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'kien/ctrlp.vim'
Bundle 'scrooloose/nerdcommenter'
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/syntastic'
Bundle 'vim-scripts/taglist.vim'
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-git'
Bundle 'Lokaltog/vim-powerline'
Bundle 'tpope/vim-surround'
" ------------------
" Plugins
" ------------------
let g:proj_flags="imstvcg"
let g:Powerline_symbols='fancy'
let g:Tex_DefaultTargetFormat='pdf'
let g:ctrlp_prompt_mappings = {
\ 'PrtBS()': ['<bs>', '<c-]>'],
\ 'PrtDelete()': ['<del>'],
\ 'PrtDeleteWord()': ['<c-w>'],
\ 'PrtClear()': ['<c-u>'],
\ 'PrtSelectMove("j")': ['<c-j>', '<down>'],
\ 'PrtSelectMove("k")': ['<c-k>', '<up>'],
\ 'PrtSelectMove("t")': ['<Home>', '<kHome>'],
\ 'PrtSelectMove("b")': ['<End>', '<kEnd>'],
\ 'PrtSelectMove("u")': ['<PageUp>', '<kPageUp>'],
\ 'PrtSelectMove("d")': ['<PageDown>', '<kPageDown>'],
\ 'PrtHistory(-1)': ['<c-n>'],
\ 'PrtHistory(1)': ['<c-p>'],
\ 'AcceptSelection("e")': ['<c-t>', '<2-LeftMouse>'],
\ 'AcceptSelection("h")': ['<c-x>', '<c-cr>', '<c-s>'],
\ 'AcceptSelection("t")': ['<cr>'],
\ 'AcceptSelection("v")': ['<c-v>', '<RightMouse>'],
\ 'ToggleFocus()': ['<s-tab>'],
\ 'ToggleRegex()': ['<c-r>'],
\ 'ToggleByFname()': ['<c-d>'],
\ 'ToggleType(1)': ['<c-f>', '<c-up>'],
\ 'ToggleType(-1)': ['<c-b>', '<c-down>'],
\ 'PrtExpandDir()': ['<tab>'],
\ 'PrtInsert("c")': ['<MiddleMouse>', '<insert>'],
\ 'PrtInsert()': ['<c-\>'],
\ 'PrtCurStart()': ['<c-a>'],
\ 'PrtCurEnd()': ['<c-e>'],
\ 'PrtCurLeft()': ['<c-h>', '<left>', '<c-^>'],
\ 'PrtCurRight()': ['<c-l>', '<right>'],
\ 'PrtClearCache()': ['<F5>'],
\ 'PrtDeleteEnt()': ['<F7>'],
\ 'CreateNewFile()': ['<c-y>'],
\ 'MarkToOpen()': ['<c-z>'],
\ 'OpenMulti()': ['<c-o>'],
\ 'PrtExit()': ['<esc>', '<c-c>', '<c-g>'],
\ }
let g:syntastic_auto_loc_list=1
let g:Tlist_Use_Right_Window=1
let g:ctrlp_use_caching=1
let g:ctrlp_clear_cache_on_exit=0
" General Settings "
" ---------------- "
let mapleader=","
set number
set tw=80
set history=1000
set autoread
set autochdir
set so=2
set timeoutlen=300
set wildmenu
set wildignore=*.dvi,*.tif,*.png,*.pdf,*.xol
set showcmd
set ttyfast
set hid
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
set ignorecase
set smartcase
set hlsearch
set incsearch
set nolazyredraw
set magic
set noeb t_vb=
set novisualbell
set noerrorbells
set expandtab
set shiftwidth=2
set tabstop=2
set smarttab
set ai
set si
set wrap
" For Powerline
set laststatus=2
set encoding=utf-8
" Makes folding issues better
autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif
" Space highlighting at EOL
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" General Key Mappings "
" -------------------- "
nnoremap <silent> <leader>n :let @/=""<cr>
nnoremap <leader>w :w!<cr>
nnoremap <leader>ev :tabnew! ~/.vimrc<cr>
nnoremap <leader>sv :so ~/.vimrc<cr>
nnoremap j gj
nnoremap k gk
nnoremap <s-h> gT
nnoremap <s-l> gt
nnoremap <tab> ==
inoremap <s-left> <esc>bi
inoremap <s-right> <esc>wi
inoremap <c-e> <esc><c-e>
inoremap <c-y> <esc><c-y>
inoremap jk <esc>
inoremap kj <esc>
vnoremap <c-j> :!bash<CR>u
" Move tabs with alt + left|right
nnoremap <leader>h :tabmove -1<CR>
nnoremap <leader>l :tabmove +1<CR>
" GUI Settings "
" ----------- "
if has("gui_running")
colorscheme badwolf
set guioptions-=T
set gfn=Monospace\ 9
endif
" Appearance "
" ---------- "
set bg=light
set bg=dark
syntax enable
" Filetype Settings "
" ----------------- "
filetype plugin on
filetype indent on
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'
" Autocommands "
" ------------ "
autocmd VimEnter * call LoadNERDTree()
augroup latex
autocmd!
au FileType tex call TexAU()
augroup end
augroup java
autocmd!
au FileType java call JavaAU()
augroup end
augroup make
autocmd!
au FileType make call MakefileAU()
augroup end
augroup asm
autocmd!
au FileType asm call AsmAU()
augroup end
" ----------------------------------------
" Functions
" ----------------------------------------
function! LoadNERDTree()
:NERDTree
call feedkeys("\<c-w>p")
endfunction
function! TexAU()
iabbrev <buffer> `P \Phi
inoremap <buffer> / $$<lt>++><esc>4hi
inoremap <buffer> ? _{}<lt>++><esc>4hi
inoremap <buffer> > :
inoremap <buffer> < ;
inoremap <buffer> ' ^
inoremap <buffer> ; &
inoremap <buffer> : %
inoremap <buffer> [ {}<lt>++><esc>4hi
inoremap <buffer> ] }
inoremap <buffer> { []<lt>++><esc>4hi
inoremap <buffer> } ]
inoremap <buffer> ( ( )<lt>++><esc>5hi
inoremap <buffer> _ /
inoremap <buffer> & '
inoremap <buffer> ^ >
inoremap <buffer> % <
inoremap <buffer> $ ?
" Taglist toggle
nnoremap <silent> <F8> :TlistToggle<CR>
endfunction
function! JavaAU()
nnoremap <buffer> <leader>ll ! javac % <cr>
" Taglist toggle
nnoremap <silent> <F8> :TlistToggle<CR>
endfunction
function! MakefileAU()
setl noexpandtab
" Taglist toggle
nnoremap <silent> <F8> :TlistToggle<CR>
endfunction
function! AsmAU()
setl sw=8
setl tabstop=8
" Taglist toggle
nnoremap <silent> <F8> :TlistToggle<CR>
endfunction