-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
202 lines (170 loc) · 5.47 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
set nocompatible
filetype off
set ignorecase smartcase
set hidden hlsearch
set fileformat=unix
set title ttyfast
set textwidth=111
set sw=2 ts=2 sts=2 expandtab
set novisualbell noerrorbells
set smartindent
set showcmd number
set wrap linebreak
set nocursorline
set splitbelow splitright
" Filetype handling
filetype plugin indent on
call plug#begin()
Plug 'dahu/SearchParty' " NOTE: remember to comment <c-l> mapping out of plugged/SearchParty/searchparty_user_maps.vim
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'ruanyl/vim-gh-line'
Plug 'editorconfig/editorconfig-vim'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-fugitive'
Plug 'Yggdroot/vim-mark'
Plug 'tpope/vim-unimpaired'
Plug 'jremmen/vim-ripgrep'
Plug 'tpope/vim-eunuch'
Plug 'diepm/vim-rest-console'
" colors
Plug 'mnishz/colorscheme-preview.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'NLKNguyen/papercolor-theme'
Plug 'morhetz/gruvbox'
Plug 'relastle/bluewery.vim'
Plug 'chriskempson/tomorrow-theme', { 'rtp': 'vim' }
Plug 'christoomey/vim-tmux-navigator'
Plug 'pangloss/vim-javascript' " JavaScript suppor
Plug 'leafgarland/typescript-vim' " TypeScript syntax
Plug 'maxmellon/vim-jsx-pretty' " JS and JSX syntax
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
colorscheme desert
set background=dark
"""""""""""""""""""""""""""""""""""""""""""""
" This makes the time before it updates your hover faster
set updatetime=300
" Highlight the symbol under cursor on CursorHold
autocmd CursorHold * silent call CocActionAsync('highlight')
" Remap keys for gotos
nmap gd <Plug>(coc-definition)
nmap <leader>gy <Plug>(coc-type-definition)
nmap <leader>gi <Plug>(coc-implementation)
nmap <leader>gr <Plug>(coc-references)
" Use `[g` and `]g` to navigate diagnostics
nmap <leader>q :CocList diagnostics<CR>
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" Remap for autofix the problem under the cursor
nnoremap <silent> <leader>qf <Plug>(coc-fix-current)
" Remap for rename current word
nmap <leader>gn <Plug>(coc-rename)
" Use :OR to organize the imports
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript setlocal formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder.
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Use K to show documentation in floating window.
nnoremap <silent> K :call ShowDocumentation()<CR>
" Show hover when provider exists, fallback to vim's builtin behavior.
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('definitionHover')
else
call feedkeys('K', 'in')
endif
endfunction
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Apply AutoFix to problem on the current line.
nmap <leader>cf <Plug>(coc-fix-current)
nmap <leader>f :call CocAction('runCommand', 'eslint.executeAutofix')<CR>
" Open the files tree with the current file highlighted
nnoremap <leader>e :CocCommand explorer --reveal<CR>
"""""""""""""""""""""""""""""""""""""""""""""
" fzf
nnoremap <leader>ff :FZF<CR>
nnoremap <leader>fo :History<CR>
nnoremap <leader>fb :Buffers<CR>
" custom window resize
nnoremap <C-Q><Up> <C-W>+
nnoremap <C-Q><Down> <C-W>-
nnoremap <C-Q><Left> <C-W><
nnoremap <C-Q><Right> <C-W>>
" rainbow
let g:rainbow_active = 0 "enable via :RainbowToggle
set wildignore+=*/.git/*,*/node_modules,*/build,*/target
highlight CurrentWord term=bold cterm=bold
highlight CurrentWordTwins term=underline cterm=underline gui=underline
highlight Search cterm=bold ctermfg=black ctermbg=LightGray
" VRC
let g:vrc_trigger='<Leader>j'
let g:vrc_syntax_highlight_response=1
let g:vrc_curl_opts={
\'--include': '',
\'--location': '',
\'--show-error': '',
\'--silent': '',
\ '-k': '',
\}
let g:vrc_auto_format_response_enabled=1
let g:vrc_auto_format_response_patterns={ 'json': "jq --sort-keys '.'" }
set backupdir=~/.vim/backup/
set directory=~/.vim/swap/
set undodir=~/.vim/undo/
map <ScrollWheelDown> <C-E>
map <ScrollWheelUp> <C-Y>
" Mouse support
set mouse=a
set ttymouse=sgr
set balloonevalterm
" Styled and colored underline support
let &t_AU = "\e[58:5:%dm"
let &t_8u = "\e[58:2:%lu:%lu:%lum"
let &t_Us = "\e[4:2m"
let &t_Cs = "\e[4:3m"
let &t_ds = "\e[4:4m"
let &t_Ds = "\e[4:5m"
let &t_Ce = "\e[4:0m"
" Strikethrough
let &t_Ts = "\e[9m"
let &t_Te = "\e[29m"
" Truecolor support
let &t_8f = "\e[38:2:%lu:%lu:%lum"
let &t_8b = "\e[48:2:%lu:%lu:%lum"
let &t_RF = "\e]10;?\e\\"
let &t_RB = "\e]11;?\e\\"
" Bracketed paste
let &t_BE = "\e[?2004h"
let &t_BD = "\e[?2004l"
let &t_PS = "\e[200~"
let &t_PE = "\e[201~"
" Cursor control
let &t_RC = "\e[?12$p"
let &t_SH = "\e[%d q"
let &t_RS = "\eP$q q\e\\"
let &t_SI = "\e[5 q"
let &t_SR = "\e[3 q"
let &t_EI = "\e[1 q"
let &t_VS = "\e[?12l"
" Focus tracking
let &t_fe = "\e[?1004h"
let &t_fd = "\e[?1004l"
execute "set <FocusGained>=\<Esc>[I"
execute "set <FocusLost>=\<Esc>[O"
" Window title
let &t_ST = "\e[22;2t"
let &t_RT = "\e[23;2t"
" vim hardcodes background color erase even if the terminfo file does
" not contain bce. This causes incorrect background rendering when
" using a color theme with a background color in terminals such as
" kitty that do not support background color erase.
let &t_ut=''