-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
265 lines (221 loc) · 6 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
set runtimepath+=/usr/share/vim/vimfiles
syntax on
set clipboard+=unnamedplus
set nowrap
set tabstop=4
set number
set shiftwidth=4
set expandtab
set listchars=eol:¬,trail:·
set foldmethod=syntax
set nofoldenable
set background=dark
set tabline='showtabline'
set hlsearch
set fileformat=unix
let g:loaded_matchparen = 1
let g:loaded_matchit = 1
let g:loaded_logiPat = 1
let g:loaded_rrhelper = 1
let g:loaded_tarPlugin = 1
" let g:loaded_man = 1
let g:loaded_gzip = 1
let g:loaded_zipPlugin = 1
let g:loaded_2html_plugin = 1
let g:loaded_shada_plugin = 1
let g:loaded_spellfile_plugin = 1
let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1
let g:loaded_tutor_mode_plugin = 1
let g:loaded_remote_plugins = 1
let g:indentLine_char = '¦'
let startify_change_to_dir = 0
let g:ale_sign_error = '×'
let g:ale_sign_warning = '*'
let g:airline#extensions#tabline#enabled = 1
let g:ale_set_highlights = 1
let g:ale_fix_on_save = 1
let g:ale_completion_enabled = 1
let g:loaded_matchparen=2
let g:bookmark_sign = '#'
let g:ale_fixers = {
\ 'javascript': ['prettierd', 'eslint_d'],
\ 'typescript': ['prettierd', 'eslint_d'],
\ }
highlight LineNr ctermfg=32
"highlight clear ALEErrorSign
"highlight clear ALEWarningSign
highlight DiffAdd ctermfg=230 ctermbg=10
highlight DiffChange ctermfg=230 ctermbg=96
highlight DiffDelete ctermfg=230 ctermbg=196
call plug#begin('~/.vim/plugged')
"syntax
Plug 'github/copilot.vim'
Plug 'posva/vim-vue'
Plug 'jelera/vim-javascript-syntax'
Plug 'othree/html5.vim'
Plug 'othree/html5-syntax.vim'
Plug 'mxw/vim-jsx'
Plug 'hail2u/vim-css3-syntax'
Plug 'leafgarland/typescript-vim'
Plug 'peitalin/vim-jsx-typescript'
Plug 'jparise/vim-graphql'
Plug 'ap/vim-css-color'
Plug 'styled-components/vim-styled-components'
"editor
Plug 'mhinz/vim-startify'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'majutsushi/tagbar'
Plug 'terryma/vim-expand-region'
Plug 'scrooloose/nerdtree'
Plug 'dbeniamine/cheat.sh-vim'
"tools
Plug 'w0rp/ale'
Plug 'Raimondi/delimitMate'
Plug 'Yggdroot/indentLine'
Plug 'MattesGroeger/vim-bookmarks'
Plug 'ludovicchabant/vim-gutentags'
"search
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
"git
Plug 'junegunn/gv.vim'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'xuyuanp/nerdtree-git-plugin'
"autocomplete
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2'
Plug 'ncm2/ncm2-jedi'
Plug 'ncm2/ncm2-bufword'
Plug 'ncm2/ncm2-path'
"navigation
Plug 'easymotion/vim-easymotion'
Plug 'christoomey/vim-tmux-navigator'
"utilities
Plug 'tpope/vim-surround'
Plug 'terryma/vim-multiple-cursors'
Plug 'alvan/vim-closetag'
Plug 'tpope/vim-repeat'
Plug 'scrooloose/nerdcommenter'
Plug 'yaroot/vissort'
Plug 'sk1418/HowMuch'
call plug#end()
imap jj <Esc>
let mapleader=" "
nmap <leader><tab> :GFiles<CR>
nmap <leader>/ :Ag
nmap <leader>? :HowIn
nmap <leader><leader><tab> :Ag <C-R><C-W><CR>
vmap <leader><leader><tab> y:Ag <C-r>"<CR>
nmap <leader><leader><leader> :NERDTreeFind<CR>:vertical resize 30<CR>
nmap <leader>n :cn<CR>
nmap <leader>m :cp<CR>
nmap <leader>s :Gstatus<CR>
nmap <leader>c :!git commit -a<CR>
nmap <leader>b :Git blame<CR>
nmap <leader>d :Gdiff<CR>
nmap <leader>h :GV<CR>
nmap ! :tab split<CR> :Startify<CR>
nmap <leader>1 :tab split<CR>
nmap \ :tabn<CR>
nmap \| :tabp<CR>
nmap <leader>sc :setlocal spell spelllang=en_us<CR>
nmap / :/\c
nmap <leader>ws :%s/\s\+$//<CR>
nmap <leader>W :ALEFix<CR>
nmap W :w<CR>
nmap <leader>t :TagbarToggle<CR>
nmap // :nohlsearch<CR>
nmap __ :split<CR>
nmap ++ :vs<CR>
nmap )) :res 10000<CR>
nmap (( :vertical resize 10000<CR>
nmap () :wincmd =<CR>
map Y y
map X "+c
map P "+p
map <leader>f *
vmap <leader>f y/<C-R>"<CR>
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
"search
function! s:build_quickfix_list(lines)
call setqflist(map(copy(a:lines), '{ "filename": v:val }'))
copen
cc
endfunction
let g:fzf_action = {
\ 'ctrl-q': function('s:build_quickfix_list'),
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' }
let $FZF_DEFAULT_OPTS = '--bind ctrl-a:select-all'
let g:CheatSheetFrameworks = {
\ 'python' : ['python', 'tensorflow', 'keras', 'pandas', 'numpy', 'py'],
\ 'javascript' : ['javascript', 'node', 'vue', 'typescript'],
\ 'js' : ['javascript', 'node', 'vue', 'typescript'],
\}
"tags
set tags=~/.cache/tags/.tags;,.tags
let g:gutentags_project_root = ['.git']
let g:gutentags_ctags_tagfile = '.tags'
let g:gutentags_modules = ['ctags']
let g:gutentags_cache_dir = expand('~/.cache/tags')
let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q']
let g:gutentags_ctags_extra_args += ['--output-format=e-ctags']
let g:tagbar_ctags_bin = '/usr/bin/ctags'
let g:tagbar_type_typescript = {
\ 'ctagstype': 'typescript',
\ 'kinds': [
\ 'c:class',
\ 'n:namespace',
\ 'f:function',
\ 'G:generator',
\ 'v:variable',
\ 'l:local',
\ 'm:method',
\ 'p:property',
\ 'i:interface',
\ 'g:enum',
\ 't:type',
\ 'a:alias',
\ ],
\'sro': '.',
\ 'kind2scope' : {
\ 'c' : 'class',
\ 'n' : 'namespace',
\ 'i' : 'interface',
\ 'f' : 'function',
\ 'G' : 'generator',
\ 'm' : 'method',
\ 'p' : 'property',
\},
\ }
"autocomplete
autocmd BufEnter * call ncm2#enable_for_buffer()
set completeopt=menuone,noselect,noinsert
set shortmess+=c
inoremap <c-c> <ESC>
imap <expr><TAB>
\ pumvisible() ? "\<C-n>" : "\<TAB>"
imap <expr><s-tab>
\ pumvisible() ? "\<C-p>" : "\<TAB>"
let ncm2#popup_delay = 5
let ncm2#complete_length = [[1, 1]]
let g:ncm2#matcher = 'substrfuzzy'
let g:jedi#auto_initialization = 1
let g:jedi#completions_enabled = 0
let g:jedi#auto_vim_configuration = 0
let g:jedi#smart_auto_mappings = 0
let g:jedi#popup_on_dot = 0
let g:jedi#completions_command = ""
let g:jedi#show_call_signatures = "1"
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif