-
Notifications
You must be signed in to change notification settings - Fork 22
/
plug-settings.vim
686 lines (594 loc) · 23.8 KB
/
plug-settings.vim
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
"
" File: .vimrc
" Author: Jake Zimmerman <[email protected]>
" Modified: 2015 Feb 10
"
" Adapted from Bram Moolenaar's example vimrc.
"
" This vimrc heavily favors Solarized colors. If you don't have your terminal
" configured to use these colors, you should head over to
"
" http://ethanschoonover.com/solarized
"
" and grab a color theme for your terminal (like iTerm2 or Terminal.app). If
" your terminal doesn't support theming, you'll want to manually change the
" appropriate colors.
"
" INSTALLATION INSTRUCTIONS
"
" Presumably, you've gotten your hands on this file because you forked my
" dotfiles repository. I keep all my Vim plugins as submodules, so after you
" clone you'll have to run
"
" $ git submodule init
" $ git submodule update
"
" to grab the required dependencies. Once you've done this, you can either
" manually move the `vimrc` file to `~/.vimrc` and the `vim/` folder to
" `~/.vim`, or you can be a little smarter and use a tool like rcm
" (https://github.com/thoughtbot/rcm) to manage this process.
"
" ISSUES
"
" If you encounter an issue while using this vimrc, please leave a *detailed*
" description of the issue and what'd you expect to happen in the issue
" tracker:
"
" https://github.com/jez/dotfiles/issues
"
" CONTRIBUTING
"
" These are my personal configuration files, so I might be a little hesitant
" to accept pull requests. If you've fixed a bug though, go ahead and I'll
" take a look at it.
scriptencoding utf-8
" ----- Pathogen and Plugin Settings ----------------------------------------
" Pathogen is in a non-standard location: modify the rtp to reflect that
set runtimepath+=~/.vim/bundle/pathogen
" Let Pathogen take over the runtimepath to make plugins in ~/.vim/bundle work
execute pathogen#infect()
" Generate all helptags on startup
Helptags
" ----- bling/vim-airline settings ----- {{{
" Fancy arrow symbols, requires a patched font
let g:airline_powerline_fonts = 1
" Show PASTE if in paste mode
let g:airline_detect_paste=1
" Don't take up extra space with +/-/~ of 0
let g:airline#extensions#hunks#non_zero_only = 1
" Limit wordcount to where it makes sense
let g:airline#extensions#wordcount#filetypes = '\vhelp|markdown|pandoc|rst|org'
" Always show statusbar
set laststatus=2
" Slightly modify the theme colors
let g:airline_solarized_normal_green = 1
" Fancy stuff in tabline as well
let g:airline#extensions#tabline#enabled = 1
" Don't try to re-init tmuxline every time (I've made special modifications)
let g:airline#extensions#tmuxline#enabled = 0
" Don't use tagbar
let g:airline#extensions#tagbar#enabled = 0
" Don't show line percentage
let g:airline_section_z = airline#section#create(['windowswap', 'obsession', 'linenr', 'maxlinenr', ' %3v'])
" }}}
" ----- Raimondi/delimitMate settings ----- {{{
let g:delimitMate_expand_cr = 1
let g:delimitMate_excluded_regions = ''
augroup mydelimitMate
au!
au FileType markdown let b:delimitMate_nesting_quotes = ["`"]
au FileType pandoc let b:delimitMate_nesting_quotes = ["`"]
au FileType tex let b:delimitMate_matchpairs = "(:),[:],{:},`:'"
au FileType html let b:delimitMate_matchpairs = "(:),[:],{:}"
au FileType eruby let b:delimitMate_matchpairs = "(:),[:],{:}"
au FileType python let b:delimitMate_nesting_quotes = ['"', "'"]
au FileType coffee let b:delimitMate_nesting_quotes = ['"', "'"]
augroup END
" }}}
" ----- alvan/vim-closetag ----- {{{
let g:closetag_filenames = '*.html,*.jsx,*.md,*.markdown,*.erb'
let g:closetag_close_shortcut = ''
" }}}
" ----- majutsushi/tagbar settings ----- {{{
" Open/close tagbar with \b
nnoremap <silent> <leader>b :TagbarToggle<CR>
" Always open tagbar for CoffeeScript files
"au! FileType coffee TagbarOpen
" Order tags based on file order; don't sort alphabetically
let g:tagbar_sort = 0
"autocmd BufEnter * nested :call tagbar#autoopen(0)
" Treat .ts in Vim as .ts in ctags
"let g:tagbar_type_typescript = {
" \ 'ctagstype': 'typescript',
" \ 'kinds': [
" \ 'c:classes',
" \ 'n:modules',
" \ 'f:functions',
" \ 'v:variables',
" \ 'v:varlambdas',
" \ 'm:members',
" \ 'i:interfaces',
" \ 'e:enums',
" \ ]
"\ }
" Treat .ts in Vim as .js in ctags
let g:tagbar_type_typescript = {
\ 'ctagstype': 'JavaScript',
\ 'kinds': [
\ 'f:functions',
\ 'c:classes',
\ 'm:members',
\ 'p:properties',
\ 'v:globals',
\ ]
\ }
let g:tagbar_type_javascript = {
\ 'ctagstype': 'js',
\ 'replace': 1,
\ 'ctagsbin': '~/bin/gtags',
\ 'kinds': [
\ 'c:class',
\ 'm:method',
\ 'p:property',
\ 'f:function',
\ 'o:object',
\ 'n:constant',
\ ],
\ }
let g:tagbar_type_coffee = {
\ 'ctagstype': 'CoffeeScript',
\ 'kinds': [
\ 'n:constants',
\ 'c:classes',
\ 'm:methods',
\ 'f:functions',
\ ]
\ }
if executable('ripper-tags')
let g:tagbar_type_ruby = {
\ 'kinds' : [
\ 'm:modules',
\ 'c:classes',
\ 'f:methods',
\ 'F:singleton methods',
\ 'C:constants',
\ 'a:aliases'
\ ],
\ 'ctagsbin': 'ripper-tags',
\ 'ctagsargs': '--fields=+n -f -'
\ }
endif
let g:tagbar_type_eruby = {
\ 'ctagstype' : 'markdown',
\ 'kinds' : [
\ 'h:Headings',
\ ]
\ }
" }}}
" ----- xolox/vim-easytags settings ----- {{{
set tags=./tags;,~/.vimtags
let g:easytags_events = ['BufReadPost', 'BufWritePost']
let g:easytags_async = 1
let g:easytags_dynamic_files = 2
let g:easytags_resolve_links = 1
let g:easytags_suppress_ctags_warning = 1
" \ 'stdout_opt': '-f -'
" \ 'stdout_opt': '-f -'
let g:easytags_languages = {
\ 'javascript.jsx': {
\ 'cmd': '~/bin/gtags'
\ },
\ 'ruby': {
\ 'cmd': 'ripper-tags'
\ }
\ }
" Easytags tag highlighting in pay-server is super slow.
if fnamemodify(getcwd(), ':p') =~# $HOME.'/stripe/pay-server'
let g:easytags_auto_highlight = 0
end
" }}}
" ----- neomake/neomake ----- {{{
let g:neomake_error_sign = {
\ 'text': '✘',
\ 'texthl': 'Error',
\ }
let g:neomake_warning_sign = {
\ 'text': '▲',
\ 'texthl': 'Todo',
\ }
let g:neomake_open_list = 0
" Use neomake only as a dependency for other plugins. Otherwise, prefer ALE.
let g:ale_emit_conflict_warnings = 0
" }}}
" ----- w0rp/ale ----- {{{
let g:ale_sign_error = '✘'
let g:ale_sign_warning = '▲'
let g:airline#extensions#ale#enabled = 1
" Open the loclist if there were errors
let g:ale_open_list = 1
" Only lint on save
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 0
let g:ale_lint_on_enter = 0
nnoremap <leader>et :ALEToggle<CR>
nnoremap <leader>ef :ALEFix<CR>
let g:ale_linters = {}
let g:ale_linters.tex = []
" We're using intero-neovim + Neomake for Haskell errors
let g:ale_linters.haskell = ['hlint']
" For stripe: use 'erubis' instead of 'erubylint'
let g:ale_linters.eruby = ['erubis']
" Use language server for Flow to try things out
let g:ale_linters.javascript = ['flow-language-server']
" CSS warnings were mostly chunderous
let g:ale_linters.css = []
let g:ale_linters.ruby = ['sorbet', 'ruby']
if fnamemodify(getcwd(), ':p') =~# $HOME.'/stripe/pay-server'
" Only use rubocop in pay-server (many rules don't make sense elsewhere)
let g:ale_linters.ruby += ['rubocop']
endif
" Be sure to never install 'prettier' globally, or you will be running
" prettier on all JavaScript files everywhere.
let g:ale_fixers = {}
let g:ale_fixers.javascript = ['prettier']
let g:ale_fixers.css = ['prettier']
let g:ale_fixers.pandoc = ['prettier']
let g:ale_fixers.markdown = ['prettier']
let g:ale_fixers.reason = ['refmt']
let g:ale_fixers.scala = ['scalafmt']
let g:ale_javascript_prettier_use_local_config = 1
let g:ale_rust_cargo_check_all_targets = 0
" Don't cd into folder first for shellcheck
let g:ale_sh_shellcheck_cd_buffer = 0
augroup aleMaps
au FileType javascript let g:ale_fix_on_save = 1
au FileType css let g:ale_fix_on_save = 1
au FileType pandoc let g:ale_fix_on_save = 1
au FileType markdown let g:ale_fix_on_save = 1
au FileType reason let g:ale_fix_on_save = 1
au FileType scala let g:ale_fix_on_save = 1
au FileType javascript nnoremap <silent> <buffer> <leader>t :ALEHover<CR>
augroup END
" ----- Folder-specific settings -----
if fnamemodify(getcwd(), ':p') =~# $HOME.'/stripe/sorbet'
" Use clangd for diagnostics
let g:ale_cpp_clangd_executable = '/usr/local/opt/llvm/bin/clangd'
let g:ale_linters.cpp = ['clangd']
" clangd is LSP-based so I could use :ALEHover / :ALEGoToDefinition, but
" I find it slower than rtags. See my vim-rtags setup below.
" Sorbet wants clang-format to put the #include for a *.h file with the same
" name as the current *.cpp / *.cc file at the top of the #include list
let g:ale_c_clangformat_options = '-style=file -assume-filename=%s'
let g:ale_fixers.cpp = ['clang-format']
augroup aleSorbetMaps
au FileType cpp let g:ale_fix_on_save = 1
augroup END
endif
" }}}
" ----- altercation/vim-colors-solarized settings ----- {{{
if $SOLARIZED ==? 'dark'
set background=dark
elseif $SOLARIZED ==? 'light'
set background=light
else
set background=dark
endif
" Set the colorscheme
colorscheme solarized
" }}}
" ----- airblade/vim-gitgutter settings ----- {{{
hi clear SignColumn
nnoremap <leader>ht :GitGutterLineHighlightsToggle<CR>
nnoremap <leader>hm :let g:gitgutter_diff_base = 'master'<CR>:e<CR>
nnoremap <leader>r :GitGutterUndoHunk<CR>
nnoremap <leader>s :GitGutterStageHunk<CR>
" overrides these bindings from vanilla Vim
nnoremap gp :GitGutterPrevHunk<CR>
nnoremap gn :GitGutterNextHunk<CR>
" Update signs faster. Proceed at own risk (might be expensive for you).
set updatetime=500
" I have a patched Solarized plugin that sets these groups up
hi! link GitGutterAdd gitgutterAdd
hi! link GitGutterChange gitgutterChange
hi! link GitGutterDelete gitgutterDelete
" }}}
" ----- tpope/vim-rhubarb settings ----- {{{
let g:github_enterprise_urls = ['https://git.corp.stripe.com']
" }}}
" ----- pangloss/vim-javascript ----- {{{
let g:javascript_plugin_flow = 1
" }}}
" ----- mxw/vim-jsx ----- {{{
" Syntax highlighting for JSX
let g:jsx_ext_required = 0
" }}}
" ----- flowtype/vim-flow ----- {{{
" Only use Flow for type information and jump to def
let g:flow#enable = 0
let g:flow#omnifunc = 0
augroup flowMaps
" Flow has an extra "expand aliases" setting that's not exposed through LSP
au FileType javascript nnoremap <silent> <buffer> <leader>T :FlowTypeExpandAliases<CR>
" Standalone jump to def works better than the LSP one w.r.t. imports
au FileType javascript nnoremap <silent> <buffer> gd :FlowJumpToDef<CR>
augroup END
" }}}
" ----- ntpeters/vim-better-whitespace ----- {{{
" Don't highlight whitespace in git commit messages (for diffs)...
let g:better_whitespace_filetypes_blacklist=['gitcommit']
" ... but strip it on save so that we're still safe
augroup vimBetterWhiteSpace
autocmd FileType gitcommit autocmd BufWritePre <buffer> StripWhitespace
augroup END
" Use Solarized colors for highlighting
highlight Extrawhitespace ctermbg=red guibg=#dc322f
" }}}
" ----- vim-pandoc/vim-pandoc ----- {{{
let g:pandoc#modules#disabled = ['folding', 'chdir']
let g:pandoc#syntax#codeblocks#embeds#langs = ['js=javascript', 'bash=zsh', 'hs=haskell']
let g:pandoc#syntax#conceal#blacklist = ['image', 'atx', 'codeblock_delim']
let g:pandoc#formatting#mode = 'h'
augroup pandocSettings
au!
" Auto-populate next line with things like blockquotes '>'
au FileType pandoc setlocal formatoptions+=c
" Indent and de-indent with TAB and SHIFT + TAB
au FileType pandoc nnoremap <TAB> >>
au FileType pandoc nnoremap <S-TAB> <<
au FileType pandoc inoremap <TAB> <C-t>
au FileType pandoc inoremap <S-TAB> <C-d>
augroup END
" }}}
" ----- vim-pandoc/vim-pandoc-syntax ----- {{{
let g:pandoc#syntax#use_definition_lists = 0
" }}}
" ----- mhinz/grepper ----- {{{
let g:grepper = {}
" Only use ag for grepping
let g:grepper.tools = ['ag']
" Highlight search matches (like it were hlsearch)
let g:grepper.highlight = 1
" Defalt to searching the entire repo; otherwise, search 'filecwd' (see help)
" let g:grepper.dir = 'repo,filecwd'
let g:grepper.dir = 'filecwd'
" Launch grepper with operator support
nmap s <plug>(GrepperOperator)
xmap s <plug>(GrepperOperator)
nnoremap <leader>a :Grepper<CR>
nnoremap <leader>* :Grepper -cword -noprompt<CR>
" }}}
" ----- romainl/vim-qf ----- {{{
" Because grepper no longer has keybindings in the Quickfix window
let g:qf_mapping_ack_style = 1
" }}}
" ----- neovimhaskell/haskell-vim ----- {{{
let g:haskell_indent_case_alternative = 1
let g:haskell_indent_let_no_in = 0
let g:haskell_indent_if = 2
let g:haskell_indent_before_where = 2
let g:haskell_classic_highlighting = 1
" }}}
" ----- sbdchd/neoformat ----- {{{
let g:neoformat_enabled_haskell = ['brittany', 'stylishhaskell']
augroup neoformatMaps
au!
" https://github.com/sbdchd/neoformat/issues/134
au BufWritePre *.hs try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | silent Neoformat | endtry
au FileType haskell let g:neoformat_run_all_formatters = 1
augroup END
" }}}
" ----- parsonsmatt/intero-neovim ----- {{{
let g:intero_start_immediately = 0
let g:intero_use_neomake = 1
augroup interoMaps
au!
au FileType haskell nnoremap <silent> <buffer> <leader>io :InteroOpen<CR><C-W>H
au FileType haskell nnoremap <silent> <buffer> <leader>ih :InteroHide<CR>
" au FileType haskell nnoremap <silent> <buffer> <leader>is :InteroStart<CR>
au FileType haskell nnoremap <silent> <buffer> <leader>ik :InteroKill<CR>
au FileType haskell nnoremap <silent> <buffer> <leader>ir :w \| :InteroReload<CR>
au FileType haskell nnoremap <silent> <buffer> <leader>il :InteroLoadCurrentModule<CR>
au FileType haskell nnoremap <silent> <buffer> <leader>if :InteroLoadCurrentFile<CR>
au FileType haskell map <silent> <buffer> <leader>t <Plug>InteroGenericType
au FileType haskell map <silent> <buffer> <leader>T <Plug>InteroType
au FileType haskell nnoremap <silent> <buffer> <leader>it :InteroTypeInsert<CR>
" like :InteroInfo, but without echo'ing the message
au FileType haskell noremap <silent> <buffer> <leader>ii :InteroSend<SPACE>:info<SPACE><C-R><C-W><CR>
au FileType haskell noremap <silent> <buffer> <leader>in :InteroSend<SPACE>:kind<SPACE><C-R><C-W><CR>
au FileType haskell nnoremap <silent> <buffer> gd :InteroGoToDef<CR>
au FileType haskell nnoremap <silent> <buffer> <leader>iu :InteroUses<CR>
" au FileType haskell nnoremap <silent> <buffer> <leader>ist :InteroSetTargets<SPACE>
" Yank the 'i' register so that we don't conflict with the unnamed register
au FileType haskell noremap <silent> <buffer> <leader>is "iy:InteroSend<SPACE><C-R>i<CR>
au FileType haskell noremap <silent> <buffer> <leader>ic :InteroSend<SPACE>:!clear<CR>
" Turn warnings off
au FileType haskell noremap <silent> <buffer> <leader>iw :InteroSend<SPACE>:set -w<CR>
" Turn warnings on
au FileType haskell noremap <silent> <buffer> <leader>iW :InteroSend<SPACE>:set -Wall<CR>
" hoogle bindings (stack install hoogle && hoogle generate)
" Query hoogle for what's under the cursor, and put it in the intero buffer
au FileType haskell noremap <silent> <buffer> <leader>iq :InteroSend<SPACE>:!hoogle<SPACE><C-R><C-W><CR>
" qUery hoogle for a User prompted string
au FileType haskell noremap <silent> <buffer> <leader>iu :InteroSend<SPACE>:!hoogle<SPACE>
augroup END
" }}}
" ----- junegunn/goyo.vim ----- {{{
nnoremap <silent> <leader>w :Goyo<CR>
" }}}
" ----- jez/vim-better-sml ----- {{{
" Uncomment to have same-width conceal characters
"let g:sml_greek_tyvar_show_tick = 1
"let g:sml_show_all_unused_warnings = 1
"let g:sml_hide_cmlib_unused_warnings = 1
"let g:sml_jump_to_def_new_tab = 1
"let g:sml_repl_backend = 'vimux'
let g:sml_auto_create_def_use = 'always'
augroup smlMaps
au!
au FileType sml nnoremap <leader>t :SMLTypeQuery<CR>
au FileType sml nnoremap gd :SMLJumpToDef<CR>
au FileType sml nnoremap <silent> <buffer> <leader>is :SMLReplStart<CR>
au FileType sml nnoremap <silent> <buffer> <leader>ik :SMLReplStop<CR>
au FileType sml nnoremap <silent> <buffer> <leader>if :SMLReplBuild<CR>
au FileType sml nnoremap <silent> <buffer> <leader>io :SMLReplOpen<CR>
au FileType sml nnoremap <silent> <buffer> <leader>iu :SMLReplUse<CR>
au FileType sml nnoremap <silent> <buffer> <leader>ic :SMLReplClear<CR>
au FileType sml nnoremap <silent> <buffer> <leader>ip :SMLReplPrintDepth<CR>
au FileType sml nnoremap <silent> <buffer> <leader>iz :SMLReplShell<CR>
augroup END
" Check for unused variables
"let g:syntastic_sml_checkers = ["smlnj", "unused"]
" }}}
" ----- raichoo/purescript-vim ----- {{{
let g:purescript_indent_case = 2
" }}}
" ----- FrigoEU/psc-ide-vim ----- {{{
augroup pscide
au!
au FileType purescript nnoremap <leader>t :<C-U>call PSCIDEtype(PSCIDEgetKeyword(), v:true)<CR>
au FileType purescript nnoremap <leader>S :<C-U>call PSCIDEapplySuggestion()<CR>
au FileType purescript nnoremap <leader>pT :<C-U>call PSCIDEaddTypeAnnotation(matchstr(getline(line(".")), '^\s*\zs\k\+\ze'))<CR>
au FileType purescript nnoremap <leader>pa :<C-U>call PSCIDEaddTypeAnnotation()<CR>
au FileType purescript nnoremap <leader>i :<C-U>call PSCIDEimportIdentifier(PSCIDEgetKeyword())<CR>
au FileType purescript nnoremap <leader>pr :<C-U>call PSCIDEload(0)<CR>
au FileType purescript nnoremap <leader>pp :<C-U>call PSCIDEpursuit(PSCIDEgetKeyword())<CR>
au FileType purescript nnoremap <leader>pc :<C-U>call PSCIDEcaseSplit("!")<CR>
au FileType purescript nnoremap <leader>pe :<C-U>call PSCIDEaddClause("")<CR>
au FileType purescript nnoremap <leader>qa :<C-U>call PSCIDEaddImportQualifications()<CR>
au FileType purescript nnoremap gd :<C-U>call PSCIDEgoToDefinition("", PSCIDEgetKeyword())<CR>
augroup END
" }}}
" ----- benmills/vimux ----- {{{
let g:VimuxOrientation = 'h'
" This is really 'width' because of the above setting
let g:VimuxHeight = '38'
let g:VimuxPromptString = '❯ '
" Focus the Vimux pane
nnoremap <silent> <leader>vi :VimuxInspectRunner<CR>
" TODO(jez) Start stripe.vim plugin/monorepo for Stripe-specific Vim config
function! PayTest() abort
let l:filename = expand('%')
let l:lineno = line('.')
call VimuxRunCommand('pay test '.l:filename.' -l '.l:lineno)
endfunction
augroup vimuxMappings
au!
au FileType javascript nnoremap <silent> <leader>if :VimuxRunCommand 'flow --color=always --message-width="$COLUMNS" \| less -F -X'<CR>
au FileType javascript nnoremap <silent> <leader>id :VimuxRunCommand 'yarn run flowdev'<CR>
au FileType javascript nnoremap <silent> <leader>ij :VimuxRunCommand 'yarn test '.@%<CR>
au FileType javascript nnoremap <silent> <leader>ik :VimuxRunCommand 'yarn run test-browser-tests-only'<CR>
au FileType javascript nnoremap <silent> <leader>ibk :VimuxRunCommand 'yarn run test-browser'<CR>
au FileType ruby nnoremap <silent> <leader>pt :w \| :call PayTest()<CR>
au FileType haskell nnoremap <silent> <leader>ib :VimuxRunCommand 'stack build'<CR>
au FileType purescript nnoremap <silent> <leader>ib :VimuxRunCommand 'pulp build'<CR>
au FileType rust nnoremap <silent> <leader>if :VimuxRunCommand 'cargo check \| less -F -X'<CR>
au FileType rust nnoremap <silent> <leader>ib :VimuxRunCommand 'cargo build \| less -F -X'<CR>
au FileType rust nnoremap <silent> <leader>id :VimuxRunCommand 'cargo doc --open'<CR>
au FileType rust nnoremap <silent> <leader>ir :VimuxRunCommand 'cargo run'<CR>
au FileType cpp let g:VimuxResetSequence = 'qa C-u'
" I have some shell aliases set up for building Sorbet
au FileType cpp nnoremap <silent> <buffer> <leader>if :VimuxRunCommand 'sb'<CR>
au FileType cpp nnoremap <silent> <buffer> <leader>it :VimuxRunCommand 'st'<CR>
au FileType scala nnoremap <silent> <buffer> <leader>if :VimuxRunCommand 'scalac "'.bufname("%").'"'<CR>
augroup END
" }}}
" ----- fzf ----- {{{
set runtimepath+=/usr/local/opt/fzf
set runtimepath+=/afs/cs/academic/class/15131-f15/opt/fzf
nnoremap <C-P> :FZF<CR>
" <CR> to open in new tab, <C-E> for current buffer
let g:fzf_action = {
\ 'ctrl-m': 'tabedit',
\ 'ctrl-e': 'edit',
\ 'ctrl-v': 'vsplit',
\ 'ctrl-s': 'split',
\ 'ctrl-r': 'read',
\}
" }}}
" ----- merlin ----- {{{
" TODO(jez) Set up Merlin again sometime.
" Conflicts with synstack viewer. Choose different key
nnoremap <leader>x :MerlinClearEnclosing<CR>
" }}}
" ----- autozimu/LanguageClient-neovim ----- {{{
let g:LanguageClient_diagnosticsDisplay = {
\ 1: {
\ "name": "Error",
\ "texthl": "ALEError",
\ "signText": "✘",
\ "signTexthl": "Error",
\ },
\ 2: {
\ "name": "Warning",
\ "texthl": "ALEWarning",
\ "signText": "▲",
\ "signTexthl": "Todo",
\ },
\ 3: {
\ "name": "Information",
\ "texthl": "ALEError",
\ "signText": "✘",
\ "signTexthl": "Error",
\ },
\ 4: {
\ "name": "Hint",
\ "texthl": "ALEWarning",
\ "signText": "➤",
\ "signTexthl": "Todo",
\ },
\ }
let g:LanguageClient_serverCommands = {}
augroup LanguageClient
au!
au FileType reason nnoremap <leader>cm :call LanguageClient_contextMenu()<CR>
au FileType reason nnoremap <silent> <leader>t :call LanguageClient#textDocument_hover()<CR>
au FileType reason nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
au FileType reason nnoremap <silent> <leader>io :copen<CR>
au FileType reason nnoremap <silent> <leader>ik :cclose<CR>
au FileType ruby nnoremap <silent> <leader>cm :call LanguageClient_contextMenu()<CR>
au FileType ruby nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
au FileType ruby nnoremap <silent> <leader>t :call LanguageClient#textDocument_hover()<CR>
if fnamemodify(getcwd(), ':p') =~# '^'.$HOME.'/stripe/pay-server\>'
" let g:LanguageClient_serverCommands.ruby = ['sorbet/scripts/typecheck_devel', '--lsp']
" let g:LanguageClient_serverCommands.ruby = ['pay', 'exec', 'scripts/bin/typecheck', '--lsp']
" Need to make sure that there's an optimized build of sorbet somewhere.
else
au FileType ruby let g:LanguageClient_serverCommands.ruby = ['sorbet', '--lsp', '-vvv', '--debug-log-file=/usr/local/var/sorbet.log', bufname('%')]
endif
augroup END
" }}}
" ----- lyuts/vim-rtags ----- {{{
let g:rtagsRcCmd = "rc --no-rc"
let g:rtagsUseDefaultMappings = 0
augroup rtagsMaps
au!
au FileType cpp noremap <leader>t :call rtags#SymbolInfo()<CR>
au FileType cpp noremap gd :call rtags#JumpTo(g:SAME_WINDOW)<CR>
au FileType cpp noremap gD :call rtags#JumpTo(g:NEW_TAB)<CR>
au FileType cpp noremap <leader>rJ :call rtags#JumpTo(g:SAME_WINDOW, { '--declaration-only' : '' })<CR>
au FileType cpp noremap <leader>rS :call rtags#JumpTo(g:H_SPLIT)<CR>
au FileType cpp noremap <leader>rV :call rtags#JumpTo(g:V_SPLIT)<CR>
au FileType cpp noremap <leader>rp :call rtags#JumpToParent()<CR>
au FileType cpp noremap <leader>rf :call rtags#FindRefs()<CR>
au FileType cpp noremap <leader>rF :call rtags#FindRefsCallTree()<CR>
au FileType cpp noremap <leader>rn :call rtags#FindRefsByName(input("Pattern? ", "", "customlist,rtags#CompleteSymbols"))<CR>
au FileType cpp noremap <leader>rs :call rtags#FindSymbols(input("Pattern? ", "", "customlist,rtags#CompleteSymbols"))<CR>
au FileType cpp noremap <leader>rr :call rtags#ReindexFile()<CR>
au FileType cpp noremap <leader>rl :call rtags#ProjectList()<CR>
au FileType cpp noremap <leader>rw :call rtags#RenameSymbolUnderCursor()<CR>
au FileType cpp noremap <leader>rv :call rtags#FindVirtuals()<CR>
au FileType cpp noremap <leader>rb :call rtags#JumpBack()<CR>
au FileType cpp noremap <leader>rh :call rtags#ShowHierarchy()<CR>
au FileType cpp noremap <leader>rC :call rtags#FindSuperClasses()<CR>
au FileType cpp noremap <leader>rc :call rtags#FindSubClasses()<CR>
au FileType cpp noremap <leader>rd :call rtags#Diagnostics()<CR>
augroup END
" }}}
" ----- Builtin Vim plugins ----- {{{
" When viewing directories, show nested tree mode
let g:netrw_liststyle=3
" Don't create .netrwhist files
let g:netrw_dirhistmax = 0
" }}}
" -----------------------------------------------------------------------------
" vim:ft=vim fdm=marker