Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 798 lines (669 sloc) 23.565 kb
27043da6 » Derek Wyatt
2011-10-31 Added some helpers for graphviz and tex in the XPTemplate configurati…
1 "
2 " Derek Wyatt's Vim Configuration
3 "
4 " It's got stuff in it.
5 "
6
451f244f » Derek Wyatt
2011-07-05 first commit
7 "-----------------------------------------------------------------------------
8 " Global Stuff
9 "-----------------------------------------------------------------------------
10
11 " Get pathogen up and running
12 filetype off
13 call pathogen#runtime_append_all_bundles()
14 call pathogen#helptags()
15
93494a5e » Derek Wyatt
2011-07-15 Added ActionScript bundle to Vim. Modified a bit to handle the recent…
16 " Add xptemplate global personal directory value
17 if has("unix")
18 set runtimepath+=~/.vim/xpt-personal
19 endif
20
451f244f » Derek Wyatt
2011-07-05 first commit
21 " Set filetype stuff to on
22 filetype on
23 filetype plugin on
24 filetype indent on
25
26 " Tabstops are 4 spaces
083691b5 » Derek Wyatt
2012-01-17 Lots of little updates. Most notably, as of late, added some maps to …
27 set tabstop=2
28 set shiftwidth=2
29 set softtabstop=2
451f244f » Derek Wyatt
2011-07-05 first commit
30 set expandtab
31 set autoindent
32
9db6c666 » Derek Wyatt
2011-09-08 Added the ultra-cool 'clear text op-pending command'. Awesome.
33 " Printing options
34 set printoptions=header:0,duplex:long,paper:letter
35
451f244f » Derek Wyatt
2011-07-05 first commit
36 " set the search scan to wrap lines
37 set wrapscan
38
39 " I'm happy to type the case of things. I tried the ignorecase, smartcase
40 " thing but it just wasn't working out for me
41 set noignorecase
42
43 " set the forward slash to be the slash of note. Backslashes suck
44 set shellslash
45 if has("unix")
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
46 set shell=bash
451f244f » Derek Wyatt
2011-07-05 first commit
47 else
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
48 set shell=ksh.exe
451f244f » Derek Wyatt
2011-07-05 first commit
49 endif
50
51 " Make command line two lines high
52 set ch=2
53
54 " set visual bell -- i hate that damned beeping
55 set vb
56
57 " Allow backspacing over indent, eol, and the start of an insert
58 set backspace=2
59
60 " Make sure that unsaved buffers that are to be put in the background are
61 " allowed to go in there (ie. the "must save first" error doesn't come up)
62 set hidden
63
64 " Make the 'cw' and like commands put a $ at the end instead of just deleting
65 " the text and replacing it
66 set cpoptions=ces$
67
05a9c944 »
2014-02-25 Status line trimming
68 function! DerekFugitiveStatusLine()
69 let status = fugitive#statusline()
70 let trimmed = substitute(status, '\[Git(\(.*\))\]', '\1', '')
71 let trimmed = substitute(trimmed, '\(\w\)\w\+\ze/', '\1', '')
3d8fa65e »
2014-06-08 More personal tweaks
72 let trimmed = substitute(trimmed, '/[^_]*\zs_.*', '', '')
05a9c944 »
2014-02-25 Status line trimming
73 if len(trimmed) == 0
74 return ""
75 else
3d8fa65e »
2014-06-08 More personal tweaks
76 return '(' . trimmed[0:10] . ')'
05a9c944 »
2014-02-25 Status line trimming
77 endif
78 endfunction
79
451f244f » Derek Wyatt
2011-07-05 first commit
80 " Set the status line the way i like it
05a9c944 »
2014-02-25 Status line trimming
81 set stl=%f\ %m\ %r%{DerekFugitiveStatusLine()}\ Line:%l/%L[%p%%]\ Col:%v\ Buf:#%n\ [%b][0x%B]
451f244f » Derek Wyatt
2011-07-05 first commit
82
83 " tell VIM to always put a status line in, even if there is only one window
84 set laststatus=2
85
86 " Don't update the display while executing macros
87 set lazyredraw
88
756f90cb » Andrew Sim
2014-04-13 minor typo in vimrc's comment
89 " Don't show the current command in the lower right corner. In OSX, if this is
451f244f » Derek Wyatt
2011-07-05 first commit
90 " set and lazyredraw is set then it's slow as molasses, so we unset this
91 set showcmd
92
93 " Show the current mode
94 set showmode
95
96 " Switch on syntax highlighting.
97 syntax on
98
99 " Hide the mouse pointer while typing
100 set mousehide
101
102 " Set up the gui cursor to look nice
103 set guicursor=n-v-c:block-Cursor-blinkon0,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver25-Cursor,r-cr:hor20-Cursor,sm:block-Cursor-blinkwait175-blinkoff150-blinkon175
104
105 " set the gui options the way I like
106 set guioptions=acg
107
108 " Setting this below makes it sow that error messages don't disappear after one second on startup.
109 "set debug=msg
110
111 " This is the timeout used while waiting for user input on a multi-keyed macro
112 " or while just sitting and waiting for another key to be pressed measured
113 " in milliseconds.
114 "
115 " i.e. for the ",d" command, there is a "timeoutlen" wait period between the
116 " "," key and the "d" key. If the "d" key isn't pressed before the
117 " timeout expires, one of two things happens: The "," command is executed
118 " if there is one (which there isn't) or the command aborts.
119 set timeoutlen=500
120
121 " Keep some stuff in the history
122 set history=100
123
124 " These commands open folds
125 set foldopen=block,insert,jump,mark,percent,quickfix,search,tag,undo
126
127 " When the page starts to scroll, keep the cursor 8 lines from the top and 8
128 " lines from the bottom
129 set scrolloff=8
130
131 " Allow the cursor to go in to "invalid" places
132 set virtualedit=all
133
134 " Disable encryption (:X)
135 set key=
136
137 " Make the command-line completion better
138 set wildmenu
139
140 " Same as default except that I remove the 'u' option
141 set complete=.,w,b,t
142
143 " When completing by tag, show the whole tag, not just the function name
144 set showfulltag
145
146 " Set the textwidth to be 80 chars
147 set textwidth=80
148
149 " get rid of the silly characters in separators
150 set fillchars = ""
151
152 " Add ignorance of whitespace to diff
153 set diffopt+=iwhite
154
155 " Enable search highlighting
156 set hlsearch
157
158 " Incrementally match the search
159 set incsearch
160
161 " Add the unnamed register to the clipboard
162 set clipboard+=unnamed
163
164 " Automatically read a file that has changed on disk
165 set autoread
166
167 set grepprg=grep\ -nH\ $*
168
56df4f3a » Derek Wyatt
2011-08-29 Added a bunch of bundles of Marc Weber's in preparation for ENSIME
169 " Trying out the line numbering thing... never liked it, but that doesn't mean
170 " I shouldn't give it another go :)
171 set relativenumber
172
c02aeedf »
2013-11-30 Configurations for CtrlP
173 " Types of files to ignore when autocompleting things
174 set wildignore+=*.o,*.class,*.git,*.svn
175
ab9009b7 »
2013-12-30 ambiwidth=double shows unicode properly!
176 " Various characters are "wider" than normal fixed width characters, but the
177 " default setting of ambiwidth (single) squeezes them into "normal" width, which
178 " sucks. Setting it to double makes it awesome.
179 set ambiwidth=double
180
cbc9a0d6 »
2014-01-01 Miscellanous updates
181 " OK, so I'm gonna remove the VIM safety net for a while and see if kicks my ass
182 set nobackup
183 set nowritebackup
184 set noswapfile
185
451f244f » Derek Wyatt
2011-07-05 first commit
186 " dictionary for english words
187 " I don't actually use this much at all and it makes my life difficult in general
188 "set dictionary=$VIM/words.txt
189
190 " Let the syntax highlighting for Java files allow cpp keywords
191 let java_allow_cpp_keywords = 1
192
5325a331 »
2013-11-28 Updates to handle migration to vim-metafuz
193 " I don't want to have the default keymappings for my scala plugin evaluated
194 let g:scala_use_default_keymappings = 0
195
451f244f » Derek Wyatt
2011-07-05 first commit
196 " System default for mappings is now the "," character
197 let mapleader = ","
198
199 " Wipe out all buffers
200 nmap <silent> ,wa :1,9000bwipeout<cr>
201
202 " Toggle paste mode
203 nmap <silent> ,p :set invpaste<CR>:set paste?<CR>
204
205 " cd to the directory containing the file in the buffer
206 nmap <silent> ,cd :lcd %:h<CR>
254dd74e »
2014-02-08 Changed some settings for my new gig
207 nmap <silent> ,cr :lcd <c-r>=FindGitDirOrRoot()<cr><cr>
451f244f » Derek Wyatt
2011-07-05 first commit
208 nmap <silent> ,md :!mkdir -p %:p:h<CR>
209
210 " Turn off that stupid highlight search
211 nmap <silent> ,n :nohls<CR>
212
213 " put the vim directives for my file editing settings in
214 nmap <silent> ,vi ovim:set ts=2 sts=2 sw=2:<CR>vim600:fdm=marker fdl=1 fdc=0:<ESC>
215
216 " The following beast is something i didn't write... it will return the
217 " syntax highlighting group that the current "thing" under the cursor
218 " belongs to -- very useful for figuring out what to change as far as
219 " syntax highlighting goes.
220 nmap <silent> ,qq :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
221
222 " Make shift-insert work like in Xterm
223 map <S-Insert> <MiddleMouse>
224 map! <S-Insert> <MiddleMouse>
225
226 " set text wrapping toggles
3d8fa65e »
2014-06-08 More personal tweaks
227 nmap <silent> ,ww :set invwrap<cr>
228 nmap <silent> ,wW :windo set invwrap<cr>
451f244f » Derek Wyatt
2011-07-05 first commit
229
230 " allow command line editing like emacs
231 cnoremap <C-A> <Home>
232 cnoremap <C-B> <Left>
233 cnoremap <C-E> <End>
234 cnoremap <C-F> <Right>
235 cnoremap <C-N> <End>
236 cnoremap <C-P> <Up>
237 cnoremap <ESC>b <S-Left>
238 cnoremap <ESC><C-B> <S-Left>
239 cnoremap <ESC>f <S-Right>
240 cnoremap <ESC><C-F> <S-Right>
241 cnoremap <ESC><C-H> <C-W>
242
243 " Maps to make handling windows a bit easier
244 "noremap <silent> ,h :wincmd h<CR>
245 "noremap <silent> ,j :wincmd j<CR>
246 "noremap <silent> ,k :wincmd k<CR>
247 "noremap <silent> ,l :wincmd l<CR>
248 "noremap <silent> ,sb :wincmd p<CR>
249 noremap <silent> <C-F9> :vertical resize -10<CR>
250 noremap <silent> <C-F10> :resize +10<CR>
251 noremap <silent> <C-F11> :resize -10<CR>
252 noremap <silent> <C-F12> :vertical resize +10<CR>
253 noremap <silent> ,s8 :vertical resize 83<CR>
254 noremap <silent> ,cj :wincmd j<CR>:close<CR>
255 noremap <silent> ,ck :wincmd k<CR>:close<CR>
256 noremap <silent> ,ch :wincmd h<CR>:close<CR>
257 noremap <silent> ,cl :wincmd l<CR>:close<CR>
258 noremap <silent> ,cc :close<CR>
259 noremap <silent> ,cw :cclose<CR>
260 noremap <silent> ,ml <C-W>L
261 noremap <silent> ,mk <C-W>K
262 noremap <silent> ,mh <C-W>H
263 noremap <silent> ,mj <C-W>J
264 noremap <silent> <C-7> <C-W>>
265 noremap <silent> <C-8> <C-W>+
266 noremap <silent> <C-9> <C-W>+
267 noremap <silent> <C-0> <C-W>>
268
269 " Edit the vimrc file
270 nmap <silent> ,ev :e $MYVIMRC<CR>
271 nmap <silent> ,sv :so $MYVIMRC<CR>
272
273 " Make horizontal scrolling easier
274 nmap <silent> <C-o> 10zl
275 nmap <silent> <C-i> 10zh
276
277 " Add a GUID to the current line
278 imap <C-J>d <C-r>=substitute(system("uuidgen"), '.$', '', 'g')<CR>
279
280 " Toggle fullscreen mode
281 nmap <silent> <F3> :call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<CR>
282
283 " Underline the current line with '='
16c4e682 »
2012-01-18 GPG stuff for the mac, better maps for doing my underlining, ditched …
284 nmap <silent> ,u= :t.\|s/./=/g\|:nohls<cr>
285 nmap <silent> ,u- :t.\|s/./-/g\|:nohls<cr>
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
286 nmap <silent> ,u~ :t.\|s/./\\~/g\|:nohls<cr>
451f244f » Derek Wyatt
2011-07-05 first commit
287
288 " Shrink the current window to fit the number of lines in the buffer. Useful
289 " for those buffers that are only a few lines
290 nmap <silent> ,sw :execute ":resize " . line('$')<cr>
291
292 " Use the bufkill plugin to eliminate a buffer but keep the window layout
293 nmap ,bd :BD<cr>
294
295 " Use CTRL-E to replace the original ',' mapping
296 nnoremap <C-E> ,
297
61232c8e »
2011-08-11 Trying out the 'imap jj <esc>' mapping that I've seen a lot of people…
298 " Alright... let's try this out
299 imap jj <esc>
bb62ce2a »
2012-09-17 Many changes in the new job
300 cmap jj <esc>
61232c8e »
2011-08-11 Trying out the 'imap jj <esc>' mapping that I've seen a lot of people…
301
22af5127 » Derek Wyatt
2012-02-10 Inserting of the filename has been somewhat useful. gonna keep it for…
302 " I like jj - Let's try something else fun
303 imap ,fn <c-r>=expand('%:t:r')<cr>
304
9db6c666 » Derek Wyatt
2011-09-08 Added the ultra-cool 'clear text op-pending command'. Awesome.
305 " Clear the text using a motion / text object and then move the character to the
306 " next word
307 nmap <silent> ,C :set opfunc=ClearText<CR>g@
308 vmap <silent> ,C :<C-U>call ClearText(visual(), 1)<CR>
309
083691b5 » Derek Wyatt
2012-01-17 Lots of little updates. Most notably, as of late, added some maps to …
310 " Make the current file executable
311 nmap ,x :w<cr>:!chmod 755 %<cr>:e<cr>
312
313 " Digraphs
314 " Alpha
315 imap <c-l><c-a> <c-k>a*
316 " Beta
317 imap <c-l><c-b> <c-k>b*
318 " Gamma
319 imap <c-l><c-g> <c-k>g*
320 " Delta
321 imap <c-l><c-d> <c-k>d*
322 " Epslion
323 imap <c-l><c-e> <c-k>e*
324 " Lambda
325 imap <c-l><c-l> <c-k>l*
326 " Eta
327 imap <c-l><c-y> <c-k>y*
328 " Theta
329 imap <c-l><c-h> <c-k>h*
330 " Mu
331 imap <c-l><c-m> <c-k>m*
332 " Rho
333 imap <c-l><c-r> <c-k>r*
334 " Pi
335 imap <c-l><c-p> <c-k>p*
336 " Phi
337 imap <c-l><c-f> <c-k>f*
338
9db6c666 » Derek Wyatt
2011-09-08 Added the ultra-cool 'clear text op-pending command'. Awesome.
339 function! ClearText(type, ...)
340 let sel_save = &selection
341 let &selection = "inclusive"
342 let reg_save = @@
343 if a:0 " Invoked from Visual mode, use '< and '> marks
344 silent exe "normal! '<" . a:type . "'>r w"
345 elseif a:type == 'line'
346 silent exe "normal! '[V']r w"
347 elseif a:type == 'line'
348 silent exe "normal! '[V']r w"
349 elseif a:type == 'block'
350 silent exe "normal! `[\<C-V>`]r w"
351 else
352 silent exe "normal! `[v`]r w"
353 endif
354 let &selection = sel_save
355 let @@ = reg_save
356 endfunction
357
451f244f » Derek Wyatt
2011-07-05 first commit
358 " Syntax coloring lines that are too long just slows down the world
359 set synmaxcol=2048
360
361 " I don't like it when the matching parens are automatically highlighted
362 let loaded_matchparen = 1
363
364 " Highlight the current line and column
365 " Don't do this - It makes window redraws painfully slow
366 set nocursorline
367 set nocursorcolumn
368
3d8fa65e »
2014-06-08 More personal tweaks
369 if has("mac")
370 let g:main_font = "Anonymous\\ Pro:h11"
c781e933 » Derek Wyatt
2011-12-31 I rebuilt my mac recently and when I put the files back, git told me …
371 let g:small_font = "Anonymous\\ Pro:h2"
5c8178b6 »
2011-07-05 There were some immediate problems trying to get this thing working o…
372 else
b8e0ff9c »
2012-11-21 Some changes for working with Java (ugh).
373 let g:main_font = "DejaVu\\ Sans\\ Mono\\ 9"
578cbfd4 » Derek Wyatt
2012-05-16 Enhanced the scala stuff so that it works better with a Play repository.
374 let g:small_font = "DejaVu\\ Sans\\ Mono\\ 2"
5c8178b6 »
2011-07-05 There were some immediate problems trying to get this thing working o…
375 endif
376
451f244f » Derek Wyatt
2011-07-05 first commit
377 "-----------------------------------------------------------------------------
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
378 " Fugitive
451f244f » Derek Wyatt
2011-07-05 first commit
379 "-----------------------------------------------------------------------------
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
380 " Thanks to Drew Neil
381 autocmd User fugitive
382 \ if fugitive#buffer().type() =~# '^\%(tree\|blob\)$' |
383 \ noremap <buffer> .. :edit %:h<cr> |
384 \ endif
385 autocmd BufReadPost fugitive://* set bufhidden=delete
451f244f » Derek Wyatt
2011-07-05 first commit
386
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
387 nmap ,gs :Gstatus<cr>
388 nmap ,ge :Gedit<cr>
389 nmap ,gw :Gwrite<cr>
390 nmap ,gr :Gread<cr>
451f244f » Derek Wyatt
2011-07-05 first commit
391
392 "-----------------------------------------------------------------------------
393 " NERD Tree Plugin Settings
394 "-----------------------------------------------------------------------------
395 " Toggle the NERD Tree on an off with F7
396 nmap <F7> :NERDTreeToggle<CR>
397
398 " Close the NERD Tree with Shift-F7
399 nmap <S-F7> :NERDTreeClose<CR>
400
401 " Show the bookmarks table on startup
402 let NERDTreeShowBookmarks=1
403
404 " Don't display these kinds of files
405 let NERDTreeIgnore=[ '\.ncb$', '\.suo$', '\.vcproj\.RIMNET', '\.obj$',
406 \ '\.ilk$', '^BuildLog.htm$', '\.pdb$', '\.idb$',
407 \ '\.embed\.manifest$', '\.embed\.manifest.res$',
408 \ '\.intermediate\.manifest$', '^mt.dep$' ]
409
410 "-----------------------------------------------------------------------------
16c4e682 »
2012-01-18 GPG stuff for the mac, better maps for doing my underlining, ditched …
411 " GPG Stuff
412 "-----------------------------------------------------------------------------
413 if has("mac")
414 let g:GPGExecutable = "gpg2"
415 let g:GPGUseAgent = 0
416 endif
417
418 "-----------------------------------------------------------------------------
5994a135 » Derek Wyatt
2014-02-15 Customizations for AG and Quickfix
419 " AG (SilverSearcher) Settings
714f4d04 »
2013-08-16 Simple updates to help with my workflow
420 "-----------------------------------------------------------------------------
15a2bae0 »
2014-02-24 Updates after modifying my fork of the AG plugin
421 nmap ,sf :AgForCurrentFileDir
422 nmap ,sr :AgForProjectRoot
1c659633 »
2014-02-24 Small mapping to work with my vim-ag fork
423 nmap ,se :AgForExtension
05a9c944 »
2014-02-25 Status line trimming
424 let g:ag_results_mapping_replacements = {
15a2bae0 »
2014-02-24 Updates after modifying my fork of the AG plugin
425 \ 'open_and_close': '<cr>',
426 \ 'open': 'o',
427 \ }
714f4d04 »
2013-08-16 Simple updates to help with my workflow
428
429 "-----------------------------------------------------------------------------
451f244f » Derek Wyatt
2011-07-05 first commit
430 " FSwitch mappings
431 "-----------------------------------------------------------------------------
432 nmap <silent> ,of :FSHere<CR>
433 nmap <silent> ,ol :FSRight<CR>
434 nmap <silent> ,oL :FSSplitRight<CR>
435 nmap <silent> ,oh :FSLeft<CR>
436 nmap <silent> ,oH :FSSplitLeft<CR>
437 nmap <silent> ,ok :FSAbove<CR>
438 nmap <silent> ,oK :FSSplitAbove<CR>
439 nmap <silent> ,oj :FSBelow<CR>
440 nmap <silent> ,oJ :FSSplitBelow<CR>
441
442 "-----------------------------------------------------------------------------
443 " XPTemplate settings
444 "-----------------------------------------------------------------------------
445 let g:xptemplate_brace_complete = ''
446
447 "-----------------------------------------------------------------------------
448 " TwitVim settings
449 "-----------------------------------------------------------------------------
450 let twitvim_enable_perl = 1
451 let twitvim_browser_cmd = 'firefox'
452 nmap ,tw :FriendsTwitter<cr>
453 nmap ,tm :UserTwitter<cr>
454 nmap ,tM :MentionsTwitter<cr>
455 function! TwitVimMappings()
456 nmap <buffer> U :exe ":UnfollowTwitter " . expand("<cword>")<cr>
457 nmap <buffer> F :exe ":FollowTwitter " . expand("<cword>")<cr>
c07a5915 » Derek Wyatt
2011-07-05 Cleanups of the old cruft nonsense stuff.
458 nmap <buffer> 7 :BackTwitter<cr>
459 nmap <buffer> 8 :ForwardTwitter<cr>
451f244f » Derek Wyatt
2011-07-05 first commit
460 nmap <buffer> 1 :PreviousTwitter<cr>
461 nmap <buffer> 2 :NextTwitter<cr>
462 endfunction
463 augroup derek_twitvim
464 au!
465 au FileType twitvim call TwitVimMappings()
466 augroup END
467
468 "-----------------------------------------------------------------------------
469 " VimSokoban settings
470 "-----------------------------------------------------------------------------
b1046ee2 » Derek Wyatt
2011-07-15 A tiny bit of cleanup... most major thing is get Sokoban working agai…
471 " Sokoban stuff
472 let g:SokobanLevelDirectory = "/home/dwyatt/.vim/bundle/vim-sokoban/VimSokoban/"
451f244f » Derek Wyatt
2011-07-05 first commit
473
474 "-----------------------------------------------------------------------------
475 " FuzzyFinder Settings
476 "-----------------------------------------------------------------------------
b8e0ff9c »
2012-11-21 Some changes for working with Java (ugh).
477 let g:fuf_splitPathMatching = 1
37003629 » Derek Wyatt
2012-02-06 Finally got around to changing some defaults on FuzzyFinder that were…
478 let g:fuf_maxMenuWidth = 110
479 let g:fuf_timeFormat = ''
b1046ee2 » Derek Wyatt
2011-07-15 A tiny bit of cleanup... most major thing is get Sokoban working agai…
480 nmap <silent> ,fv :FufFile ~/.vim/<cr>
451f244f » Derek Wyatt
2011-07-05 first commit
481 nmap <silent> ,fc :FufMruCmd<cr>
482 nmap <silent> ,fm :FufMruFile<cr>
bb62ce2a »
2012-09-17 Many changes in the new job
483
484 let g:CommandTMatchWindowAtTop = 1
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
485 let g:make_scala_fuf_mappings = 0
b8e0ff9c »
2012-11-21 Some changes for working with Java (ugh).
486
487 "-----------------------------------------------------------------------------
c02aeedf »
2013-11-30 Configurations for CtrlP
488 " CtrlP Settings
489 "-----------------------------------------------------------------------------
490 let g:ctrlp_switch_buffer = 'E'
491 let g:ctrlp_tabpage_position = 'c'
492 let g:ctrlp_working_path_mode = 'rc'
493 let g:ctrlp_root_markers = ['.project.root']
ee6c375a »
2014-02-16 Letting CtrlP see more stuff
494 let g:ctrlp_custom_ignore = '\v%(/\.%(git|hg|svn)|\.%(class|o|png|jpg|jpeg|bmp|tar|jar|tgz|deb|zip)$|/target/%(quickfix|resolution-cache|streams)|/target/scala-2.10/%(classes|test-classes|sbt-0.13|cache)|/project/target|/project/project)'
c02aeedf »
2013-11-30 Configurations for CtrlP
495 let g:ctrlp_open_new_file = 'r'
496 let g:ctrlp_open_multiple_files = '1ri'
c59c0c25 »
2014-01-02 Updates for CtrlP
497 let g:ctrlp_match_window = 'max:40'
7d44bbc6 »
2013-12-02 Continuing migration to CtrlP
498 let g:ctrlp_prompt_mappings = {
499 \ 'PrtSelectMove("j")': ['<c-n>'],
500 \ 'PrtSelectMove("k")': ['<c-p>'],
501 \ 'PrtHistory(-1)': ['<c-j>', '<down>'],
502 \ 'PrtHistory(1)': ['<c-i>', '<up>']
503 \ }
3d8fa65e »
2014-06-08 More personal tweaks
504 nmap ,fb :CtrlPBuffer<cr>
505 nmap ,ff :CtrlP .<cr>
506 nmap ,fF :execute ":CtrlP " . expand('%:p:h')<cr>
507 nmap ,fr :CtrlP<cr>
508 nmap ,fm :CtrlPMixed<cr>
451f244f » Derek Wyatt
2011-07-05 first commit
509
510 "-----------------------------------------------------------------------------
27043da6 » Derek Wyatt
2011-10-31 Added some helpers for graphviz and tex in the XPTemplate configurati…
511 " Gundo Settings
512 "-----------------------------------------------------------------------------
513 nmap <c-F5> :GundoToggle<cr>
514
515 "-----------------------------------------------------------------------------
516 " Conque Settings
517 "-----------------------------------------------------------------------------
518 let g:ConqueTerm_FastMode = 1
519 let g:ConqueTerm_ReadUnfocused = 1
520 let g:ConqueTerm_InsertOnEnter = 1
521 let g:ConqueTerm_PromptRegex = '^-->'
522 let g:ConqueTerm_TERM = 'xterm'
523
524 "-----------------------------------------------------------------------------
451f244f » Derek Wyatt
2011-07-05 first commit
525 " Functions
526 "-----------------------------------------------------------------------------
527 if !exists('g:bufferJumpList')
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
528 let g:bufferJumpList = {}
451f244f » Derek Wyatt
2011-07-05 first commit
529 endif
530
531 function! MarkBufferInJumpList(bufstr, letter)
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
532 let g:bufferJumpList[a:letter] = a:bufstr
451f244f » Derek Wyatt
2011-07-05 first commit
533 endfunction
534
535 function! JumpToBufferInJumpList(letter)
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
536 if has_key(g:bufferJumpList, a:letter)
537 exe ":buffer " . g:bufferJumpList[a:letter]
538 else
539 echoerr a:letter . " isn't mapped to any existing buffer"
540 endif
451f244f » Derek Wyatt
2011-07-05 first commit
541 endfunction
542
543 function! ListJumpToBuffers()
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
544 for key in keys(g:bufferJumpList)
545 echo key . " = " . g:bufferJumpList[key]
546 endfor
451f244f » Derek Wyatt
2011-07-05 first commit
547 endfunction
548
549 function! IndentToNextBraceInLineAbove()
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
550 :normal 0wk
551 :normal "vyf(
552 let @v = substitute(@v, '.', ' ', 'g')
553 :normal j"vPl
451f244f » Derek Wyatt
2011-07-05 first commit
554 endfunction
555
254dd74e »
2014-02-08 Changed some settings for my new gig
556 function! FindGitDirOrRoot()
557 let curdir = expand('%:p:h')
558 let gitdir = finddir('.git', curdir . ';')
559 if gitdir != ''
560 return substitute(gitdir, '\/\.git$', '', '')
561 else
562 return '/'
563 endif
564 endfunction
565
451f244f » Derek Wyatt
2011-07-05 first commit
566 nmap <silent> ,ii :call IndentToNextBraceInLineAbove()<cr>
567
568 nmap <silent> ,mba :call MarkBufferInJumpList(expand('%:p'), 'a')<cr>
569 nmap <silent> ,mbb :call MarkBufferInJumpList(expand('%:p'), 'b')<cr>
570 nmap <silent> ,mbc :call MarkBufferInJumpList(expand('%:p'), 'c')<cr>
571 nmap <silent> ,mbd :call MarkBufferInJumpList(expand('%:p'), 'd')<cr>
572 nmap <silent> ,mbe :call MarkBufferInJumpList(expand('%:p'), 'e')<cr>
573 nmap <silent> ,mbf :call MarkBufferInJumpList(expand('%:p'), 'f')<cr>
574 nmap <silent> ,mbg :call MarkBufferInJumpList(expand('%:p'), 'g')<cr>
575 nmap <silent> ,jba :call JumpToBufferInJumpList('a')<cr>
576 nmap <silent> ,jbb :call JumpToBufferInJumpList('b')<cr>
577 nmap <silent> ,jbc :call JumpToBufferInJumpList('c')<cr>
578 nmap <silent> ,jbd :call JumpToBufferInJumpList('d')<cr>
579 nmap <silent> ,jbe :call JumpToBufferInJumpList('e')<cr>
580 nmap <silent> ,jbf :call JumpToBufferInJumpList('f')<cr>
581 nmap <silent> ,jbg :call JumpToBufferInJumpList('g')<cr>
582 nmap <silent> ,ljb :call ListJumpToBuffers()<cr>
583
584 function! DiffCurrentFileAgainstAnother(snipoff, replacewith)
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
585 let currentFile = expand('%:p')
586 let otherfile = substitute(currentFile, "^" . a:snipoff, a:replacewith, '')
587 only
588 execute "vertical diffsplit " . otherfile
451f244f » Derek Wyatt
2011-07-05 first commit
589 endfunction
590
591 command! -nargs=+ DiffCurrent call DiffCurrentFileAgainstAnother(<f-args>)
592
593 function! RunSystemCall(systemcall)
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
594 let output = system(a:systemcall)
595 let output = substitute(output, "\n", '', 'g')
596 return output
451f244f » Derek Wyatt
2011-07-05 first commit
597 endfunction
598
599 function! HighlightAllOfWord(onoff)
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
600 if a:onoff == 1
601 :augroup highlight_all
602 :au!
603 :au CursorMoved * silent! exe printf('match Search /\<%s\>/', expand('<cword>'))
604 :augroup END
605 else
606 :au! highlight_all
607 match none /\<%s\>/
608 endif
451f244f » Derek Wyatt
2011-07-05 first commit
609 endfunction
610
611 :nmap ,ha :call HighlightAllOfWord(1)<cr>
612 :nmap ,hA :call HighlightAllOfWord(0)<cr>
613
614 function! LengthenCWD()
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
615 let cwd = getcwd()
616 if cwd == '/'
617 return
618 endif
619 let lengthend = substitute(cwd, '/[^/]*$', '', '')
620 if lengthend == ''
621 let lengthend = '/'
622 endif
623 if cwd != lengthend
624 exec ":lcd " . lengthend
625 endif
451f244f » Derek Wyatt
2011-07-05 first commit
626 endfunction
627
628 :nmap ,ld :call LengthenCWD()<cr>
629
630 function! ShortenCWD()
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
631 let cwd = split(getcwd(), '/')
632 let filedir = split(expand("%:p:h"), '/')
633 let i = 0
634 let newdir = ""
635 while i < len(filedir)
636 let newdir = newdir . "/" . filedir[i]
637 if len(cwd) == i || filedir[i] != cwd[i]
638 break
639 endif
640 let i = i + 1
641 endwhile
642 exec ":lcd /" . newdir
451f244f » Derek Wyatt
2011-07-05 first commit
643 endfunction
644
645 :nmap ,sd :call ShortenCWD()<cr>
646
647 function! RedirToYankRegisterF(cmd, ...)
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
648 let cmd = a:cmd . " " . join(a:000, " ")
649 redir @*>
650 exe cmd
651 redir END
451f244f » Derek Wyatt
2011-07-05 first commit
652 endfunction
653
654 command! -complete=command -nargs=+ RedirToYankRegister
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
655 \ silent! call RedirToYankRegisterF(<f-args>)
451f244f » Derek Wyatt
2011-07-05 first commit
656
657 function! ToggleMinimap()
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
658 if exists("s:isMini") && s:isMini == 0
659 let s:isMini = 1
660 else
661 let s:isMini = 0
662 end
663
664 if (s:isMini == 0)
665 " save current visible lines
666 let s:firstLine = line("w0")
667 let s:lastLine = line("w$")
668
669 " make font small
670 exe "set guifont=" . g:small_font
671 " highlight lines which were visible
672 let s:lines = ""
673 for i in range(s:firstLine, s:lastLine)
674 let s:lines = s:lines . "\\%" . i . "l"
675
676 if i < s:lastLine
677 let s:lines = s:lines . "\\|"
678 endif
679 endfor
680
681 exe 'match Visible /' . s:lines . '/'
682 hi Visible guibg=lightblue guifg=black term=bold
683 nmap <s-j> 10j
684 nmap <s-k> 10k
685 else
686 exe "set guifont=" . g:main_font
687 hi clear Visible
688 nunmap <s-j>
689 nunmap <s-k>
690 endif
451f244f » Derek Wyatt
2011-07-05 first commit
691 endfunction
692
693 command! ToggleMinimap call ToggleMinimap()
7ae913cd »
2012-02-25 Got rid of stupid Minimap toggle. Fixed up some stuff in my templates…
694
695 " I /literally/ never use this and it's pissing me off
696 " nnoremap <space> :ToggleMinimap<CR>
451f244f » Derek Wyatt
2011-07-05 first commit
697
698 "-----------------------------------------------------------------------------
699 " Commands
700 "-----------------------------------------------------------------------------
701 function! FreemindToListF()
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
702 setl filetype=
703 silent! :%s/^\(\s*\).*TEXT="\([^"]*\)".*$/\1- \2/
704 silent! :g/^\s*</d
705 silent! :%s/&quot;/"/g
706 silent! :%s/&apos;/\'/g
707 silent! g/^-/s/- //
708 silent! g/^\w/t.|s/./=/g
709 silent! g/^\s*-/normal O
710 silent! normal 3GgqG
711 silent! %s/^\s\{4}\zs-/o/
712 silent! %s/^\s\{12}\zs-/+/
713 silent! %s/^\s\{16}\zs-/*/
714 silent! %s/^\s\{20}\zs-/#/
715 silent! normal gg
451f244f » Derek Wyatt
2011-07-05 first commit
716 endfunction
717
718 command! FreemindToList call FreemindToListF()
719
720 "-----------------------------------------------------------------------------
721 " Auto commands
722 "-----------------------------------------------------------------------------
723 augroup derek_xsd
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
724 au!
725 au BufEnter *.xsd,*.wsdl,*.xml setl tabstop=4 shiftwidth=4
726 au BufEnter *.xsd,*.wsdl,*.xml setl formatoptions=crq textwidth=120 colorcolumn=120
451f244f » Derek Wyatt
2011-07-05 first commit
727 augroup END
728
729 augroup Binary
730 au!
731 au BufReadPre *.bin let &bin=1
732 au BufReadPost *.bin if &bin | %!xxd
733 au BufReadPost *.bin set filetype=xxd | endif
734 au BufWritePre *.bin if &bin | %!xxd -r
735 au BufWritePre *.bin endif
736 au BufWritePost *.bin if &bin | %!xxd
737 au BufWritePost *.bin set nomod | endif
738 augroup END
739
740
741 "-----------------------------------------------------------------------------
742 " Fix constant spelling mistakes
743 "-----------------------------------------------------------------------------
744
d612adf4 »
2012-04-25 Enhancements for working with latex files
745 iab Acheive Achieve
746 iab acheive achieve
747 iab Alos Also
748 iab alos also
749 iab Aslo Also
750 iab aslo also
751 iab Becuase Because
752 iab becuase because
753 iab Bianries Binaries
754 iab bianries binaries
755 iab Bianry Binary
756 iab bianry binary
757 iab Charcter Character
758 iab charcter character
759 iab Charcters Characters
760 iab charcters characters
761 iab Exmaple Example
762 iab exmaple example
763 iab Exmaples Examples
764 iab exmaples examples
765 iab Fone Phone
766 iab fone phone
767 iab Lifecycle Life-cycle
768 iab lifecycle life-cycle
769 iab Lifecycles Life-cycles
770 iab lifecycles life-cycles
771 iab Seperate Separate
772 iab seperate separate
773 iab Seureth Suereth
774 iab seureth suereth
775 iab Shoudl Should
776 iab shoudl should
777 iab Taht That
778 iab taht that
779 iab Teh The
780 iab teh the
451f244f » Derek Wyatt
2011-07-05 first commit
781
782 "-----------------------------------------------------------------------------
783 " Set up the window colors and size
784 "-----------------------------------------------------------------------------
785 if has("gui_running")
5c8178b6 »
2011-07-05 There were some immediate problems trying to get this thing working o…
786 exe "set guifont=" . g:main_font
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
787 colorscheme xoria256
451f244f » Derek Wyatt
2011-07-05 first commit
788 if !exists("g:vimrcloaded")
2132cca5 »
2013-07-05 Lots of updates... the most important ones being those related to fuz…
789 winpos 0 0
790 if !&diff
791 winsize 130 120
792 else
793 winsize 227 120
794 endif
795 let g:vimrcloaded = 1
451f244f » Derek Wyatt
2011-07-05 first commit
796 endif
797 endif
798 :nohls
Something went wrong with that request. Please try again.