forked from thoughtbot/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvimrc.local
113 lines (84 loc) · 2.53 KB
/
vimrc.local
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
" Disable Ale
augroup ale
autocmd!
set updatetime=300
augroup END
" Use relativenumber
if v:version > 702
set number
set relativenumber
set numberwidth=4
endif
" Complete terms from all buffers
set complete=.,w,b,u,t,i
" Search for the word under the cursor
" Normal mode: K
nmap K :grep "\b<C-R><C-W>\b"<CR>
set textwidth=80
set colorcolumn=+1
" Snippets are activated by Shift+Tab
iunmap <S-Tab>
let g:snippetsEmu_key = "<S-Tab>"
set wildmenu wildmode=longest:full,full
" Run specs using vim-dispatch
let g:rspec_command = "Dispatch rspec {spec}"
nmap <Leader>g :silent !termite --exec gitsh &> /dev/null &<CR><CR>:redraw!<CR>
nmap <Leader>z :silent !termite &> /dev/null &<CR>:redraw!<CR>
" Easier than "+
nmap cp "+y
nmap cv "+p
nmap cV "+P
" Indent HTML tags
let g:html_indent_inctags = "p,li"
set background=dark
highlight Pmenu ctermfg=black ctermbg=white guibg=white
" zsh will reset PATH
set shell=/usr/bin/sh
let test#strategy = 'dispatch'
set mouse=a
au BufRead,BufNewFile *.sbt set filetype=scala
au BufRead,BufNewFile *.tf.tmpl set filetype=terraform
au BufRead,BufNewFile *.bats set filetype=bash
set shortmess+=c
set cmdheight=2
let g:markdown_fenced_languages = ['scala']
" Disable elm-vim keybindings and formattign
let g:elm_setup_keybindings = 0
let g:elm_format_autosave = 0
""""""""""""""""
" COC.NVIM
" autocmd BufWrite <buffer> :call CocAction('format')
nmap <leader>e <Plug>(coc-diagnostic-next)
nmap gr <Plug>(coc-references)
nmap <leader>d :<C-u>CocList diagnostics<CR>
nmap gf <Plug>(coc-definition)
nmap gp :call CocAction('format')<CR>
" Always show sign column
set signcolumn=yes
" Trigger completion
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> for confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
" inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" nmap <leader>rn <Plug>(coc-rename)
" Use <leader>? for show documentation in preview window
nnoremap <silent> <leader>? :call <SID>show_documentation()<CR>
function! s:show_documentation()
if &filetype == 'vim'
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
function ShowCocStatus()
let info = get(b:, 'coc_diagnostic_info', {})
if empty(info) | return 'Compiled' | endif
let msgs = []
if get(info, 'error', 0)
call add(msgs, 'E' . info['error'])
endif
if get(info, 'warning', 0)
call add(msgs, 'W' . info['warning'])
endif
return join(msgs, ' ') . ' ' . get(g:, 'coc_status', '')
endfunction