-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
executable file
·1679 lines (1642 loc) · 67.1 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
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker :
"
" .vimrc de E. Manuel Cerrón Ángeles
"
" ___ __
" | || |
" | | / / __
" | |/ (_)_ _ _ _____ ___ / /____ ____
" | / / ' \ |/ / -_) _ \/ __/ _ \/ __/
" |__/_/_/_/_/___/\__/_//_/\__/\___/_/
" BY XERRON©
"
" Puedes tener una versión mas actual en: http://github.com/xerron/vimventor
" Identificación de la Plataforma {
let s:is_windows = has('win32') || has('win64')
let s:is_cygwin = has('win32unix')
let s:is_macvim = has('gui_macvim')
" }
"
" Configuraciones
"
" No compatibilidad con Vi {
set nocompatible " Debe ser la primera línea
" }
" Neobundle {
if s:is_windows
set rtp+=$VIM/bundles/neobundle.vim
set rtp+=$VIM/vimfiles
set rtp+=$VIM
call neobundle#begin(expand('$VIM/bundles/'))
else
set rtp+=~/.vim/bundles/neobundle.vim
set rtp+=~/.vim/vimfiles
call neobundle#begin(expand('~/.vim/bundles/'))
endif
NeoBundleFetch 'Shougo/neobundle.vim'
" }
" Pantalla de inicio {
set shortmess+=I " Quitar el Start Screen
" }
" Consola Path {
if s:is_windows && !s:is_cygwin
set shell=c:\windows\system32\cmd.exe
endif
" }
" Codificación {
scriptencoding utf-8
set encoding=utf-8 " Usado internamente por vim
set fileencoding=utf-8 " Codificación de archivo
set fileencodings=ucs-bom,utf-8,utf-16le,cp1252,iso-8859-15
if s:is_windows
set fileformats=dos,unix,mac
else
set fileformats=unix,dos,mac
endif
" }
" Archivos de respaldo {
set nobackup " No crear archivo de respaldo
set nowritebackup " No escrbir en el archivo de respaldo
set noswapfile " Buffer no guardado en memoria
" }
" General {
" raton
if has('mouse')
set mouse=a " Habilitar el uso del ratón automáticamente.
endif
set mousehide " Esconder el cursor mientras se escribe.
" Restaurar rar cursor a la posición anterior de la sesión
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
set hidden " Poder cambiar de bufer sin guardar
set history=1000 " Aumenta la historia (por defecto es 20)
" Para no usar "+ para copy-paste, usar directamente para pegar gP y para copiar y
if has('clipboard')
if has('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
endif
endif
set viewoptions=folds,options,cursor,unix,slash " unix/windows compatibility
set autoread " auto reload if file saved externally
set tags=tags;/ " directorio donde se encuentra los tags generados por ctags.
set showfulltag
set modeline " activa el mode de introducir lineas del tipo vim: en la cabecera.
set modelines=5 " numero de lineas procesadas
" desactivar sonidos
""set noerrorbells
""set novisualbell
""set t_vb=
"set autowrite " Graba automáticamente un archivo al salir de un buffer modificado
" }
" Vim UI {
" Colorsheme
if g:settings.change_based_time_of_day == 1
if strftime("%H") >= g:settings.day_start && strftime("%H") < g:settings.day_end
let g:settings.colorscheme = g:settings.colorscheme_light
else
let g:settings.colorscheme = g:settings.colorscheme
endif
endif
exec 'colorscheme '.g:settings.colorscheme
" Resaltar linea actual solo en insert mode
" set cursorline
autocmd InsertEnter * set cul
autocmd InsertLeave * set cul!
" highlight clear SignColumn " SignColumn con el mismo fondo
" highlight clear LineNr " Mismo color de fondo para la actual en relative mode
" highlight clear CursorLineNr " Quitar el resaltado de numero de linea.
set number " Mostrar numero de linea.
set showmatch " Mostrar coincidente brackets/parenthesis
if has('syntax')
syntax enable
endif
" set showmode " Muetra -INSERT- y similares en la parte de abajo no activo para airline
set noshowmode " No mostrar --INSERT--
" No mostrar back to original cuando se autocompleta
try
set shortmess+=c
catch /^Vim\%((\a\+)\)\=:E539: Illegal character/
autocmd MyAutoCmd VimEnter *
\ highlight ModeMsg guifg=bg guibg=bg |
\ highlight Question guifg=bg guibg=bg
endtry
set shiftround
set ruler
" set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " A ruler on steroids
set showcmd
set wildmenu " Mostrar lista en lugar de simplemente completar
set wildmode=list:longest,full " Command <Tab> completion, list matches, then longest common part, then all.
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.idea/*,*/.DS_Store
set wildignore+=*.o,*.out,*.obj,.git,*.rbc,*.rbo,*.class,.svn,*.gem
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz
set wildignore+=*/vendor/gems/*,*/vendor/cache/*,*/.bundle/*,*/.sass-cache/*
set wildignore+=*/tmp/librarian/*,*/.vagrant/*,*/.kitchen/*,*/vendor/cookbooks/*
set wildignore+=*/tmp/cache/assets/*/sprockets/*,*/tmp/cache/assets/*/sass/*
set wildignore+=*.swp,*~,._*
set scrolljump=5 " Lines to scroll when cursor leaves screen
set scrolloff=3 " Minimum lines to keep above and below cursor
""set splitright " Puts new vsplit windows to the right of the current
""set splitbelow " Puts new split windows to the bottom of the current
set laststatus=2
"Resaltado de espacios en blanco problematicos
" set list
set listchars=trail:·,precedes:«,extends:»,eol:↲,tab:▸\
" set listchars=""
" set listchars=tab:\ \
" set listchars+=trail:•
" set listchars+=extends:>
" set listchars+=precedes:<
" visualizacion de la linea en insert mode
if has('gui_running')
exec 'set guifont='.g:settings.guifont
else
set t_Co=256
" sirve para indicar que se salio del insert mode
if &term =~ "xterm\\|rxvt"
" use an orange cursor in insert mode
let &t_SI = "\<Esc>]12;orange\x7"
" use a red cursor otherwise
let &t_EI = "\<Esc>]12;grey\x7"
" let &t_SR = "\<Esc>]12;red\x7"
" silent !echo -ne "\033]12;red\007"
" reset cursor when vim exits
" autocmd VimLeave * silent !echo -ne "\033]112\007"
" use \003]12;gray\007 for gnome-terminal
endif
" if &term == 'uxterm'
" solid underscore
" let &t_SI .= "\<Esc>[6 q"
" solid block
" let &t_EI .= "\<Esc>[2 q"
" 1 or 0 -> blinking block
" 3 -> blinking underscore
" Recent versions of xterm (282 or above) also support
" 5 -> blinking vertical bar
" 6 -> solid vertical bar
" endif
endif
" Toggle Menu and Toolbar
if g:settings.gui_minimal == 'on'
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L "remove left-hand scroll bar
endif
" }
" Formating {
set autoindent " identado Automático.
" Autocompletado
set pastetoggle=<F2> " Cambia de modo de pegar, desactiva autoident
""set nowrap " Do not wrap long lines
" set whichwrap=b,s,h,l,<,>,[,] " Envolver automaticamente al terminar la linea, pasar a otra linea cuando finaliza.
"set tw=100 " Maxima anchura de una linea
set wm=0 " No cortar la linea despues de los tw=100 caracteres
set backspace=indent,eol,start " permite retroceso en todo, modo inserción
set complete-=i
set nrformats-=octal
set smarttab " Use shiftwidth to enter tabs
set shiftwidth=4 " Use indents of 4 spaces
set expandtab " Tabs are spaces, not tabs
set tabstop=4 " An indentation every four columns
set softtabstop=4 " Let backspace delete indent
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
" Tamaño prederteminado de ventana al iniciar
if has("gui_running")
" Esto es cuando incia Vim con un GUI
"set lines=60 columns=60
else
" Esto para la consola de Vim.
if exists("+lines")
"set lines=50
endif
if exists("+columns")
"set columns=100
endif
endif
" }
" Find {
set incsearch " Buscar mientras se escribe la búsqueda
set hlsearch " Resaltar los términos buscados
set ignorecase " Busqueda case insensitive
set smartcase " Busqueda case sensitive cuendo uc esta presente
if executable('ack')
set grepprg=ack\ --nogroup\ --column\ --smart-case\ --nocolor\ --follow\ $*
set grepformat=%f:%l:%c:%m
endif
if executable('ag')
set grepprg=ag\ --nogroup\ --column\ --smart-case\ --nocolor\ --follow
set grepformat=%f:%l:%c:%m
endif
" }
" Misc {
" Fullscreen, es necesario la libreria. Ver la carpeta /vendors
if has('gui_running') && has('gui_win32') && has('libcall')
let g:MyVimLib = 'gvimfullscreen.dll'
function! ToggleFullScreen()
call libcall(g:MyVimLib, 'ToggleFullScreen', 0)
endfunction
map <a-F11> <esc>:call ToggleFullScreen()<cr>
endif
" }
" Folding {
set foldenable " Auto replegado de codigo (folding)
set foldmethod=syntax
set foldlevelstart=0
set foldopen=block,hor,mark,percent,quickfix,tag " what movements open folds
"let vimsyn_folding='af'
" }
" Mapping {
let mapleader = ',' " Configuación Esencial
"let maplocalleader = '\' " Configuación Esencial
" }
"
" Configuración de Plugins
"
if count(g:settings.plugin_groups, 'core') "{{{
" Mejora %
NeoBundle 'matchit.zip'
" Mejora la apariencia, statusbar
NeoBundle 'bling/vim-airline'
" Configuración de vim-airline {{{
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep=' '
let g:airline#extensions#tabline#left_alt_sep='¦'
"let g:airline_symbols.space = "\ua0"
let g:airline_powerline_fonts = 1
let g:airline_theme='hybrid'
"}}}
NeoBundle 'vim-airline/vim-airline-themes'
" Repetir comandos con .
NeoBundle 'tpope/vim-repeat'
" Provee varios pares de mapas de soporte [q ]q
NeoBundle 'tpope/vim-unimpaired'
" :help ayuda
NeoBundle 'xerron/vim-doc-es'
" Interactive command execution in Vim.
NeoBundle 'Shougo/vimproc.vim', {
\ 'build' : {
\ 'windows' : 'tools\\update-dll-mingw',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make',
\ 'linux' : 'make',
\ 'unix' : 'gmake',
\ },
\ }
endif "}}}
if count(g:settings.plugin_groups, 'unix') "{{{
" Helpers for UNIX | Note: ver comandos nativos
NeoBundle 'tpope/vim-eunuch'
endif "}}}
if count(g:settings.plugin_groups, 'dispatch') "{{{
" Asynchronous build and test dispatcher :Make :Copen
NeoBundle 'tpope/vim-dispatch'
endif "}}}
if count(g:settings.plugin_groups, 'surround') "{{{
" Surround parentesis, llaves, comillas, xml tags, ...
NeoBundle 'tpope/vim-surround'
endif "}}}
if count(g:settings.plugin_groups, 'mnemonic') "{{{
" org mode
NeoBundle 'hecal3/vim-leader-guide'
endif "}}}
if count(g:settings.plugin_groups, 'webapi') "{{{
" vim interface to Web API
NeoBundle 'mattn/webapi-vim'
endif "}}}
if count(g:settings.plugin_groups, 'zoom') "{{{
" Zoom in/out of windows (toggle between one window and multi-window)
NeoBundle 'regedarek/ZoomWin'
" Configuración ZoomWin {{{
nmap <leader>zw :ZoomWin<CR>
" }}}
endif "}}}
if count(g:settings.plugin_groups, 'markdown') "{{{
NeoBundleLazy 'plasticboy/vim-markdown', {'autoload':{'filetypes':['markdown']}}
"NeoBundleLazy 'tpope/vim-markdown', {'autoload':{'filetypes':['markdown']}}
au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.md setf markdown
endif "}}}
if count(g:settings.plugin_groups, 'log') "{{{
" Log
NeoBundleLazy 'dzeban/vim-log-syntax', {'autoload':{'filetypes':['log']}}
endif "}}}
if count(g:settings.plugin_groups, 'restructuretex') "{{{
NeoBundleLazy 'Rykka/riv.vim', {'autoload':{'filetypes':['rst']}}
" Configuracion riv.vim {{{
let proj1 = { 'path': '~/Dropbox/Notas',}
let g:riv_projects = [proj1]
" }}}
"au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.md setf markdown
endif "}}}
if count(g:settings.plugin_groups, 'csv') "{{{
NeoBundleLazy 'chrisbra/csv.vim', {'autoload':{'filetypes':['csv']}}
au BufNewFile,BufRead *.csv,*.xls setf csv
endif "}}}
if count(g:settings.plugin_groups, 'html') "{{{
" Vim's MatchParen for HTML tags
NeoBundleLazy 'gregsexton/MatchTag', {'autoload':{'filetypes':['html','xml']}}
" HTML5 omnicomplete and syntax whit SVG inline
NeoBundleLazy 'othree/html5.vim', {'autoload':{'filetypes':['html']}}
" Configuracion de html5.vim {
"let g:html5_event_handler_attributes_complete = 0
"let g:html5_rdfa_attributes_complete = 0
"let g:html5_microdata_attributes_complete = 0
"let g:html5_aria_attributes_complete = 0
" }
endif "}}}
if count(g:settings.plugin_groups, 'css') "{{{
" autocmd FileType scss set iskeyword+=-
" Add CSS3 syntax support to vim's built-in `syntax/css.vim`.
NeoBundleLazy 'hail2u/vim-css3-syntax', {'autoload':{'filetypes':['css','scss','sass']}}
" Vendors Prefixes
" :highlight VendorPrefix guifg=#00ffff gui=bold
" :match VendorPrefix /-\(moz\|webkit\|o\|ms\)-[a-zA-Z-]\+/
" Highlight colors in css files
NeoBundleLazy 'ap/vim-css-color', {'autoload':{'filetypes':['css','scss','sass','less','styl']}}
endif "}}}
if count(g:settings.plugin_groups, 'sass') "{{{
" Vim syntax file for scss (Sassy CSS)
NeoBundleLazy 'cakebaker/scss-syntax.vim', {'autoload':{'filetypes':['scss','sass']}}
endif "}}}
if count(g:settings.plugin_groups, 'less') "{{{
" vim syntax for LESS (dynamic CSS)
NeoBundleLazy 'groenewege/vim-less', {'autoload':{'filetypes':['less']}}
" Configuracion para vim-less {
nnoremap <Leader>setlocal iskeyword+=-m :w <BAR> !lessc % > %:t:r.css<CR><space>
" }
endif "}}}
if count(g:settings.plugin_groups, 'stylus') "{{{
" Syntax Highlighting for Stylus
NeoBundleLazy 'wavded/vim-stylus', {'autoload':{'filetypes':['styl']}}
endif "}}}
if count(g:settings.plugin_groups, 'emmet') "{{{
" emmet for vim
NeoBundleLazy 'mattn/emmet-vim', {'autoload':{'filetypes':['html','xml','xsl','xslt','xsd','css','sass','scss','less','mustache']}}
" Configuracion e emmet-vim {
function! s:zen_html()
let line = getline('.')
if match(line, '<.*>') < 0
return "\<c-y>,"
endif
return "\<c-y>n"
endfunction
" redefinir
" let g:user_emmet_leader_key='<C-Z>'
" let g:use_emmet_complete_tag = 1
autocmd FileType xml,xsl,xslt,xsd,css,sass,scss,less,mustache imap <buffer><c-j> <c-y>,
autocmd FileType html imap <buffer><expr><c-j> <sid>zen_html()
" }
endif "}}}
if count(g:settings.plugin_groups, 'livestyle') "{{{
" Este plugin es interesante, pero no es necesario. Usa Firefox > Style Editor
" Emmet LiveStyle for Vim http://mattn.kaoriya.net/
NeoBundleLazy 'mattn/livestyle-vim', {'autoload':{'commands':'LiveStyle'}}
endif "}}}
if count(g:settings.plugin_groups, 'handlebars') "{{{
NeoBundleLazy 'mustache/vim-mustache-handlebars', {'autoload': {'filetypes':['html']}}
endif "}}}
if count(g:settings.plugin_groups, 'javascript') "{{{
NeoBundleLazy 'ternjs/tern_for_vim', {
\ 'autoload': { 'filetypes': ['javascript'] },
\ 'build': {
\ 'mac': 'npm install',
\ 'unix': 'npm install',
\ 'cygwin': 'npm install',
\ 'windows': 'npm install'
\ },
\ }
NeoBundleLazy 'pangloss/vim-javascript', {'autoload':{'filetypes':['javascript']}}
NeoBundleLazy 'maksimr/vim-jsbeautify', {'autoload':{'filetypes':['javascript']}} "{{{
nnoremap <leader>fjs :call JsBeautify()<cr>
"}}}
NeoBundleLazy 'othree/javascript-libraries-syntax.vim', {'autoload':{'filetypes':['javascript','coffee','ls','typescript']}}
endif "}}}
if count(g:settings.plugin_groups, 'node') "{{{
NeoBundleLazy 'mmalecki/vim-node.js', {'autoload':{'filetypes':['javascript']}}
endif "}}}
if count(g:settings.plugin_groups, 'coffee') "{{{
NeoBundleLazy 'kchmck/vim-coffee-script', {'autoload':{'filetypes':['coffee']}}
endif "}}}
if count(g:settings.plugin_groups, 'typescript') "{{{
NeoBundleLazy 'leafgarland/typescript-vim', {'autoload':{'filetypes':['typescript']}}
endif "}}}
if count(g:settings.plugin_groups, 'json') "{{{
NeoBundleLazy 'elzr/vim-json', {'autoload':{'filetypes':['javascript','json']}}
endif "}}}
if count(g:settings.plugin_groups, 'ruby') "{{{
"
NeoBundle 'tpope/vim-rails'
"
NeoBundle 'tpope/vim-bundler'
endif "}}}
if count(g:settings.plugin_groups, 'dev-tools') "{{{
" Run commands quickly.
" NeoBundle 'thinca/vim-quickrun'
" Integrated reference viewer.
NeoBundle 'thinca/vim-ref'
" :Ref phpmanual echo
" documentacion
"NeoBundle 'powerman/vim-plugin-viewdoc'
"http://vim.wikia.com/wiki/Online_documentation_for_word_under_cursor
" Shell interactiva para vim
"NeoBundleLazy 'Shougo/vimshell.vim', {'autoload':{'commands':[ 'VimShell', 'VimShellInteractive' ]}}
"{{{
" if s:is_macvim
" let g:vimshell_editor_command='mvim'
" else
" let g:vimshell_editor_command='vim'
" endif
" let g:vimshell_right_prompt='getcwd()'
" let g:vimshell_data_directory='~/.vim/.cache/vimshell'
" let g:vimshell_vimshrc_path='~/.vim/vimshrc'
"
" nnoremap <leader>c :VimShell -split<cr>
" nnoremap <leader>cc :VimShell -split<cr>
" nnoremap <leader>cn :VimShellInteractive node<cr>
" nnoremap <leader>cl :VimShellInteractive lua<cr>
" nnoremap <leader>cr :VimShellInteractive irb<cr>
" nnoremap <leader>cp :VimShellInteractive python<cr>
"}}}
endif "}}}
if count(g:settings.plugin_groups, 'python') "{{{
NeoBundleLazy 'klen/python-mode', {'autoload':{'filetypes':['python']}} "{{{
let g:pymode_rope=0
"}}}
NeoBundleLazy 'davidhalter/jedi-vim', {'autoload':{'filetypes':['python']}} "{{{
let g:jedi#popup_on_dot=0
"}}}
NeoBundle 'Glench/Vim-Jinja2-Syntax', {'autoload':{'filetypes':['jinja']}}
endif "}}}
if count(g:settings.plugin_groups, 'php') "{{{
" Syntax 5.3 - 7.1
NeoBundleLazy 'StanAngeloff/php.vim', {'autoload':{'filetypes':['php']}}
" Configuración vim-latex{{{
function! PhpSyntaxOverride()
hi! def link phpDocTags phpDefine
hi! def link phpDocParam phpType
endfunction
augroup phpSyntaxOverride
autocmd!
autocmd FileType php call PhpSyntaxOverride()
augroup END
" }}}
" Improved PHP omnicomplete
NeoBundleLazy 'shawncplus/phpcomplete.vim', {'autoload':{'filetypes':['php']}}
" Types "use" statements for you
NeoBundleLazy 'arnaud-lb/vim-php-namespace', {'autoload':{'filetypes':['php']}}
endif "}}}
if count(g:settings.plugin_groups, 'twig') "{{{
NeoBundleLazy 'nelsyeung/twig.vim', {'autoload':{'filetypes':['twig']}}
endif "}}}
if count(g:settings.plugin_groups, 'volt') "{{{
NeoBundleLazy 'etaoins/vim-volt-syntax', {'autoload':{'filetypes':['volt']}}
endif "}}}
if count(g:settings.plugin_groups, 'latex') "{{{
" A simple and lightweight vim-plugin for editing LaTeX files.
NeoBundle 'lervag/vimtex'
" Configuración vim-latex{{{
" $pdflatex = 'pdflatex -synctex=1 %O %S'; > ~/.latexmkrc
let g:tex_flavor = 'latex'
if g:settings.latex_pdf_viewer == 'zathura'
let g:vimtex_view_enabled = 1
let g:vimtex_view_method = 'zathura'
" let g:vimtex_view_zathura_options = 1
"let g:vimtex_view_zathura_options = ''
let g:vimtex_complete_close_braces = 1
let g:vimtex_complete_recursive_bib = 1
let g:vimtex_complete_img_use_tail = 1
let g:vimtex_quickfix_autojump = 1
elseif g:settings.latex_pdf_viewer == 'okular'
let g:vimtex_view_method = 'general'
let g:vimtex_view_general_viewer = 'okular'
let g:vimtex_view_general_options = '--unique'
function! SyncTexForward(focus)
if a:focus == 1
let cmd = 'okular --unique '.g:latex#data[b:latex.id].out()."\\#src:".line(".").expand("%\:p").' &'
execute 'Start! ' . cmd
else
call latex#view#view('--unique '
\ . g:latex#data[b:latex.id].out()
\ . '\#src:' . line(".") . expand('%:p'))
endif
endfunction
nmap gb :call SyncTexForward(0)<cr>
elseif g:settings.latex_pdf_viewer == 'SumatraPDF'
" Configuracion Sumatra: gvim --remote-silent +%l "%f"
let g:vimtex_view_method = 'general'
let g:vimtex_view_general_viewer = 'SumatraPDF'
let g:vimtex_view_general_options = '-reuse-instance -inverse-search '.
\ '"gvim --servername '.v:servername.' --remote-send \"^<C-\^>^<C-n^>'.
\ ':execute ''drop ''.fnameescape(''\%f'')^<CR^>:\%l^<CR^>:normal\! zzzv^<CR^>'.
\ ':call remote_foreground('''.v:servername.''')^<CR^>\""'
nnoremap <expr><silent> gt ':VimLatexView -forward-search '
\ . shellescape(expand('%:p')) . ' '
\ . line(".") . ' '
\ . shellescape(g:latex#data[b:latex.id].out()) . '<CR>'
nnoremap <expr><silent> gb ':Start! SumatraPDF -forward-search '
\ . shellescape(expand('%:p')) . ' '
\ . line(".") . ' '
\ . shellescape(g:latex#data[b:latex.id].out()) . '<CR><CR>'
" nnoremap <expr><silent> gt ':wall<bar>VimLatexView '.'-forward-search "'.shellescape(expand('%:p')).'" '.line(".").' '.shellescape(g:latex#data[b:latex.id].out()).'<CR>'
endif
" }}}
endif "}}}
if count(g:settings.plugin_groups, 'scala') "{{{
NeoBundle 'derekwyatt/vim-scala'
NeoBundle 'megaannum/vimside'
endif "}}}
if count(g:settings.plugin_groups, 'go') "{{{
NeoBundleLazy 'fatih/vim-go', {'autoload':{'filetypes':['go']}}
NeoBundleLazy 'nsf/gocode', {'autoload': {'filetypes':['go']}, 'rtp': 'vim'}
endif "}}}
if count(g:settings.plugin_groups, 'scm') "{{{
" barra lateral muestra diferencias
NeoBundle 'mhinz/vim-signify'
" Configuración de vim-signify {{{
let g:signify_update_on_bufenter=0
"}}}
if executable('hg')
" Soporte para Mercurial
" NeoBundle 'bitbucket:ludovicchabant/vim-lawrencium'
endif
" Soporte para Git
NeoBundle 'tpope/vim-fugitive'
" Configuración de vim-fugitive {{{
nnoremap <silent> <leader>gb :Gblame<CR>
nnoremap <silent> <leader>gs :Gstatus<CR>
nnoremap <silent> <leader>gd :Gdiff<CR>
nnoremap <silent> <leader>gl :Glog<CR>
nnoremap <silent> <leader>gc :Gcommit<CR>
nnoremap <silent> <leader>gp :Git push<CR>
nnoremap <silent> <leader>gw :Gwrite<CR>
nnoremap <silent> <leader>gr :Gremove<CR>
autocmd FileType gitcommit nmap <buffer> U :Git checkout -- <C-r><C-g><CR>
autocmd BufReadPost fugitive://* set bufhidden=delete
"}}}
" gitk clone para Vim
NeoBundleLazy 'gregsexton/gitv', {'depends':['tpope/vim-fugitive'], 'autoload':{'commands':'Gitv'}}
" Configuración de gitv {{{
nnoremap <silent> <leader>gv :Gitv<CR>
nnoremap <silent> <leader>gV :Gitv!<CR>
"}}}
" Soporte para otros SVC | Nota: Aun no lo he probado
" NeoBundle 'git://repo.or.cz/vcscommand'
" Plugin para crear Gist
NeoBundleLazy 'mattn/gist-vim', { 'depends': 'mattn/webapi-vim', 'autoload': { 'commands': 'Gist' } }
" Configuración gist-vim {{{
let g:gist_post_private=1
let g:gist_show_privates=1
"}}}
endif "}}}
if count(g:settings.plugin_groups, 'linter') "{{{
if g:settings.linter == "syntastic"
" Syntax checking
NeoBundle 'scrooloose/syntastic'
" Configuración de syntastic {{{
" let g:syntastic_enable_signs=1
" let g:syntastic_quiet_warnings=0
" let g:syntastic_auto_loc_list=2
" Simbolos
let g:syntastic_error_symbol = '✗'
let g:syntastic_style_error_symbol = '✠'
let g:syntastic_warning_symbol = '∆'
let g:syntastic_style_warning_symbol = '≈'
"}}}
endif
if g:settings.linter == "ale"
"Asynchronous Lint Engine
NeoBundle 'w0rp/ale'
endif
endif "}}}
if count(g:settings.plugin_groups, 'autocomplete') "{{{
" The ultimate snippet solution for Vim
NeoBundle 'SirVer/ultisnips'
" Configuración ultisnips {{{
let g:UltiSnipsUsePythonVersion = 3
" let g:UltiSnipsExpandTrigger="<c-b>"
" let g:UltiSnipsJumpForwardTrigger="<c-b>" "<c-b>
" let g:UltiSnipsJumpBackwardTrigger="<s-tab>" "<c-z>
" if s:is_windows
" Es necesario añadir el rtp+='$VIM'
" let g:UltiSnipsSnippetsDir=$VIM.'/ultisnips'
" else
" let g:UltiSnipsSnippetsDir='~/.vim/ultisnips'
" endif
" let g:UltiSnipsSnippetDirectories=["ultisnips", "UltiSnips"]
" let g:UltiSnipsEditSplit="vertical"
"}}}
" Next generation completion framework after neocomplcache
NeoBundleLazy 'Shougo/neocomplete.vim', {'autoload':{'insert':1}, 'vim_version':'7.3.885'}
" Configuración de neocomplete {{{
let g:acp_enableAtStartup = 0
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
"let g:neocomplete#enable_auto_select = 0
let g:neocomplete#sources#syntax#min_keyword_length = 4
let g:UltiSnipsJumpForwardTrigger="<NOP>"
let g:ulti_expand_or_jump_res = 0
function! ExpandSnippetOrJumpForwardOrReturnTab()
let snippet = UltiSnips#ExpandSnippetOrJump()
if g:ulti_expand_or_jump_res > 0
return snippet
else
return "\<TAB>"
endif
endfunction
inoremap <expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ "<C-R>=ExpandSnippetOrJumpForwardOrReturnTab()<CR>"
" snoremap <TAB>
" jump to next placeholder otherwise do nothing
snoremap <buffer> <silent> <TAB>
\ <ESC>:call UltiSnips#JumpForwards()<CR>
" inoremap <S-TAB>
" previous menu item, jump to previous placeholder or do nothing
let g:UltiSnipsJumpBackwordTrigger = "<NOP>"
inoremap <expr> <S-TAB>
\ pumvisible() ? "\<C-p>" :
\ "<C-R>=UltiSnips#JumpBackwards()<CR>"
" snoremap <S-TAB>
" jump to previous placeholder otherwise do nothing
snoremap <buffer> <silent> <S-TAB>
\ <ESC>:call UltiSnips#JumpBackwards()<CR>
" inoremap <CR>
" expand snippet, close menu or insert newline
let g:UltiSnipsExpandTrigger = "<NOP>"
let g:ulti_expand_or_jump_res = 0
inoremap <silent> <CR> <C-r>=<SID>ExpandSnippetOrReturnEmptyString()<CR>
function! s:ExpandSnippetOrReturnEmptyString()
if pumvisible()
let snippet = UltiSnips#ExpandSnippetOrJump()
if g:ulti_expand_or_jump_res > 0
return snippet
else
return "\<C-y>\<CR>"
endif
else
return "\<CR>"
endfunction
" inoremap <C-h>
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
" inoremap <BS>
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
if s:is_windows
let g:neocomplete#data_directory=$VIM.'/.cache/neocomplete'
else
let g:neocomplete#data_directory='~/.vim/.cache/neocomplete'
endif
"let g:neocomplete#sources#dictionary#dictionaries = {
" \ 'default' : '',
" \ 'vimshell' : $HOME.'/.vimshell_hist',
" \ 'scheme' : $HOME.'/.gosh_completions'
"\ }
" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
" completar palabras en español por default
let g:neocomplete#keyword_patterns._ = '[A-Za-zá-úÁ-ÚüñÑ_][0-9A-Za-zá-úÁ-ÚüñÑ_]*'
" tab
" Plugin key-mappings.
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif
"let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
"let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
"let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
" For perlomni.vim setting.
" https://github.com/c9s/perlomni.vim
" let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
"}}}
" snipMate & UltiSnip Snippets
NeoBundle 'honza/vim-snippets'
" rbonvall/snipmate-snippets-bib
" The standard snippets repository for neosnippet
" NeoBundle 'Shougo/neosnippet-snippets'
" adds snippet support to Vim
" NeoBundle 'Shougo/neosnippet.vim'
" imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
" \ "\<Plug>(neosnippet_expand_or_jump)" : pumvisible ? "\<C-n>" : "\<TAB>"
endif "}}}
if count(g:settings.plugin_groups, 'editing') "{{{
" EditorConfig plugin for Vim, modificar .editorconfig
NeoBundleLazy 'editorconfig/editorconfig-vim', {'autoload':{'insert':1}}
" Agrega end in ruby, endfunction/endif/more in vim script, etc
NeoBundle 'tpope/vim-endwise'
" use CTRL-A/CTRL-X to increment dates, times, and more
NeoBundle 'tpope/vim-speeddating'
" you can search your selection text in |Visual-mode|
NeoBundle 'thinca/vim-visualstar'
" An extensible & universal comment vim-plugin that also handles embedded filetypes
NeoBundle 'tomtom/tcomment_vim'
" Configuracion tcomment {{{
vmap <C-/> gc
" }}}
" visually select increasingly
NeoBundle 'terryma/vim-expand-region'
" Configuración de vim-expand-region {{{
" let g:expand_region_text_objects = {'iw':0,'iW':0,'i"':0,'i''':0,'i]':1,'ib':1,'iB':1,'il':0,'ip':0,'ie':0, }
" call expand_region#custom_text_objects({"\/\\n\\n\<CR>": 1,'a]' :1,'ab' :1,'aB' :1,'ii' :0,'ai' :0, })
" let g:expand_region_text_objects_vim = {'iw':0,'iW':0,'i"':0,'i''':0,'i]':1,'ib':1,'iB':1,'il':0,'ip':0,'ie':0, }
" call expand_region#custom_text_objects('vim', {"\/\\n\\n\<CR>": 1,'a]' :1,'ab' :1,'aB' :1,'ii' :0,'ai' :0, })
" let g:expand_region_text_objects_markdown = {'iw':0,'iW':0,'i"':0,'i''':0,'i]':1,'ib':1,'iB':1,'il':0,'ip':0,'ie':0, }
" call expand_region#custom_text_objects('markdown', {"\/\\n\\n\<CR>": 1,'a]' :1,'ab' :1,'aB' :1,'ii' :0,'ai' :0, })
" }}}
" Nota: Es inestable y personamente no lo uso,
" NeoBundle 'terryma/vim-multiple-cursors'
" Edita una region seleccionada en otro buffer
NeoBundle 'chrisbra/NrrwRgn'
" Vim script for text filtering and alignment
NeoBundleLazy 'godlygeek/tabular', {'autoload':{'commands':'Tabularize'}}
" Configuración de tabular{{{
nmap <Leader>a& :Tabularize /&<CR>
vmap <Leader>a& :Tabularize /&<CR>
nmap <Leader>a= :Tabularize /=<CR>
vmap <Leader>a= :Tabularize /=<CR>
nmap <Leader>a: :Tabularize /:<CR>
vmap <Leader>a: :Tabularize /:<CR>
nmap <Leader>a:: :Tabularize /:\zs<CR>
vmap <Leader>a:: :Tabularize /:\zs<CR>
nmap <Leader>a, :Tabularize /,<CR>
vmap <Leader>a, :Tabularize /,<CR>
nmap <Leader>a<Bar> :Tabularize /<Bar><CR>
vmap <Leader>a<Bar> :Tabularize /<Bar><CR>
" Tabular automaticamente con | pero no lo habilito porque voy a
" medir el desempeño primero.
" inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
"
" function! s:align()
" let p = '^\s*|\s.*\s|\s*$'
" if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
" let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
" let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
" Tabularize/|/l1
" normal! 0
" call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
" endif
" endfunction
"}}}
" insert or delete brackets, parens, quotes in pair
NeoBundle 'jiangmiao/auto-pairs'
" Heuristically set buffer options 'shiftwidth' and 'expandtab'
" NeoBundle 'tpope/vim-sleuth'
" tpope/vim-abolish
" tommcdo/vim-exchange
" reedes/vim-wordy
" reedes/vim-litecorrect
" reedes/vim-lexical
endif "}}}
if count(g:settings.plugin_groups, 'audionote') "{{{
endif "}}}
if count(g:settings.plugin_groups, 'ctrlp') "{{{
" Fuzzy file, buffer, mru, tag, etc finder.
NeoBundle 'kien/ctrlp.vim', { 'depends': 'tacahiroy/ctrlp-funky' }
" Configuración de ctrlp.vim {{{
let g:ctrlp_clear_cache_on_exit=1
let g:ctrlp_max_height=40
let g:ctrlp_show_hidden=0
let g:ctrlp_follow_symlinks=1
let g:ctrlp_max_files=20000
let g:ctrlp_cache_dir='~/.vim/.cache/ctrlp'
let g:ctrlp_reuse_window='startify'
let g:ctrlp_extensions=['funky']
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|idea)$',
\ 'file': '\v\.DS_Store$'
\ }
if executable('ag')
let g:ctrlp_user_command='ag %s -l --nocolor -g ""'
endif
nmap \ [ctrlp]
nnoremap [ctrlp] <nop>
nnoremap [ctrlp]t :CtrlPBufTag<cr>
nnoremap [ctrlp]T :CtrlPTag<cr>
nnoremap [ctrlp]l :CtrlPLine<cr>
nnoremap [ctrlp]o :CtrlPFunky<cr>
nnoremap [ctrlp]b :CtrlPBuffer<cr>
"}}}
endif "}}}
if count(g:settings.plugin_groups, 'navigation') "{{{
" Soporte para ack perl module
NeoBundle 'mileszs/ack.vim'
" Configuarción de ack.vim {{{
if executable('ag')
let g:ackprg = "ag --nogroup --column --smart-case --follow"
endif
map <leader>f :Ack<space>
"}}}
" Muestra el historial de deshacer en un gráfico. | Note: Mas simple que Gundo
NeoBundleLazy 'mbbill/undotree', {'autoload':{'commands':'UndotreeToggle'}}
" Configración de undotree {{{
let g:undotree_SplitLocation='botright'
let g:undotree_SetFocusWhenToggle=1
nnoremap <silent> <F5> :UndotreeToggle<CR>
"}}}
" Fast and Easy Find and Replace Across Multiple Files
NeoBundleLazy 'EasyGrep', {'autoload':{'commands':'GrepOptions'}}
" Configuración de EasyGrep {{{
let g:EasyGrepRecursive=1
let g:EasyGrepAllOptionsInExplorer=1
let g:EasyGrepCommand=1
nnoremap <leader>vo :GrepOptions<cr>
"}}}
" Nota: Personalmente uso vimfiler
" Explorador en Arbol (tree)
"NeoBundleLazy 'scrooloose/nerdtree', {'autoload':{'commands':['NERDTreeToggle','NERDTreeFind']}}
" Configuracion de nerdtree {{{
"let NERDTreeShowHidden=1
"let NERDTreeQuitOnOpen=0
"let NERDTreeShowLineNumbers=1
"let NERDTreeChDirMode=0
"let NERDTreeShowBookmarks=1
"let NERDTreeIgnore=['\.git','\.hg']
"let NERDTreeBookmarksFile='~/.vim/.cache/NERDTreeBookmarks'
"nnoremap <F2> :NERDTreeToggle<CR>
"nnoremap <F3> :NERDTreeFind<CR>
"}}}
" Muestra las etiquetas(tags) en una ventana, ordenada por ámbito(scope)
NeoBundleLazy 'majutsushi/tagbar', {'autoload':{'commands':'TagbarToggle'}}
" Configuracion de tagbar {{{
let g:tagbar_autofocus=1
let g:tagbar_autopreview = 1
let g:tagbar_iconchars = ['▶', '▼']
nnoremap <silent> <F9> :TagbarToggle<CR>
map <leader>rt :TagbarToggle<CR>
"}}}
" Movimientos faciles | Nota: Personalmente no lo uso.
" NeoBundle 'Lokaltog/vim-easymotion'
" TODO: buscar un mapping paraa vim-sneak
" jumps to any location specified by two characters
" NeoBundle 'justinmk/vim-sneak'
" Configuracion de vim-sneak {{{
" let g:sneak#streak = 1
"}}}
endif "}}}
if count(g:settings.plugin_groups, 'unite') "{{{
" Unir y crear interfaces de usuario
NeoBundle 'Shougo/unite.vim'
" Configuracion de unite.vim {{{
let bundle = neobundle#get('unite.vim')
function! bundle.hooks.on_source(bundle)
call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#filters#sorter_default#use(['sorter_rank'])
call unite#set_profile('files', 'context.smartcase', 1)
call unite#custom#source('line,outline','matchers','matcher_fuzzy')
endfunction
if s:is_windows
let g:unite_data_directory=$VIM.'/.cache/unite'
else
let g:unite_data_directory='~/.vim/.cache/unite'
endif
let g:unite_enable_start_insert=1
let g:unite_source_history_yank_enable=1
let g:unite_source_rec_max_cache_files=5000
let g:unite_prompt='» '
if executable('ag')
" let g:unite_source_rec_async_command='ag --nocolor --nogroup --skip-vcs-ignores --ignore ".cache" --ignore ".hg" --ignore ".svn" --ignore ".git" --ignore ".bzr" --hidden -g ""'
let g:unite_source_rec_async_command= 'ag --nocolor --nogroup --hidden -g ""'
let g:unite_source_grep_command='ag'
let g:unite_source_grep_default_opts='--nogroup --skip-vcs-ignores --nocolor --column'
let g:unite_source_grep_recursive_opt=''
elseif executable('ack')
let g:unite_source_grep_command='ack'
let g:unite_source_grep_default_opts='--no-heading --no-color -C4'
let g:unite_source_grep_recursive_opt=''
endif
function! s:unite_settings()
nmap <buffer> Q <plug>(unite_exit)
nmap <buffer> <esc> <plug>(unite_exit)
imap <buffer> <esc> <plug>(unite_exit)
imap <buffer> <C-j> <Plug>(unite_select_next_line)
imap <buffer> <C-k> <Plug>(unite_select_previous_line)
inoremap <silent><buffer><expr> <C-s> unite#do_action('split')
inoremap <silent><buffer><expr> <C-v> unite#do_action('vsplit')
inoremap <silent><buffer><expr> <C-t> unite#do_action('tabopen')
endfunction
autocmd FileType unite call s:unite_settings()
nmap <space> [unite]
nnoremap [unite] <nop>
if s:is_windows
nnoremap <silent> [unite]<space> :<C-u>Unite -toggle -auto-resize -buffer-name=mixed file_rec/async:! buffer file_mru bookmark<cr>
nnoremap <silent> [unite]f :<C-u>Unite -toggle -auto-resize -buffer-name=files file_rec/async:!<cr>
else
nnoremap <silent> [unite]<space> :<C-u>Unite -toggle -auto-resize -buffer-name=mixed file_rec/async:! buffer file_mru bookmark<cr>
nnoremap <silent> [unite]f :<C-u>Unite -toggle -auto-resize -buffer-name=files file_rec/async:!<cr>
endif
nnoremap <silent> [unite]e :<C-u>Unite -buffer-name=recent file_mru<cr>
nnoremap <silent> [unite]y :<C-u>Unite -buffer-name=yanks history/yank<cr>
nnoremap <silent> [unite]l :<C-u>Unite -auto-resize -buffer-name=line line<cr>
"nnoremap <silent> [unite]b :<C-u>Unite -auto-resize -auto-preview -buffer-name=buffers buffer<cr>
nnoremap <silent> [unite]b :<C-u>Unite -auto-resize -buffer-name=buffers buffer<cr>
nnoremap <silent> [unite]/ :<C-u>Unite -no-quit -buffer-name=search grep:.<cr>
nnoremap <silent> [unite]m :<C-u>Unite -auto-resize -buffer-name=mappings mapping<cr>
nnoremap <silent> [unite]s :<C-u>Unite -quick-match buffer<cr>
nnoremap <leader>nbu :Unite neobundle/update -vertical -no-start-insert<cr>
"}}}
" Busqueda en archivos recientes, como :browse old
NeoBundleLazy 'Shougo/neomru.vim', {'autoload':{'unite_sources':'file_mru'}}
" Cambiar de vim-airline theme.
NeoBundleLazy 'osyo-manga/unite-airline_themes', {'autoload':{'unite_sources':'airline_themes'}}
" Configuración de unite-airline_themes {{{
nnoremap <silent> [unite]a :<C-u>Unite -winheight=10 -auto-preview -buffer-name=airline_themes airline_themes<cr>
"}}}
" Cambiar de ColorScheme
NeoBundleLazy 'ujihisa/unite-colorscheme', {'autoload':{'unite_sources':'colorscheme'}}
" Configuración de unite-colorcheme {{{
nnoremap <silent> [unite]c :<C-u>Unite -winheight=10 -auto-preview -buffer-name=colorschemes colorscheme<cr>
"}}}
" tags source for unite.vim
NeoBundleLazy 'tsukkee/unite-tag', {'autoload':{'unite_sources':['tag','tag/file']}}
" Configuración de unite-tag {{{
nnoremap <silent> [unite]t :<C-u>Unite -auto-resize -buffer-name=tag tag tag/file<cr>
"}}}
" outline source for unite.vim
NeoBundleLazy 'Shougo/unite-outline', {'autoload':{'unite_sources':'outline'}}