-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
694 lines (566 loc) · 20.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
" vim: fdm=marker ts=4 sts=4 sw=4 fdl=0
" => Essential {{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has('vim_starting')
" disable vi compatible mode
set nocompatible
" handwritten stuff is synchronized on git
set runtimepath+=~/dotfiles/vim
" NeoBundle, required
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#begin(expand('~/.vim/bundle/'))
NeoBundleFetch 'Shougo/neobundle.vim'
filetype off
NeoBundleCheck
"}}}
" => Load Plugins {{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
NeoBundle 'http://lh-vim.googlecode.com/svn/vim-lib/trunk', {'name': 'lh-vim-lib'}
NeoBundle 'LucHermitte/local_vimrc', {'depends': 'lh-vim-lib'}
NeoBundle 'nelstrom/vim-visual-star-search'
"NeoBundle 'MarcWeber/vim-addon-local-vimrc'
" vimproc {{{
NeoBundle 'Shougo/vimproc.vim', {
\ 'build': {
\ 'mac': 'make -f make_mac.mak',
\ 'unix': 'make -f make_unix.mak',
\ 'cygwin': 'make -f make_cygwin.mak',
\ 'windows': '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\nmake.exe" make_msvc32.mak',
\ },
\ } "}}}
NeoBundle 'pydave/AsyncCommand'
NeoBundle 'tpope/vim-dispatch'
NeoBundle 'Shougo/unite.vim'
NeoBundle 'Shougo/unite-session'
NeoBundle 'Shougo/neomru.vim'
NeoBundle 'hrsh7th/vim-unite-vcs'
NeoBundleLazy 'Shougo/unite-outline', {'autoload':{'unite_sources':'outline'}}
NeoBundleLazy 'tsukkee/unite-tag', {'autoload':{'unite_sources':['tag','tag/file']}}
NeoBundleLazy 'ujihisa/unite-haskellimport', {'autoload':{'unite_sources':'haskellimport'}}
NeoBundle 'hrsh7th/vim-versions'
NeoBundle 'bling/vim-airline'
NeoBundle 'tpope/vim-surround'
NeoBundle 'tpope/vim-speeddating'
NeoBundle 'tpope/vim-repeat'
NeoBundle 'Raimondi/delimitMate'
NeoBundle 'Chiel92/vim-autoformat'
NeoBundle 'vim-scripts/vcscommand.vim'
NeoBundle 'junegunn/vim-easy-align'
NeoBundle 'tommcdo/vim-exchange'
NeoBundle 'kana/vim-textobj-user'
NeoBundle 'kana/vim-textobj-function'
NeoBundle 'Julian/vim-textobj-variable-segment'
NeoBundle 'coderifous/textobj-word-column.vim'
NeoBundle 'wellle/targets.vim'
NeoBundle 'SirVer/ultisnips'
NeoBundle 'honza/vim-snippets'
NeoBundle 'Valloric/YouCompleteMe', { 'vim_version':'7.3.584'}
NeoBundleLazy 'scrooloose/syntastic', {'autoload' : {'filetypes' : ['python', 'javascript', 'c', 'c++'] } }
NeoBundle 'mhinz/vim-signify'
NeoBundle 'sjl/gundo.vim'
NeoBundleLazy 'sethwoodworth/vim-cute-python', {'autoload' : {'filetypes' : ['python'] } }
"NeoBundleLazy 'Twinside/vim-haskellConceal', {'autoload' : {'filetypes' : ['haskell'] } }
NeoBundleLazy 'eagletmt/ghcmod-vim', {'autoload' : {'filetypes' : ['haskell'] } }
NeoBundleLazy 'zah/nimrod.vim', {'autoload' : {'filetypes' : ['nim'] } }
NeoBundle 'vim-scripts/Boost-Build-v2-BBv2-syntax'
NeoBundle 'sickill/vim-pasta'
NeoBundle 'jpalardy/vim-slime'
"NeoBundle 'nathanaelkane/vim-indent-guides'
NeoBundle 'Yggdroot/indentLine'
NeoBundle 'chrisbra/SudoEdit.vim'
NeoBundle 'chrisbra/NrrwRgn'
NeoBundle 'vimwiki'
call neobundle#end()
filetype plugin indent on " required!
"}}}
" => General {{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" sets how many lines of history VIM has to remember
set history=1000
" reload an open file if it is changed from outside
set autoread
" don't update the display while executing macros
set lazyredraw
" vim sets terminal title
set title
" sane default
set encoding=utf-8
set termencoding=utf-8
set fileencodings=ucs-bom,utf-8,default,latin1
set helplang=en
" remove trailing whitespaces on save
" autocmd BufRead,BufWritePre * if ! &bin | silent! %s/\s\+$// | endif
" search from current directory upwards for ctags file
set tags+=tags;/
" ignore the following file endings completely
set wildignore=*.swp,*.o,*.oo,*.pyc,*.info,*.aux,*.dvi,*.bbl,*.blg
set wildignore+=*.brf,*.cb,*.ind,*.idx,*.ilg,*.inx,*.out,*.toc
set wildignore+=*/tmp/*,*.so,*.a,*.la,*.zip,*.bz2,*.gz,*.tar
" give the following file endings less priority
set suffixes=.bak,~,.log,.h,.P
" save central undo files
set undofile
set undodir=~/.vim/tmp/undo
set backup
set backupdir=~/.vim/tmp/backup
set noswapfile
au BufEnter * let g:bufcwd = getcwd()
"}}}
" => VIM user interface {{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" enable syntax highlighting
syntax enable
" set colors and font according to preferences
"colorscheme desert_mod
colorscheme desert
" set guifont=Anonymous\ Pro\ 11
" set guifont=Anonymous\ Pro\ for\ Powerline\ 11
set guifont=DejaVu\ Sans\ Mono\ 11
" Set 7 lines to the cursor - when moving vertically using j/k
set so=7
" allow mouse interaction
set mouse=a
" enable the pop-up-list for command and argument completion in
" command mode
set wildmenu
set wildmode=list:longest,full
" show the current cursor position (line,column and file %)
set ruler
" do not ask for confirmation after displaying messages
set shortmess+=filmnrxoOtT
" make the command bar 2 lines high
set cmdheight=2
" highlight current line
set cursorline
" let backspace traverse line breaks and delete indentations
" in indentation step size (tabstop)
set backspace=indent,eol,start
" enable case sensitive searches when the search term contains
" upper case characters, otherwise not
set ignorecase
set smartcase
" highlight search results
set hlsearch
" search as you type
set incsearch
if executable('ag')
set grepprg=ag\ --nogroup\ --column\ --smart-case\ --nocolor\ --follow\ --ignore\ tags
set grepformat=%f:%l:%c:%m
elseif executable('ack')
set grepprg=ack\ --nogroup\ --column\ --smart-case\ --nocolor\ --follow\ $*
set grepformat=%f:%l:%c:%m
elseif executable('ack-grep')
set grepprg=ack\ --nogroup\ --column\ --smart-case\ --nocolor\ --follow\ $*
set grepformat=%f:%l:%c:%m
endif
" enable auto indentation and set tab width
set smartindent
set shiftwidth=4
set softtabstop=4
set tabstop=4
" always convert tabs to spaces
set expandtab
" wrap lines to indentation
"set breakindent
"set breakindentopt=shift:-1
" set \m to default for regexes
" set magic " this is the default
" always draw a status line
set laststatus=2
" the mode is indicated by powerline if available
set noshowmode
" enable extended % matching
runtime macros/matchit.vim
" highlight matching ()[]{}...
set showmatch
" time to wait until swap file is written / cursorhold autocomd is fired
set updatetime=300
" the timeout for key combinations and mappings
set timeoutlen=300
" Writes to the unnamed register also writes to the * and + registers. This
" makes it easy to interact with the system clipboard
if has ('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
endif
" do not beep or flash
" important: t_vb= must be set in gvimrc as well!
set noerrorbells
set visualbell
set t_vb=
if has ('balloon_eval')
set balloondelay=100
endif
set noequalalways
set list listchars=tab:¦\ ,trail:˽
"set listchars=tab:▶\ ,eol:★
"set listchars+=trail:◥
set listchars+=extends:❯ "〉
set listchars+=precedes:❮
if has('conceal')
set conceallevel=1
set listchars+=conceal:Δ
endif
" Mark lines that have been wrapped
set showbreak=↪
if has('gui_running')
" open maximized
"set lines=999 columns=9999
"if s:is_windows
" autocmd GUIEnter * simalt ~x
"endif
set guioptions+=t "tear off menu items
set guioptions-=T "toolbar icons
"if s:is_macvim
" set gfn=Ubuntu_Mono:h14
" set transparency=2
"endif
"if s:is_windows
" set gfn=Ubuntu_Mono:h10
"endif
"if has('gui_gtk')
" set gfn=Ubuntu\ Mono\ 11
"endif
else
if $COLORTERM == 'gnome-terminal'
set t_Co=256 "why you no tell me correct colors?!?!
endif
if $TERM_PROGRAM == 'iTerm.app'
" different cursors for insert vs normal mode
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
endif
endif
"}}}
" => Functions {{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! NeatFoldText() "{{{2
let line = ' ' . substitute(getline(v:foldstart), '^\s*"\?\s*\|\s*"\?\s*{{' . '{\d*\s*', '', 'g') . ' '
let lines_count = v:foldend - v:foldstart + 1
let lines_count_text = '| ' . printf("%10s", lines_count . ' lines') . ' |'
let foldchar = split(filter(split(&fillchars, ','), 'v:val =~# "fold"')[0], ':')[-1]
let foldtextstart = strpart('+' . repeat(foldchar, v:foldlevel*2) . line, 0, (winwidth(0)*2)/3)
let foldtextend = lines_count_text . repeat(foldchar, 8)
let length = strlen(substitute(foldtextstart . foldtextend, '.', 'x', 'g'))
return foldtextstart . repeat(foldchar, winwidth(0)-length) . foldtextend
endfunction
set foldtext=NeatFoldText()
" }}}2
" function! TStwo() and TSfour() {{{
function! TStwo()
setlocal tabstop=2 softtabstop=2 shiftwidth=2
endfunction
function! TSfour()
setlocal tabstop=4 softtabstop=4 shiftwidth=4
endfunction
"}}}
" function! LastModified() {{{
" If buffer modified, update any 'Last modified: ' in the first 20 lines.
" 'Last modified: ' can have up to 10 characters before (they are retained).
" Restores cursor and window position using save_cursor variable.
function! LastModified()
if &modified
let save_cursor = getpos(".")
let n = min([20, line("$")])
keepjumps exe '1,' . n . 's#^\(.\{,10}TimeStamp \).*#\1' .
\ strftime('%a %b %d, %Y %I:%M%p') . '#e'
call histdel('search', -1)
call setpos('.', save_cursor)
endif
endfunction "}}}
function! Preserve(command) "{{{
" preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" do the business:
execute a:command
" clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction "}}}
function! StripTrailingWhitespace() "{{{
call Preserve("%s/\\s\\+$//e")
endfunction "}}}
function! EnsureExists(path) "{{{
if !isdirectory(expand(a:path))
call mkdir(expand(a:path))
endif
endfunction "}}}
"}}}
" => Keymappings {{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let mapleader = ","
let g:mapleader = ","
" Y yanks from cursor to $
map Y y$
" If you like control + vim direction key to navigate
" windows then perform the remapping
"
noremap <C-J> <C-W>j
noremap <C-K> <C-W>k
noremap <C-H> <C-W>h
noremap <C-L> <C-W>l
" lookup vim help for the word under cursor
noremap <leader>h : help <C-R>=expand("<cword>")<CR><CR><C-W>p
" overwrite selection and preserve the default register
vnoremap <leader>p "_dP
" fast saving
nnoremap <leader>w :w!<cr>
" press j+k to escape from insert mode
inoremap jk <ESC>
inoremap kj <ESC>
" append current line to the next
nnoremap <leader>J :m+1<CR>kJ
" }}}
" => Command-line Mode keymappings {{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Bash like keys for the command line. These resemble personal zsh mappings
cnoremap <c-a> <home>
cnoremap <c-e> <end>
" Ctrl-[hl]: Move left/right by word
cnoremap <c-h> <s-left>
cnoremap <c-l> <s-right>
" Ctrl-Space: Show history
cnoremap <c-@> <c-f>
cnoremap <c-j> <down>
cnoremap <c-k> <up>
cnoremap <c-f> <left>
cnoremap <c-g> <right>
" Ctrl-Delete: Delete previous word. HACK ALERT! Ctrl-Delete sends d in iTerm2
cnoremap <c-d> <c-w>
" Ctrl-v: Paste
cnoremap <c-v> <c-r>"
" }}}
" => Plugins section starts here {{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" -> vim-dispatch {{{
" When using ,b on normal mode, it will compile the project
nmap <LEADER>b :Make! -j<CR>
nmap <LEADER>B :Make! clean <bar> :Make! -j<CR> "}}}
" -> delimitMate {{{
let g:delimitMate_smart_quotes = 1
let g:delimitMate_excluded_ft = 'unite'
"}}}
" -> Unite {{{2
" Use the fuzzy matcher for everything
call unite#filters#matcher_default#use(['matcher_fuzzy'])
" Use the rank sorter for everything
call unite#filters#sorter_default#use(['sorter_rank'])
" Set up some custom ignores
call unite#custom#source('file_rec,file_rec/async,file_mru,file,buffer,grep',
\ 'ignore_pattern', join([
\ '\.git/',
\ '\.svn/',
\ '\.hg/',
\ 'build/',
\ 'BoostBuild/',
\ '\.o$',
\ '\.so$',
\ '\.a$',
\ '\.la$',
\ '\.hi$',
\ '\tags$',
\ ], '\|'))
" Map space to the prefix for Unite
nnoremap [unite] <Nop>
nmap <space> [unite]
" General fuzzy search
nnoremap <silent> [unite]<space> :<C-u>Unite
\ -buffer-name=files buffer file_mru bookmark file_rec/async<CR>
" Quick registers
nnoremap <silent> [unite]r :<C-u>Unite -buffer-name=register register<CR>
" Quick buffer and mru
nnoremap <silent> [unite]u :<C-u>Unite -buffer-name=buffers buffer file_mru<CR>
" Quick yank history
nnoremap <silent> [unite]y :<C-u>Unite -buffer-name=yanks history/yank<CR>
" Quick outline
nnoremap <silent> [unite]o :<C-u>Unite -vertical -buffer-name=outline outline<cr>
" Quick sessions (projects)
nnoremap <silent> [unite]p :<C-u>Unite -buffer-name=sessions session<CR>
" Quick sources
nnoremap <silent> [unite]a :<C-u>Unite -buffer-name=sources source<CR>
" Quick snippet
" nnoremap <silent> [unite]s :<C-u>Unite -buffer-name=snippets snippet<CR>
" Quickly switch lcd
nnoremap <silent> [unite]d
\ :<C-u>Unite -buffer-name=change-cwd -default-action=lcd directory_mru<CR>
" Quick file search
nnoremap <silent> [unite]f :<C-u>Unite -buffer-name=files file_rec/async file/new<CR>
" Quick grep from cwd
nnoremap <silent> [unite]g :<C-u>Unite -buffer-name=grep grep:.<CR>
" Grep for word under cursor
nnoremap <silent> [unite]; :<C-u>UniteWithCursorWord -buffer-name=grep grep<CR>
nnoremap <silent> [unite]t :<C-u>Unite -auto-resize -buffer-name=tag tag tag/file<cr>
" Quick help
nnoremap <silent> [unite]h :<C-u>Unite -buffer-name=help help<CR>
" Quick line using the word under cursor
nnoremap <silent> [unite]l :<C-u>UniteWithCursorWord -buffer-name=search_file line<CR>
" Quick MRU search
nnoremap <silent> [unite]m :<C-u>Unite -buffer-name=mru file_mru<CR>
" Quick find
nnoremap <silent> [unite]n :<C-u>Unite -buffer-name=find find:.<CR>
" Quick commands
nnoremap <silent> [unite]c :<C-u>Unite -buffer-name=commands command<CR>
" Quick bookmarks
nnoremap <silent> [unite]b :<C-u>Unite -buffer-name=bookmarks bookmark<CR>
" Quick vcs
nnoremap <silent> [unite]v :<C-u>Unite -buffer-name=vcslog vcs/log<CR>
" Quick buffer change
nnoremap <silent> [unite]s :<C-u>Unite -quick-match buffer<CR>
nnoremap <C-p> :Unite file_rec/async<cr>
let g:unite_enable_start_insert = 1
let g:unite_split_rule = "botright"
let g:unite_data_directory = '~/.vim/tmp/unite'
let g:unite_update_time = 200
let g:unite_source_file_mru_limit = 10
let g:unite_cursor_line_highlight = 'TabLineSel'
" let g:unite_abbr_highlight = 'TabLine'
" For ack.
if executable('ag')
let g:unite_source_grep_command = 'ag'
let g:unite_source_grep_default_opts = '--noheading --nocolor --smart-case'
let g:unite_source_grep_recursive_opt = ''
elseif executable('ack-grep')
let g:unite_source_grep_command = 'ack-grep'
" Match whole word only. This might/might not be a good idea
let g:unite_source_grep_default_opts = '--no-heading --no-color -w'
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 -w'
let g:unite_source_grep_recursive_opt = ''
endif
nnoremap <silent> [unite]/ :<C-u>Unite -buffer-name=ag grep:.<cr>
nnoremap <silent> [unite], :<C-u>UnitePrevious<cr>
nnoremap <silent> [unite]. :<C-u>UniteNext<cr>
"}}}2
" NeoBundle 'bling/vim-airline' "{{{
" when only one tab is open, show all of the open buffers
" let g:airline#extensions#tabline#enabled = 1
" user powerline patched fonts
let g:airline_powerline_fonts = 1
" dict of configurably unicode symbols. mmmmmmmmmm
let g:airline_symbols = {}
let g:airline_symbols.brach = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.whitespace = 'Ξ' "}}}
" NeoBundle 'junegunn/vim-easy-align' "{{{
vnoremap <Enter> <Plug>(EasyAlign)
nnoremap <Leader>a <Plug>(EasyAlign) "}}}
" NeoBundle 'SirVer/ultisnips' "{{{
"let g:UltiSnipsExpandTrigger="<TAB>"
"let g:UltiSnipsJumpForwardTrigger="<TAB>"
"let g:UltiSnipsJumpBackwardTrigger="<s-TAB>"
"let g:UltiSnipsSnippetsDir='~/.vim/snippets'
function! g:UltiSnips_Complete()
call UltiSnips#ExpandSnippet()
if g:ulti_expand_res == 0
if pumvisible()
return "\<C-n>"
else
call UltiSnips_JumpForwards()
if g:ulti_jump_forwards_res == 0
return "\<TAB>"
endif
endif
endif
return ""
endfunction
au BufEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsListSnippets="<c-e>"
"}}}
" NeoBundle 'Valloric/YouCompleteMe', { 'vim_version':'7.3.584'} "{{{
let g:ycm_confirm_extra_conf = 0
let g:ycm_allow_changing_updatetime = 0
let g:ycm_complete_in_comments_and_strings=1
"let g:ycm_key_list_select_completion=['<C-n>', '<Down>']
"let g:ycm_key_list_previous_completion=['<C-p>', '<Up>']
let g:ycm_filetype_blacklist={'unite': 1}
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_collect_identifiers_from_tags_files = 1
au BufEnter * let g:ycm_extra_conf_vim_data = ['g:bufcwd']
nnoremap <leader>m :YcmCompleter GoToImprecise<CR>
"let g:ycm_key_invoke_completion = '<C-TAB>' "}}}
" NeoBundleLazy 'scrooloose/syntastic', {'autoload' : {'filetypes' : ['python', 'javascript', 'c', 'c++'] } } "{{{
let g:syntastic_error_symbol='⧰'
let g:syntastic_warning_symbol='⚠'
let g:syntastic_auto_jump=0 " Do not jump to first error on save/open
let g:syntastic_stl_format = '[%E{⧰: #%e l%fe}%B{, }%W{⚠: #%w %fw}]'
let g:syntastic_r_lint_styles = 'list(spacing.indentation.notabs, spacing.indentation.evenindent)'
"}}}
" NeoBundle 'mhinz/vim-signify' "{{{
let g:signify_sign_overwrite=0 "}}}
" NeoBundle 'sjl/gundo.vim' "{{{
nnoremap <F5> :GundoToggle<CR> "}}}
" NeoBundle 'junegunn/vim-easy-align' "{{{
" Start interactive EasyAlign in visual mode
vmap <Enter> <Plug>(EasyAlign)
" Start interactive EasyAlign with a Vim movement
nmap <Leader>a <Plug>(EasyAlign) "}}}
" NeoBundle 'LucHermitte/local_vimrc' "{{{
let g:local_vimrc="vimrc.local" "}}}
" NeoBundle 'nathanaelkane/vim-indent-guides' "{{{
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1 "}}}
" NeoBundle 'jpalardy/vim-slime' "{{{
let g:slime_target = "tmux"
" }}}
" => filetype specific stuff {{{
" -> Python {{{
" NeoBundleLazy 'sethwoodworth/vim-cute-python', {'autoload' : {'filetypes' : ['python'] } }
"}}}
" -> Nim {{{
fun! JumpToDef()
if exists("*GotoDefinition_" . &filetype)
call GotoDefinition_{&filetype}()
else
exe "norm! \<C-]>"
endif
endf
" Jump to tag
"nnoremap <M-g> :call JumpToDef()<cr>
"inoremap <M-g> <esc>:call JumpToDef()<cr>i
"}}}
" -> Haskell {{{
" NeoBundleLazy 'vim-scripts/Superior-Haskell-Interaction-Mode-SHIM', {'autoload' : {'filetypes' : ['haskell'] } }
" NeoBundleLazy 'Twinside/vim-haskellConceal', {'autoload' : {'filetypes' : ['haskell'] } }
" NeoBundleLazy 'eagletmt/ghcmod-vim', {'autoload' : {'filetypes' : ['haskell'] } }
let g:ghcmod_ghc_options = ['-fglasgow-exts']
" This will set the variables that QuickFix needs
" in order to compile, if you are on a project that
" has a cabal file, use "cabal build", otherwise
" use "ghc --make" on the current file
function! QuickFixHaskell()
let l:cabalFilePresent = filereadable(glob('*.cabal'))
if l:cabalFilePresent
setl makeprg=cabal\ build
else
let l:currentFile = expand('%')
if !exists('b:qfOutputdir')
let b:qfOutputdir = tempname()
call mkdir(b:qfOutputdir)
endif
let &l:makeprg = 'ghc --make % -outputdir ' . b:qfOutputdir
endif
setl errorformat=
\%-Z\ %#,
\%W%f:%l:%c:\ Warning:\ %m,
\%E%f:%l:%c:\ %m,
\%E%>%f:%l:%c:,
\%+C\ \ %#%m,
\%W%>%f:%l:%c:,
\%+C\ \ %#%tarning:\ %m,
endfunction
"}}}
" Bundle 'vim-scripts/bufkill.vim'
" }}}