-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
345 lines (282 loc) · 8.41 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
set re=0
call plug#begin()
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
"Plug 'neoclide/coc.nvim', {'branch': 'release'}
"Plug 'neoclide/coc-tsserver'
"Plug 'neoclide/coc-eslint'
"Plug 'neoclide/coc-json'
" Plug 'neoclide/coc-prettier'
"Plug 'neoclide/coc-css'
"Plug 'neoclide/coc-yaml'
"Plug 'marlonfan/coc-phpls'
"Plug 'fannheyward/coc-styled-components'
"Plug 'josa42/coc-go'
"Plug 'josa42/coc-sh'
"Plug 'fannheyward/coc-pyright'
Plug 'mhartington/oceanic-next'
Plug 'wbthomason/packer.nvim'
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lualine/lualine.nvim'
"Plug 'vim-airline/vim-airline'
"Plug 'vim-airline/vim-airline-themes'
" yavascript
Plug 'HerringtonDarkholme/yats.vim'
Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'html'] }
Plug 'leafgarland/typescript-vim'
" Plug 'bigfish/vim-js-context-coloring'
" Plug 'peitalin/vim-jsx-typescript'
Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
Plug 'yuezk/vim-js'
Plug 'maxmellon/vim-jsx-pretty'
" Plug 'prettier/vim-prettier'
" Allows fast commenting
Plug 'tpope/vim-commentary'
" Git
Plug 'airblade/vim-gitgutter'
" Plug 'tpope/vim-fugitive'
Plug 'sheerun/vim-polyglot'
" Adds the BD command for split view
Plug 'qpkorr/vim-bufkill'
" Fuzzy search
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'jparise/vim-graphql'
" QoL stuff
Plug 'vim-test/vim-test'
Plug 'alvan/vim-closetag'
" Coverage
Plug 'ruanyl/coverage.vim'
Plug 'dracula/vim', { 'name': 'dracula' }
Plug 'preservim/nerdtree'
Plug 'mg979/vim-visual-multi', {'branch': 'master'}
Plug 'github/copilot.vim'
call plug#end()
" set t_Co=256
set nocompatible
set nofoldenable
filetype off
filetype plugin indent on
set showcmd
set backspace=indent,eol,start
let mapleader = ','
"" Fix for tmux
if exists('$TMUX')
set background=dark
set t_Co=256
endif
if has('termguicolors')
" let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
" let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
"" Colors
" packadd! dracula_pro
" if !exists("g:syntax_on")
" syntax enable
" endif
" let g:dracula_colorterm = 0
" colorscheme dracula_pro_buffy
let g:oceanic_next_terminal_bold = 1
let g:oceanic_next_terminal_italic = 1
colorscheme OceanicNext
highlight Normal ctermbg=None
"" Defaults
set encoding=UTF-8
set number
set norelativenumber
set autoindent
set smartindent
set autowrite
set noswapfile
set nobackup
set nowritebackup
set ruler
au FocusLost * :wa
set hidden
set smarttab
"" Ignore
set wildmenu
set wildmode=list:full
set wildignore+=.hg,.git,.svn " Version control
set wildignore+=*.aux,*.out,*.toc " LaTeX intermediate files
set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg " binary images
set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest " compiled object files
set wildignore+=*.spl " compiled spelling word lists
set wildignore+=*.sw? " Vim swap files
set wildignore+=*.DS_Store " OSX bullshit
set wildignore+=*.luac " Lua byte code
set wildignore+=migrations " Django migrations
set wildignore+=go/pkg " Go static files
set wildignore+=go/bin " Go bin files
set wildignore+=go/bin-vagrant " Go bin-vagrant files
set wildignore+=*.pyc " Python byte code
set wildignore+=*.orig " Merge resolution files
set wildignore+=*/tmp/*,*.so,*.zip,*/node_modules/*,*/vendor/*
"" Search
set noshowmode
set hlsearch
set incsearch
set ignorecase
set showmatch
set ttyfast
"" speed up syntax highlighting
set nocursorcolumn
set tw=500
set tabstop=2
set shiftwidth=2
set wrap
set signcolumn=yes
set cmdheight=2
if &history < 1000
set history=50
endif
if &tabpagemax < 50
set tabpagemax=50
endif
if !empty(&viminfo)
set viminfo^=!
endif
if !&scrolloff
set scrolloff=1
endif
if !&sidescrolloff
set sidescrolloff=5
endif
"" Usable width for MD
au BufRead,BufNewFile *.md setlocal textwidth=80
"" vim commentry like st
map <leader>/ gcc
"" nmap <C-P> :Files %:p:h<CR>
nmap <C-p> :Files <CR>
nmap <F8> :TagbarToggle<CR>
nnoremap <Leader>b :ls<CR>:b<Space>
inoremap jj <ESC>
nmap mm :noh<CR>
"" Prettier Settings
" let g:prettier#autoformat_config_present = 1
" let g:prettier#autoformat_require_pragma = 0
" nmap <Leader>py <Plug>(Prettier)
set pastetoggle=<leader>z
"" vsplit
map <leader>] :vsplit<CR>
"" copypasta
noremap <Leader>y "*y
noremap <Leader>p "*p
noremap <Leader>Y "+y
noremap <Leader>P "+p
"" buffer switch
map <Leader>b :bn<cr>
map <Leader>B :bp<cr>
map <Leader>bb :bd<cr>
"" Better display for messages
"" Smaller updatetime for CursorHold & CursorHoldI
set updatetime=300
"" don't give |ins-completion-menu| messages.
set shortmess+=c
"set cursorline
""" -------------------------------
"" Plugin settings
""" -------------------------------
"" NERDTree
nmap <leader>q :NERDTreeToggle<cr>
"" GitGutter
" highlight DiffAdd guibg=DraculaGreen
" highlight DiffChange guibg=DraculaOrange
" highlight DiffDelete guibg=DraculaRed
"" vim-test settings
nmap <silent> t<C-n> :TestNearest<CR>
nmap <silent> t<C-f> :TestFile<CR>
nmap <silent> t<C-s> :TestSuite<CR>
"" Generics
nmap <silent> t<C-l> :TestLast<CR>
nmap <silent> t<C-g> :TestVisit<CR>
let test#strategy = {
\ 'nearest': 'neovim',
\ 'file': 'basic',
\ 'suite': 'basic',
\}
let test#javascript#jest#executable = "NODE_ENV=test npm test -- -u"
let g:test#javascript#runner = 'jest'
" Use `[c` and `]c` to navigate diagnostics
"nmap <silent> [c <Plug>(coc-diagnostic-prev)
"nmap <silent> ]c <Plug>(coc-diagnostic-next)
" Remap keys for gotos
"nmap <silent> gd <Plug>(coc-definition)
"nmap <silent> gy <Plug>(coc-type-definition)
"nmap <silent> gi <Plug>(coc-implementation)
"nmap <silent> gr <Plug>(coc-references)
" buffer switch
map <Leader>b :bn<cr>
map <Leader>B :bp<cr>
map <Leader>bb :bd<cr>
""" Golang settings
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'
let g:go_addtags_transform = "camelcase"
let g:go_highlight_operators = 1
let g:go_fmt_autosave = 1
let g:go_fmt_command = "goimports"
let g:go_def_mapping_enabled = 0
let g:go_auto_type_info = 1
let g:go_auto_sameids = 1
let g:go_highlight_array_whitespace_error = 1
let g:go_highlight_chan_whitespace_error = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_space_tab_error = 1
let g:go_highlight_trailing_whitespace_error = 0
let g:go_highlight_operators = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_parameters = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_generate_tags = 1
let g:go_highlight_string_spellcheck = 1
let g:go_highlight_format_strings = 1
let g:go_highlight_variable_declarations = 1
let g:go_highlight_variable_assignments = 1
let g:go_fmt_experimental = 1
let g:go_metalinter_autosave=1
let g:go_metalinter_autosave_enabled=['golint', 'govet', 'errcheck']
"autocmd FileType go nmap <leader>b :<C-u>call <SID>build_go_files()<CR>
autocmd FileType go nmap <leader>r <Plug>(go-run)
autocmd FileType go nmap <leader>t <Plug>(go-test)
autocmd FileType go noremap <F5> :GoDebugStart
autocmd FileType go noremap <Leader>b :GoDebugBreakpoint<CR>
autocmd FileType go noremap <Leader>n :GoDebugContinue<CR>
autocmd FileType go noremap <Leader>d <Plug>(go-def)
""" Coverage
let g:coverage_json_report_path = 'coverage/coverage-final.json'
"" Define the symbol display for covered lines
let g:coverage_sign_uncovered = '|'
"" Do not display signs on covered lines
let g:coverage_show_covered = 0
"" Display signs on uncovered lines
let g:coverage_show_uncovered = 1
"" Airline
" let g:airline_theme='dracula'
let g:airline_theme='oceanicnext'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#whitespace#enabled = 0
let g:airline#extensions#coc#enabled = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = ' '
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.maxlinenr = ' '
let g:airline_symbols.colnr = "c."
autocmd BufWritePost $MYVIMRC source % | echom "Reloaded " . $MYVIMRC | redraw
"nmap <leader>i :CocCommand tsserver.organizeImports<cr>
if has('nvim')
tmap <C-o> <C-\><C-n>
endif