-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
234 lines (190 loc) · 6.63 KB
/
vimrc
File metadata and controls
234 lines (190 loc) · 6.63 KB
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
""""""""""
" Config variables used urrywhurr
let softab = "on"
let tabsize = 2
let arrowkeys = "off"
let gui_font = "Monaco:h12"
let mapleader = ","
" Matchit for better delimiter matching
runtime macros/matchit.vim
source ~/.vimrc-defaults
source ~/.vimrc-helpers
source ~/.vimrc-keymaps
call plug#begin('~/.vim/plugged')
" These need to come first, in this order
"Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clang-completer' }
"Plug 'ycm-core/YouCompleteMe', { 'do': 'python3 ./install.py --clang-completer --ts-completer' }
" Use the Tabnine fork - their completion engine is straight fire
" ensure node and npm are installed (or remove ts-completer)
" Deprecated. nvim-only now
"Plug 'tabnine/YouCompleteMe', { 'do': 'python3 ./install.py --clang-completer --ts-completer' }
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'neoclide/coc-tsserver', {'do': 'pnpm install'}
Plug 'neoclide/coc-json', {'do': 'pnpm install'}
Plug 'neoclide/coc-yaml', {'do': 'pnpm install'}
Plug 'neoclide/coc-prettier', {'do': 'pnpm install'}
Plug 'neoclide/coc-eslint', {'do': 'pnpm install'}
Plug 'neoclide/coc-snippets', {'do': 'pnpm install'}
Plug 'neoclide/coc-lists', {'do': 'pnpm install'}
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
"Plug 'arcticicestudio/nord-vim'
Plug 'github/copilot.vim'
Plug 'godlygeek/tabular'
Plug 'Raimondi/delimitMate'
"Plug 'scrooloose/nerdcommenter'
"Plug 'scrooloose/nerdtree'
Plug 'dense-analysis/ale'
Plug 'sjl/gundo.vim'
Plug 'bkad/CamelCaseMotion'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'airblade/vim-gitgutter'
"Plug 'msanders/snipmate.vim'
Plug 'koron/nyancat-vim'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb' " GBrowse handler (github)
Plug 'tpope/vim-surround'
Plug 'tpope/vim-endwise'
" CodeClimate :)
"Plug 'wfleming/vim-codeclimate'
Plug 'tpope/vim-rails', { 'for': 'ruby' }
Plug 'vim-ruby/vim-ruby', { 'for': 'ruby' }
"Plug 'rainerborene/vim-reek', { 'for': 'ruby' }
Plug 'kchmck/vim-coffee-script', { 'for': 'coffee'}
Plug 'Keithbsmiley/swift.vim', { 'for': 'swift' }
Plug 'tbastos/vim-lua', { 'for': 'lua' }
Plug 'mustache/vim-mustache-handlebars', { 'for': 'html.mustache' }
Plug 'othree/javascript-libraries-syntax.vim', { 'for': ['javascript', 'html'] }
call plug#end()
" Source *after* plugins to ensure local autocmd > plugin autocmd
source ~/.vimrc-au
" default: 'jquery,underscore,backbone'
let g:used_javascript_libs = 'jquery,handlebars'
""""""""""
" Oddly, vim-coffeee-script requires these to be here
" and completely breaks if they're pre-enabled by vimrc-defaults
filetype plugin indent on
syntax on
""""""""""
" vim-nord
"let g:nord_cursor_line_number_background = 1
" Remove the underline from enabling cursorline:
"highlight clear CursorLine
" Reek
let g:reek_always_show = 0
let g:reek_on_loading = 0
""""""""""
" vim-airline
let g:airline_powerline_fonts = 0
let g:airline_theme='deus'
"let g:airline_theme='nord'
""""""""""
" NetRW
let g:netrw_banner = 1 " enable/disable banner
let g:netrw_liststyle = 3 " tree view
"let g:netrw_browse_split = 2 " open new files in vertical split
""""""""""
" Delimit Mate
let delimitMate_visual_leader = ","
" Ruby-specific(ish); avoids lolwut with '<' and '>'
autocmd FileType ruby let b:delimitMate_matchpairs="(:),[:],{:}"
autocmd FileType javascript let b:delimitMate_matchpairs="(:),[:],{:}"
""""""""""
" Fugitive
"set statusline+=%{fugitive#statusline()}
""""""""""
" ALE
let g:ale_lint_on_text_changed = 'normal' " Only lint while in normal mode
let g:ale_lint_on_insert_leave = 1 " Automatically lint when leaving insert mode
"let g:ale_linters_explicit = 1 " Only use linters that are explicitly set
"let g:ale_fix_on_save = 1 " Automatically fix files on save
" Override 'prettier' fixer to use prettierd
let g:ale_javascript_prettier_executable = 'prettierd'
let g:ale_typescript_prettier_executable = 'prettierd'
let g:ale_json_prettier_executable = 'prettierd'
let g:ale_yaml_prettier_executable = 'prettierd'
let g:ale_javascript_eslint_executable = 'eslintd'
let g:ale_typescript_eslint_executable = 'eslintd'
let g:ale_fixers = {
\ 'css': ['prettier'],
\ 'json': ['prettier'],
\ 'yaml': ['prettier'],
\ 'javascript': ['eslint'],
\ 'typescript': ['eslint'],
\ 'typescriptreact': ['eslint'],
\}
"""""""""
" eslint_d
let $ESLINT_D_PPID = getpid()
let g:ale_javascript_eslint_executable = 'eslint_d'
let g:ale_javascript_eslint_use_global = 1
"""""""""
" Copilot
let g:copilot_no_tab_map = v:true " Disable tab mapping for Copilot
inoremap <expr> <C-J> copilot#Accept("\<C-J>")
""""""""""
" COC
let g:airline#extensions#coc#enabled = 1 " Enable airline extension
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
"inoremap <expr> <Tab> coc#pum#visible() ? coc#pum#next(1) : "\<Tab>"
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ CheckBackspace() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(1) : "\<S-Tab>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
""""""""""
" GUndo
map <silent> w <Plug>CamelCaseMotion_w
map <silent> b <Plug>CamelCaseMotion_b
map <silent> e <Plug>CamelCaseMotion_e
sunmap w
sunmap b
sunmap e
""""""""""
" General Config
" Reduce font line height
"set lsp=0
if exists('pastetoggle')
set pastetoggle=<F3>
endif
""""""""""
" Support chruby
set shell=$SHELL
""""""""""
" Support fzf
set rtp+=/usr/local/opt/fzf
" Strip Windows line endings
map <F7> :perldo s/\cM//
" Clear searches with C/
map <C-/> :nohl <CR>
" i_CTRL-X_CTRL-U matchers for minitest
set completefunc=syntaxcomplete#Complete
" Improve buffer resizing. alt-shift and hold the key
:nmap <esc>> :vertical res +1^M
:nmap <esc>< :vertical res -1^M
:nmap <esc>+ :res +1^M
:nmap <esc>- :res -1^M
"set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
"set statusline+=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
"colorscheme ir_black
"colorscheme nord " For vim-airline
colorscheme cotingale
set t_Co=256
set t_ut=
" git stuff
"augroup vim_config
" autocmd FileType gitrebase call LoadGitrebaseBindings()
"augroup END