-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
executable file
·850 lines (691 loc) · 24 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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
"-------------------------------------------------------------
"Vundle plugin
"-------------------------------------------------------------
set nocompatible "turn off vi compatibility, required for vundle"
filetype off
set rtp+=~/.vim/vundle/
call vundle#rc()"
" colors
Bundle 'nanotech/jellybeans.vim.git'
Bundle 'sjl/badwolf'
Bundle 'godlygeek/csapprox'
"-----------------------------------------------------------------------------
" Set up the window colors and size
"-----------------------------------------------------------------------------
"Alt key
if has("gui_mac")
set macmeta
endif
if has('gui_running')
" GUI colors
"colorscheme jellybeans
" colorscheme jellybeans_locojay
colorscheme badwolf
"set guifont=Monaco:h12
set guifont=PragmataPro:h15
set guioptions=egmrt
set guioptions-=T
winpos 0 0
winsize 270 70
set go-=L
set go-=r
elseif $TERM == "xterm-256color" || $TERM == "screen-256color"
" Non-GUI (terminal) colors
set t_Co=256
"colorscheme jellybeans
" colorscheme jellybeans_locojay
colorscheme badwolf
"set guifont=Monaco:h12
set guifont=PragmataPro:h15
set lazyredraw
endif
"-------------------------------------------------------------
"Vim Settings
"-------------------------------------------------------------
let mapleader=","
"save a keypress
map ; :
set encoding=utf-8
set fillchars+=vert:│
" Set backspace config
set backspace=eol,start,indent
set showbreak=↪
"shut up
set visualbell " don't beep
set noerrorbells " don't beep
"Motion Settings
ino jj <esc>
cno jj <esc>
"visual
vnoremap < <gv
vnoremap > >gv
"got to middle of the line (vimbits.com)
nnoremap gm :call cursor(0, len(getline('.'))/2)<cr>
"show invisible shars
set list
set listchars=tab:▸\ ,eol:¬
set cpoptions+=$
"add line numbers
set number
function! ToggleRelativeNumber()
if &nu == 1
set rnu
else
set nu
endif
endfunction
command! Rn call ToggleRelativeNumber()
syntax on
filetype plugin on
filetype indent on
set noswapfile
" Mouse Support
"add mouse support
set mouse=a
"let this work in tmux 2
set ttymouse=xterm2
" Clipboad and Pasting
"add to clipbord
set clipboard+=unnamed
"paste mode
"nnoremap <F5> :set invpaste paste?<CR>
"set pastetoggle=<F5>
set showmode
"auto paste in paste mode
imap <Leader>v <C-O>:set paste<CR><C-r>*<C-O>:set nopaste<CR>
" tell VIM to always put a status line in, even if there is only one window
set laststatus=2
"keep a longer history
set history=1000
"Completion
set wildmode=longest:full
set wildmenu
set completeopt=menu,preview
"autoclose preview window
if has("autocmd")
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
endif
"omnifocus as constrol space
inoremap <expr> <C-Space> pumvisible() \|\| &omnifunc == '' ?
\ "\<lt>C-n>" :
\ "\<lt>C-x>\<lt>C-o><c-r>=pumvisible() ?" .
\ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
\ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
imap <C-@> <C-Space>
" Buffer commands
set hidden "Allows to change buffer w/o saving current buffer
Bundle 'orftz/sbd.vim'
"Bundle 'vim-scripts/bufkill.vim'
"noremap <silent><Leader>bd :bd<CR>
nnoremap <silent><leader>bd :Sbd<CR>
"nnoremap <silent><leader>bdm :Sbdm<CR>
noremap <silent><Leader>bn :bn<CR>
noremap <silent><Leader>bp :bp<CR>
noremap <silent><Leader>ba :1,300 bd!<CR> "close all buffer
"Tab commands
noremap <silent> <Leader>tp :tabprevious<CR>
noremap <silent> <Leader>tn :tabnext<CR>
" vimrc
"nmap <silent> <Leader>ev :e $MYVIMRC<CR>
"nmap <silent> <Leader>sv :so $MYVIMRC<CR>
"above does not really work as symlink ( neocompcache ...)
nmap <silent> <Leader>ev :e $HOME/.dotfiles/vim/vimrc<CR>
nmap <silent> <Leader>sv :so $HOME/.dotfiles/vim/vimrc<CR>
" When pressing <leader>cd switch to the directory of the open buffer
map <silent><Leader>cd :cd %:p:h<CR>
set wildignore=*.swp,*.bak
set wildignore+=*/.svn/*,/*.hg/*,/*.git/* " Version control (not git as otherwise conflict with fugitive)
set wildignore+=*/.virtualenvs/*
set wildignore+=*.aux,*.out,*.toc " LaTeX stuff
set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg "Pics
set wildignore+=*.o,*.obj,*.pyc,*.class "compiled files, bytecode
set wildignore+=*.DS_Store
set wildignore+=*.pdf,*.xls,*.xlsx,*.doc
set wildignore+=*.jar
" Lein
set wildignore+=classes
set wildignore+=lib
"Move lines up and down
nnoremap <M-j> :m+<CR>==
nnoremap <M-k> :m-2<CR>==
inoremap <M-j><Esc> :m+<CR>==gi
inoremap <M-k><Esc> :m-2<CR>==gi
vnoremap <M-j> :m'>+<CR>gv=gv
vnoremap <M-k> :m-2<CR>gv=gv
"Windows Settings
" Move the cursor to the window left of the current one
noremap <silent><Leader>wh :wincmd h<cr>
" Move the cursor to the window below the current one
noremap <silent><Leader>wj :wincmd j<cr>
" Move the cursor to the window above the current one
noremap <silent><Leader>wk :wincmd k<cr>
" Move the cursor to the window right of the current one
noremap <silent><Leader>wl :wincmd l<cr>
noremap <silent><Leader>cj :wincmd j<CR>:close<CR>
noremap <silent><Leader>ck :wincmd k<CR>:close<CR>
noremap <silent><Leader>ch :wincmd h<CR>:close<CR>
noremap <silent><Leader>cl :wincmd l<CR>:close<CR>
noremap <silent><Leader>cc :wincmd c<CR>:close<CR>
noremap <silent><Leader>wr :wincmd r<CR>
noremap <silent><Leader>wo :wincmd o<CR>
noremap <silent><Leader>wx :wincmd x<CR>
noremap <silent><Leader>ww :wincmd w<CR>
noremap <silent><Leader>vs :vsplit <CR>
noremap <silent><Leader>hs :split <CR>
"Quickfix window Settings
"use vim -unimpaired
"noremap <silent> ,cn :cn<CR>
"noremap <silent> ,cp :cp<CR>
"location list
noremap <silent> <leader>lo :lopen<CR>
"Calculator
inoremap <C-B> <C-O>yiW<End>=<C-R>=<C-R>0<CR>
noremap <silent><leader>u :! urlview %<CR>
"Search Settings
nnoremap / /\v
vnoremap / /\v
set smartcase
set incsearch "search as you type
set gdefault "always /g
set ignorecase
set showmatch "show matching braces
set hlsearch
"replace word under cursor
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
map <silent><Leader><space> :noh<CR>
"Spell Checking
map <leader>ss :setlocal spell! spelllang=en_us<cr>
"-------------------------------------------------------------
"Folding
"-------------------------------------------------------------
" Javadoc comments (/** and */ pairs) and code sections (marked by {} pairs) mark the start and end of folds. All other
" lines simply take the fold level that is going so far.
function! MyFoldLevel( lineNumber )
let thisLine = getline( a:lineNumber )
" If the entire Javadoc comment or the {} pair is on one line, then don't create a fold for it.
if ( thisLine =~ '\%(\%(/\*\*\).*\%(\*/\)\)\|\%({.*}\)' )
return '='
elseif ( thisLine =~ '\%(^\s*/\*\*\s*$\)\|{' )
return "a1"
elseif ( thisLine =~ '\%(^\s*\*/\s*$\)\|}' )
return "s1"
endif
return '='
endfunction
"-------------------------------------------------------------
"Filetype Settings
"-------------------------------------------------------------
" Tabs, spaces, wrapping
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set wrap
set textwidth=85
set formatoptions=qrn1
if has("autocmd")
"All filetypes
"remove trailing whitespaces
autocmd BufWritePre * :%s/\s\+$//e
"Large files
autocmd BufReadPost * if getfsize(bufname("%")) > 512*1024 | set syntax=| set filetype=| endif
"Help
"help in vertical split
autocmd FileType help wincmd L
" R
autocmd FileType r setlocal ts=8 sts=4 sw=4 expandtab
"Html
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType htmldjango setlocal ts=2 sts=2 sw=2 expandtab
"Python
autocmd FileType python setlocal ts=8 sts=4 sw=4 expandtab
autocmd FileType python setlocal autoindent
"nose for unittest
autocmd FileType python compiler nose
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType python set formatprg=PythonTidy
if exists('+colorcolumn')
" autocmd FileType python set colorcolumn=80
endif
"Clojure"
" autocmd FileType clojure set ts=2 sts=2 sw=2 expandtab
autocmd FileType clojure compiler clojure
"clojurescript
autocmd BufNewFile,BufRead *.cljs set filetype=clojurescript
"
"Css
autocmd Filetype css set omnifunc=csscomplete#CompleteCSS
"Javascript
autocmd Filetype javascript setlocal ts=4 sts=4 sw=4 expandtab
autocmd BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
"Tex
autocmd FileType tex setlocal ts=8 sts=4 sw=4 expandtab
"Json
autocmd BufNewFile,BufRead *.json setfiletype json
"Processing
autocmd BufNewFile,BufRead *.pde setfiletype processing
"Pweave
autocmd BufNewFile,BufRead *.Pnw set filetype=python
"Objective-j
au BufNewFile,BufRead *.j setfiletype objc
au BufNewFile,BufRead *.j setlocal ts=8 sts=4 sw=4 expandtab
au BufNewFile,BufRead *.j setlocal foldexpr=MyFoldLevel(v:lnum)
au BufNewFile,BufRead *.j setlocal foldmethod=expr
"Java
au Filetype java setlocal foldexpr=MyFoldLevel(v:lnum)
au Filetype java setlocal foldmethod=expr
"Sweave
au BufNewFile,BufRead *.Rnw map <Leader>swe :execute '!/usr/local/bin/R CMD Sweave '.expand('%:p')<CR>
au BufRead ~/.mutt/temp/mutt* set spell
"Mutt
endif
"-------------------------------------------------------------
"Python Settings
"-------------------------------------------------------------
function! PythonTidySaver()
let oldpos=getpos('.')
%!PythonTidy
call setpos('.',oldpos)
endfunction
"autocmd! bufwritepost *.py call PythonTidySaver()
"
"Virtualenv
if has('python')
Bundle 'jmcantrell/vim-virtualenv.git'
if !empty($VIRTUAL_ENV)
let g:virtualenv_auto_activate=1
endif
"make sure to change /etc/paths"
function! MakePyProjet(projectname)
" execute '!source /usr/local/share/python/virtualenvwrapper.sh'
execute '!mkproject& -t locodev ' . a:projectname
endfunction
else
"ack to make vi work
function! VirtualEnvStatusline()
endfunction
endif
"
"-------------------------------------------------------------
"Latex Plugin
"-------------------------------------------------------------
Bundle 'mineiro/vim-latex.git'
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_CompileRule_pdf = 'mkdir -p latex-build; /usr/texbin/pdflatex -output-directory latex-build -interaction nonstopmode $*; cp latex-build/*.pdf .'
let g:Tex_ViewRule_pdf = 'Preview'
let g:Tex_IgnoredWarnings="Font""\n"
let g:Tex_IgnoredWarnings =
\'Underfull'."\n".
\'Overfull'."\n".
\'specifier changed to'."\n".
\'You have requested'."\n".
\'Missing number, treated as zero.'."\n".
\'There were undefined references'."\n".
\'Latex Warning:'."\n".
\'LaTeX Warning:' " float stuck
let g:Tex_IgnoreLevel = 8
"-------------------------------------------------------------
"NerdTree Plugin
"-------------------------------------------------------------
Bundle 'scrooloose/nerdtree'
nmap <silent><Leader>d :NERDTreeToggle<CR>
nmap <silent><leader>nf :NERDTreeFind<CR>
let g:NERDTreeWinPos = "left"
"down't display the following files
let NERDTreeIgnore=['\.DS_Store$','\.pyc$', '\.xls$','\.zip$','\.pdf$','\.nav$','\.snm$','.\toc$','\.vrb$','\.aux$' , '\.git$', '\.db$', '\.ropeproject', '\.so$']
let NERDTreeHighlightCursorline=1
" Show the bookmarks table on startup
let NERDTreeShowBookmarks=1
"quit after opening a file
let NERDTreeQuitOnOpen=1
let NERDTreeShowHidden=1
"some styling
let NERDTreeDirArrows = 1
"hi Title guifg=red guibg=#202020
if has("autocmd")
autocmd Filetype nerdtree setlocal nolist
endif
"-------------------------------------------------------------
"Ultinips Settings
"-------------------------------------------------------------
if has('python')
Bundle 'SirVer/ultisnips'
let g:UltiSnipsEditSplit='vertical'
let g:UltiSnipsUsePythonVersion = 2
autocmd BufNewFile,BufRead *.snippets set filetype=snippets
" let g:UltiSnipsListSnippets="<c-tab>"
"does not seem to work so call it"
nnoremap <Leader>us :call UltiSnips_ListSnippets()<CR>
inoremap <Leader>us <ESC>:call UltiSnips_ListSnippets()<CR>
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
autocmd Filetype python :UltiSnipsAddFiletypes python
autocmd Filetype html :UltiSnipsAddFiletypes html
endif
"-------------------------------------------------------------
"Objective-J Settings
"-------------------------------------------------------------
Bundle 'nanki/vim-objj'
"vim objj
set runtimepath+=~/.vim/bundle/vim-objj
"-------------------------------------------------------------
"make green plugin
"-------------------------------------------------------------
Bundle 'reinh/vim-makegreen'
map <Leader>nose :call MakeGreen()<CR>
if has('python')
Bundle 'nvie/vim-pyunit'
let g:PyUnitCmd = '/usr/local/share/python/nosetests -q --with-machineout'
if !empty($VIRTUAL_ENV)
let g:PyUnitCmd = $VIRTUAL_ENV . '/bin/nosetests -q --with-machineout'
endif
let g:PyUnitTestsStructure="nose"
autocmd Filetype python noremap <Leader>nose :call PyUnitRunTests()<CR>
autocmd Filetype python noremap! <Leader>nose <Esc>:call PyUnitRunTests()<CR>
autocmd Filetype python noremap <Leader>ut :call PyUnitSwitchToCounterpart()<CR>
autocmd Filetype python noremap! <Leader>ut <ESC>:call PyUnitSwitchToCounterpart()<CR>
endif
"-------------------------------------------------------------
"Ack plugin
"-------------------------------------------------------------
if executable("ack")
Bundle 'mileszs/ack.vim.git'
nnoremap <Leader>a :Ack --follow <C-r><C-w>
endif
"-------------------------------------------------------------
"ZoomWin plugin
"-------------------------------------------------------------
Bundle 'vim-scripts/ZoomWin.git'
nnoremap <Leader>z :ZoomWin<CR>
inoremap <Leader>z <ESC>:ZoomWin<CR>
" Without setting this, ZoomWin restores windows in a way that causes
" equalalways behavior to be triggered the next time CommandT is used.
" This is likely a bludgeon to solve some other issue, but it works
set noequalalways
"-------------------------------------------------------------
"OpenTerminal plugin
"-------------------------------------------------------------
Bundle 'vim-scripts/open-terminal-filemanager.git'
nnoremap <silent><Leader>of :OpenFilemanager<CR><CR>
"-------------------------------------------------------------
"Easymotion plugin
"-------------------------------------------------------------
Bundle 'Lokaltog/vim-easymotion.git'
let g:EasyMotion_leader_key = 'e'
"-------------------------------------------------------------
"Yankring plugin
"-------------------------------------------------------------
Bundle 'chrismetcalf/vim-yankring.git'
nnoremap <silent><Leader>y :YRShow<cr>
inoremap <silent><Leader>y <ESC>:YRShow<cr>
let g:yankring_history_dir = "$HOME/.vim/"
let g:yankring_history_file = 'yankring_history'
"-------------------------------------------------------------
"Neocomplete plugin
"-------------------------------------------------------------
Bundle 'Shougo/neocomplcache.git'
" Disable AutoComplPop.
"let g:acp_enableAtStartup = 0
" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
" Use smartcase.
let g:neocomplcache_enable_smart_case = 1
" Use camel case completion.
let g:neocomplcache_enable_camel_case_completion = 1
" AutoComplPop like behavior.
let g:neocomplcache_enable_auto_select = 1
"-------------------------------------------------------------
"Git plugins
"-------------------------------------------------------------
"fugitive
Bundle 'tpope/vim-fugitive'
nnoremap <Leader>gd :Gdiff<CR>
nnoremap <Leader>gs :Gstatus<CR>
nnoremap <Leader>gco :Gcheckout<CR>
nnoremap <Leader>gci :Gcommit<CR>
nnoremap <Leader>gl :Glog<CR>
nnoremap <Leader>gp :Git push<CR>
"gitv
Bundle 'gregsexton/gitv'
"-------------------------------------------------------------
"Gundo plugin
"-------------------------------------------------------------
if has('python')
Bundle 'sjl/gundo.vim.git'
nnoremap <Leader>gu :GundoToggle<CR>
"let g:gundo_debug = 1
let g:gundo_preview_bottom = 1
endif
"-------------------------------------------------------------
"Ropevim
"-------------------------------------------------------------
let ropevim_vim_completion=1
"-------------------------------------------------------------
"SQL plugin's
"-------------------------------------------------------------
Bundle 'locojay/dbext.vim.git'
"dbext <Leaeder>se
let dbext_default_DB2_bin='db2batch'
"let g:dbext_default_DB2_cmd_options="-q on -s off -l ';'"
"let g:dbext_default_DB2_cmd_options="-q del -s off"
"let dbext_default_DB2_cmd_terminator=""
"let dbext_default_DB2_cmd_terminator="':';"
"output command
"let dbext_default_display_cmd_line=1
"-------------------------------------------------------------
"Swap parameters plugin
"-------------------------------------------------------------
if has('python')
Bundle 'vim-scripts/swap-parameters.git'
noremap gb :call SwapParams("forwards")<cr>
noremap gB :call SwapParams("backwards")<cr>
endif
"
"-------------------------------------------------------------
"Ctrl-p plugin
"-------------------------------------------------------------
Bundle 'kien/ctrlp.vim.git'
let g:ctrlp_map = '<leader>,'
let g:ctrlp_working_path_mode = 0
let g:ctrlp_match_window_reversed = 1
let g:ctrlp_split_window = 0
let g:ctrlp_max_height = 20
let g:ctrlp_open_new_file = 'v'
let g:ctrlp_prompt_mappings = {
\ 'PrtSelectMove("j")': ['<c-j>', '<down>', '<s-tab>'],
\ 'PrtSelectMove("k")': ['<c-k>', '<up>', '<tab>'],
\ 'PrtHistory(-1)': ['<c-n>'],
\ 'PrtHistory(1)': ['<c-p>'],
\ 'ToggleFocus()': ['<c-tab>'],
\ }
let g:ctrlp_extensions = ['tag']
" let g:ctrlp_custom_ignore = {
" \ 'dir' : '\.git/',
" \
" \ }
"let g:ctrlp_dont_split = 'NERD_tree_2'
nnoremap <leader>. :CtrlPTag<cr>
nnoremap <leader>mr :CtrlPMRUFiles<cr>
"-------------------------------------------------------------
"TAGS Settings
"-------------------------------------------------------------
if executable('ctags')
map \pyt :exe '!ctags -R --languages=python -f ./pytags ' . system('python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"')<CR>
map <Leader>/ :exe '!ctags -R . ./tags'
" Easy tags plugin
Bundle 'xolox/vim-easytags.git'
let g:easytags_cmd = '/usr/local/bin/ctags'
set tags=./tags;
let g:easytags_dynamic_files = 1
Bundle 'majutsushi/tagbar.git'
let g:tagbar_ctags_bin='/usr/local/bin/ctags'
"Tagbar Plugin Settings
nmap <silent><Leader>k :TagbarToggle<CR>
endif
"-------------------------------------------------------------
"Visualization
"-------------------------------------------------------------
"Powerline
Bundle 'Lokaltog/vim-powerline'
let g:Powerline_symbols = "fancy"
if has("autocmd")
"autocmd bufwritepost .vimrc source $MYVIMRC
"autocmd bufwritepost .vimrc call Pl#Load()
endif
"IndentationGuide <Leader>ig
Bundle 'nathanaelkane/vim-indent-guides.git'
"ShowMarks
"Bundle "garbas/vim-showmarks"
"-------------------------------------------------------------
" TimeStamp plugin
"-------------------------------------------------------------
"autocmd BufWritePre *.py :1,6s/T_IMESTAMP/TIMESTAMP/e
"-------------------------------------------------------------
" Syntastic plugin
"-------------------------------------------------------------
Bundle 'scrooloose/syntastic.git'
"checks syntax for multiple file type install
" - cpp , c g++, gcc
" - flake8 or pyflakes or pylint for python
" - jsonlint for json
" - java ?? / use eclim
" - jslint for javascript
let g:syntastic_enable_signs = 1
let g:syntastic_auto_loc_list=2
let g:syntastic_python_checker = 'flake8'
" let g:syntastic_python_checker = 'flake8 --ignore=E221,E225,E231,E251,E302,E303,W391,E501,E702'
let g:syntastic_stl_format = '[%E{%e Errors}%B{, }%W{%w Warnings}]'
"-------------------------------------------------------------
"Pep8 plugin # using flake8
"-------------------------------------------------------------
if has('python')
"Bundle 'orestis/pysmell.git'
if executable("pep8")
"Bundle 'nvie/vim-pep8.git'
"autocmd FileType python map <buffer> <Leader>p :call Pep8()<CR>
endif
endif
"-------------------------------------------------------------
"Gitst plugin
"-------------------------------------------------------------
Bundle 'mattn/webapi-vim'
Bundle 'mattn/gist-vim.git'
let g:gist_clip_command = 'pbcopy'
let g:gist_detect_filetype = 1
"-------------------------------------------------------------
"Pydoc, Pyref plugin
"-------------------------------------------------------------
Bundle 'xolox/vim-pyref'
Bundle 'fs111/pydoc.vim'
let g:pydoc_cmd='/usr/local/bin/pydoc'
"-------------------------------------------------------------
"Comments
"-------------------------------------------------------------
"Bundle 'scrooloose/nerdcommenter'
" Bundle 'tpope/vim-commentary'
" nmap <leader>c <Plug>CommentaryLine
" xmap <leader>c <Plug>Commentary
Bundle "tomtom/tcomment_vim"
nnoremap <silent><leader>c :TComment<CR>
vnoremap <silent><leader>c :TComment<CR>
"autocompletion as you type
if executable("tmux")
"Bundle 'vim-scripts/Screen-vim---gnu-screentmux'
Bundle 'xaviershay/tslime.vim.git'
Bundle 'acustodioo/vim-tmux'
"change pane number at runtime by setting
function! TmuxPaneNumber()
let b:tmux_panenumber = input("pane number: ", "", "custom,Tmux_Pane_Numbers")
endfunction
command! TmuxPaneNumber call TmuxPaneNumber()
"Bundle 'sjl/vitality.vim'
endif
"Work with ipython notebook
"
" Bundle 'ivanov/vim-ipython'
" let g:ipy_perform_mappings = 0
" map <silent> <C-i> :python run_this_line()<CR>
" imap <silent> <C-i> <C-O>:python run_this_line()<CR>
"Tpope plugins
Bundle 'tpope/vim-unimpaired.git'
Bundle 'tpope/vim-repeat.git'
Bundle 'tpope/vim-surround.git'
Bundle 'tpope/vim-speeddating.git'
"Task Management
"Bundle 'jceb/vim-orgmode'
Bundle 'aaronbieber/quicktask'
Bundle 'vim-scripts/SearchComplete.git'
Bundle 'tsaleh/vim-align.git'
Bundle 'vim-scripts/timestamp.vim.git'
Bundle 'IndexedSearch'
Bundle 'gmunkhbaatarmn/vim-largefile.git'
Bundle 'leshill/vim-json'
Bundle 'msanders/cocoa.vim'
Bundle 'vim-scripts/Vim-R-plugin.git'
Bundle 'gmarik/sudo-gui.vim.git'
"vim scripting
Bundle 'vim-scripts/reload.vim.git'
"RST
Bundle "vim-scripts/rest.vim.git"
Bundle "vim-scripts/VST.git"
Bundle "nvie/vim-rst-tables.git"
Bundle 'vim-scripts/DotOutlineTree.git'
"Bundle 'chrisbra/csv.vim'
command! CsvCleanup :%s/\%x0d/\r/
if has('ruby')
"rst"
Bundle "matthias-guenther/hammer.vim"
let g:mdown_preview_cmd="/Users/locojay/.cabal/bin/pandoc -s --highlight-style pygments"
Bundle "locojay/vim-markdown-preview"
" autocmd BufWritePost *.rst :Hammer<CR>
endif
"Editing
"Bundle 'vim-scripts/delimitMate.vim'
Bundle 'kana/vim-smartinput'
"Clojusre
Bundle 'VimClojure'
"Highlight Clojure's builtins
let g:vimclojure#HighlightBuiltins=1
"Rainbow parentheses'!
let g:vimclojure#ParenRainbow=1
" Bundle 'vim-scripts/slimv.vim'
" Bundle 'gberenfield/sjl-slimv'
" let g:slimv_leader = '\'
" let g:lisp_rainbow = 1
" let g:slimv_repl_syntax = 1
"help
Bundle 'sjl/strftimedammit.vim'
if has('ruby')
"add lusty jugler and lusty finder"
"Todo: only use jugle ( ctrlp replaces Sat Feb 11 18:29:47 2012
Bundle 'sjbach/lusty.git'
endif
"Rainbow Parenthesis
Bundle 'kien/rainbow_parentheses.vim'
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
Bundle 'sjl/clam.vim'
"Web dev
Bundle 'mattn/zencoding-vim'
let g:user_zen_leader_key = '<leader>h'
Bundle 'Glench/Vim-Jinja2-Syntax'
Bundle 'nono/jquery.vim'