-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
305 lines (251 loc) · 6.55 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
294
295
296
297
298
299
300
301
302
303
304
" wburningham's vimrc file
" last updated: 12-Mar-2017
" NerdTree - http://www.vim.org/scripts/script.php?script_id=1658
" FuzzyFinder - http://www.vim.org/scripts/script.php?script_id=1984
" tComment - http://www.vim.org/scripts/script.php?script_id=1173
" Toggle - http://www.vim.org/scripts/script.php?script_id=895
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" Enable filetypes
filetype plugin on
filetype indent on
" Switch on syntax highlighting.
syntax on
" Syntax coloring lines that are too long just slows down the world
set synmaxcol=2048
"Enable code folding
set foldenable
" With a map leader it's possible to do extra key combinations
" like <leader>w saves the current file
let mapleader = ","
let g:mapleader = ","
"Shortcut to fold tags with leader (usually \) + ft
"nnoremap <leader>ft Vatzf
" Make command line two lines high
set ch=2
" Show the current mode
set showmode
" Show the current command in the lower right corner
set showcmd
" Hide the mouse pointer while typing
set mousehide
" Theme favs: dusk, dw_cyan
colorscheme molokai
set nohidden
" Show the current cursor position in the lower right corner
set ruler
set nocompatible
" Tab settings
set tabstop=3
set shiftwidth=3
set softtabstop=3
set guifont=Monaco:h14
" Switch between buffers without saving
set hidden
"Show line numbers
set number
" Indent settings
set autoindent
set smartindent
" Make the command-line completion better
set wildmenu
set laststatus=2
set linespace=3
set go-=T
"Split windows BELOW current window
set splitbelow
"----- Search Settings -----
" Enable search highlighting
set hlsearch
" set the search scan to wrap lines
set wrapscan
" Incrementally match the search
set incsearch
" set the search scan so that it ignores case when the search is all lower
" case but recognizes uppercase if it's specified
set ignorecase
set smartcase
"----- Mappings -----
"Map a change to the Desktop
" nmap ,d :cd ~/Desktop<cr>:e.<cr>
"Shortcut for editing vimrc file
nmap ,ev :tabnew $MYVIMRC<cr>
" nmap ,s :cd ~/Sites<cr>:e.<cr>
"Saves time
nmap <space> :
"Map escape to ,e
imap ,e <esc>
"Map escape key to jj -- much faster
imap jj <esc>
" map variable auto complete
imap ,v <c-p>
" Maps change word to change inner word. Saves one keystroke and I almose always
" want to change the inner word.
nmap cw ciw
" ----- Buffers -----
"
" Map ,b to switch back to the last buffer
map ,b :b#<CR>
" :bda destroyes all buffers
nmap :bda :bufdo bd
" If you select some lines then press > to indent the lines, the selection is removed. The indentation can be repeated on the same range using ., but if you still want to retain the visual selection after having pressed > or <, you can use these mappings
vnoremap > >gv
vnoremap < <gv
"Map code completion to , + tab
"imap ,<tab> <C-x><C-o>
"Shorcut for NERDTreeToggle
nmap ,nt :NERDTreeToggle<cr>
nmap nt :NERDTreeToggle<cr>
" Map CTRL-E to do what ',' used to do
nnoremap <c-e> ,
vnoremap <c-e> ,
"----- Auto Commands -----
"Automatically change current dir to that of the file in the buffer
" autocmd BufEnter * cd %:p:h
"Source the vimrc file afer modifying
if has("autocmd")
autocmd bufwritepost .vimrc source $MYVIMRC
endif
"----- Plugin Settings -----
" NERDTree
" Show hidden files in NerdTree
let NERDTreeShowHidden=1
" Show the bookmarks table on startup
let NERDTreeShowBookmarks=1
" Don't display these kinds of files
let NERDTreeIgnore=[ '\.ncb$', '\.suo$', '\.vcproj\.RIMNET', '\.obj$',
\ '\.ilk$', '^BuildLog.htm$', '\.pdb$', '\.idb$',
\ '\.embed\.manifest$', '\.embed\.manifest.res$',
\ '\.intermediate\.manifest$', '^mt.dep$' ]
" T-comment
"Faster shortcut for commenting. Requires T-Comment plugin
map ,c <c-_><c-_>
" FuzzyFinder Settings
nmap ,fb :FufBuffer<CR>
" nmap ,ff :FufFile<CR>
nmap ,ft :FufTag<CR>
" Project FuzzyFind taken from: http://goo.gl/WjPqA
function! FufProject()
let origcurdir = getcwd()
let curdir = origcurdir
let prevdir = ""
while curdir != prevdir
if filereadable(".fuzzyfinder")
break
endif
cd ..
let prevdir = curdir
let curdir = getcwd()
endwhile
if filereadable(".fuzzyfinder")
let items = readfile(".fuzzyfinder")
let files = []
for n in items
let files += split(glob(curdir . "/" . n), "\n")
endfor
call fuf#givenfile#launch('', 0, '>', files)
endif
endfunction
nmap ,fp :call FufProject()<CR>
" nmap ff :call FufProject()<CR>
let g:fuf_maxMenuWidth = 200
"----- Fix constant spelling mistakes -----
iab teh the
iab hte the
iab Hte The
iab Teh The
iab taht that
iab Taht That
iab alos also
iab Alos Also
iab aslo also
iab Aslo Also
iab becuase because
iab Becuase Because
iab charcter character
iab Charcter Character
iab charcters characters
iab Charcters Characters
iab exmaple example
iab Exmaple Example
iab exmaples examples
iab Exmaples Examples
iab shoudl should
iab Shoudl Should
iab seperate separate
iab Seperate Separate
iab everythign everything
iab Everythign Everything
iab anythign anything
iab Anythign anything
iab wahts whats
iab waht what
iab Wahts Whats
iab Waht What
iab pubilc public
iab Pubilc Public
iab defualt default
iab Defualt Default
iab roght right
iab Roght Right
iab performa performs
iab Performa Performs
iab searhc search
iab Searhc Search
iab roels roles
iab Roels Roles
iab removs removes
iab Removs Removes
iab reccommend recommend
iab Reccommend Recommend
iab cahnged changed
iab Cahnged Changed
iab Haev Have
iab haev have
iab somethign something
iab Somethign Something
iab Otehrwise Otherwise
iab otehrwise otherwise
iab tehere there
iab Tehere There
iab tpye type
iab Tpye Type
iab differnt different
iab Differnt Different
iab charaters characters
iab Charaters Characters
iab charater character
iab Charater Character
iab begining beginning
iab Begining Beginning
iab proccessor processor
iab Proccessor Processor
iab reponse response
iab Reponse Response
iab Surevy Survey
iab surevy survey
iab avalibale avaliable
iab Avalibale Avaliable
iab everthing everything
iab startes starts
iab gam game
iab REbecca Rebecca
iab wnt want
iab agin again
iab htat that
iab stroner stronger
iab adn and
iab trak track
iab wansts wants
iab dooing dooing
iab anf and
iab amzaing amazing
iab thay they
iab lvo love
iab biship bishop
iab Biship Bishop
iab charis chairs
iab chari chair
iab goin going