-
Notifications
You must be signed in to change notification settings - Fork 76
/
vimrc.bundles
239 lines (199 loc) · 8 KB
/
vimrc.bundles
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
" ----------------------------------------------------------------------------
" Vim-Plug:Plgin management and setting
" ----------------------------------------------------------------------------
call plug#begin('~/.vim/bundle')
let mapleader = ','
let g:mapleader = ','
let s:vim8 = has('patch-8.0.0039') && exists('*job_start')
" ----------------------------------------------------------------------------
" vim plugin bundle control, command model
" :PlugInstall install
" :PlugInstall! update
" :PlugClean remove plugin not in list
" ----------------------------------------------------------------------------
" theme
Plug 'lifepillar/vim-solarized8'
Plug 'ishan9299/nvim-solarized-lua'
Plug 'tomasr/molokai'
Plug 'morhetz/gruvbox'
Plug 'haishanh/night-owl.vim'
Plug 'Mofiqul/vscode.nvim', {'branch': 'main'}
Plug 'folke/tokyonight.nvim', { 'branch': 'main' }
" display
Plug 'nvim-lualine/lualine.nvim'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'akinsho/bufferline.nvim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-tree/nvim-tree.lua'
nnoremap <leader>e :NvimTreeToggle<CR>
nnoremap <c-o> :NvimTreeFindFile<CR>
" nvim lsp
Plug 'neovim/nvim-lspconfig'
Plug 'williamboman/mason.nvim', {'branch': 'main'}
Plug 'folke/lsp-trouble.nvim', {'branch': 'main'}
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
" fast move
Plug 'easymotion/vim-easymotion'
Plug 'unblevable/quick-scope'
let g:qs_lazy_highlight = 1
"Plug 'ruanyl/vim-gh-line'
" fast edit
Plug 'github/copilot.vim', {'branch': 'release'}
Plug 'honza/vim-snippets'
Plug 'ruanyl/vim-es2015-snippets'
Plug 'tpope/vim-repeat'
Plug 'gcmt/wildfire.vim'
Plug 'jiangmiao/auto-pairs'
Plug 'alvan/vim-closetag'
Plug 'terryma/vim-multiple-cursors'
Plug 'tpope/vim-surround'
Plug 'kaplanz/nvim-retrail'
Plug 'scrooloose/nerdcommenter'
Plug 'editorconfig/editorconfig-vim'
Plug 'kevinhwang91/nvim-bqf', {'branch': 'main'}
Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
let g:coc_global_extensions = [
\'coc-yank',
\'coc-spell-checker',
\'coc-word',
\'coc-snippets',
\'coc-prettier',
\'coc-lists',
\'coc-highlight',
\'coc-tsserver',
\'coc-docthis',
\'coc-html',
\'coc-git',
\]
nmap gc <Plug>(coc-git-commit)
nmap gs <Plug>(coc-git-chunkinfo)
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> auto-select the first completion item and notify coc.nvim to
" format on enter, <cr> could be remapped by other vim plugin
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! s:show_documentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
inoremap <silent><expr> <C-j> pumvisible() ? "\<C-n>" : "\<C-j>"
inoremap <silent><expr> <C-k> pumvisible() ? "\<C-p>" : "\<C-k>"
nmap <silent> <C-]> <Plug>(coc-definition)
nmap <silent> gr <Plug>(coc-references)
nnoremap <silent> K :call <SID>show_documentation()<CR>
" scroll float window
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
" Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of language server.
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)
vmap <leader>a <Plug>(coc-codeaction-selected)<CR>
nmap <leader>a <Plug>(coc-codeaction-selected)<CR>
nmap <Leader>bj <Plug>(coc-bookmark-next)
nmap <Leader>bk <Plug>(coc-bookmark-prev)
" Remap for rename current word
nmap <leader>rn <Plug>(coc-rename)
nmap <Leader>rf <Plug>(coc-refactor)
nmap <Leader>ff <Plug>(coc-format)
vmap <Leader>ff <Plug>(coc-format-selected)
let g:coc_snippet_next = '<c-j>'
let g:coc_snippet_prev = '<c-k>'
nmap <silent> <leader>j <Plug>(coc-diagnostic-next)
nmap <silent> <leader>k <Plug>(coc-diagnostic-prev)
autocmd CursorHold * silent call CocActionAsync('highlight')
command! -nargs=0 Prettier :CocCommand prettier.formatFile
" CocList for mru, buffers and files
"nnoremap <leader>m :CocList mru<CR>
nnoremap <leader>m :Telescope oldfiles theme=dropdown<CR>
nnoremap <leader>b :Telescope buffers theme=dropdown<CR>
nnoremap <c-p> :Telescope find_files theme=dropdown<CR>
" coc-docthis
nnoremap <leader><leader>d :CocCommand docthis.documentThis<CR>
"Plug 'folke/persistence.nvim'
" Make sure rm -rf ~/.local/share/nvim/sessions
Plug 'Shatur/neovim-session-manager'
"Plug 'rmagatti/auto-session'
Plug 'plasticboy/vim-markdown'
Plug 'szw/vim-maximizer'
Plug 'mbbill/undotree'
nnoremap <leader>h :UndotreeToggle<CR>
"Plug 'ruanyl/vim-sort-imports', {'for': ['javascript', 'typescript', 'typescript.tsx', 'typescriptreact']}
let g:import_sort_auto = 1
Plug 'moll/vim-bbye'
Plug 'tpope/vim-fugitive'
Plug 'vim-scripts/BufOnly.vim'
" search
Plug 'mhinz/vim-grepper'
"Load local plugins
if filereadable(expand("~/.vim/vimrc.bundles.local"))
source ~/.vim/vimrc.bundles.local
endif
call plug#end()
" ----------------------------------------------------------------------------
" vim-grepper
" ----------------------------------------------------------------------------
nnoremap <Leader><Leader>a :GrepperRg<space>
" ----------------------------------------------------------------------------
" vim-maximizer
" ----------------------------------------------------------------------------
let g:maximizer_set_default_mapping = 0
nnoremap <tab> :MaximizerToggle<CR>
" ----------------------------------------------------------------------------
" vim-easymotion
" ----------------------------------------------------------------------------
map <space> <Plug>(easymotion-s2)
" map / <Plug>(easymotion-sn)
" omap / <Plug>(easymotion-tn)
let g:EasyMotion_smartcase = 0
" ----------------------------------------------------------------------------
" wildfire.vim
" Mapping: <Enter>
" ----------------------------------------------------------------------------
let g:wildfire_objects = {
\ "*" : ["i'", 'i"', "i)", "i]", "i}", "ip"],
\ "html,xml" : ["at"],
\ }
let g:wildfire_fuel_map = "<ENTER>"
let g:wildfire_water_map = "<BS>"
" ----------------------------------------------------------------------------
" vim-closetag
" ----------------------------------------------------------------------------
let g:closetag_filenames = "*.html,*.xhtml,*.phtml,*.xml,*.js,*.tsx"
" Disables auto-close if not in a valid region (based on filetype)
let g:closetag_regions = {
\ 'typescript.tsx': 'jsxRegion,tsxRegion',
\ 'javascript.jsx': 'jsxRegion',
\ 'typescriptreact': 'jsxRegion,tsxRegion',
\ 'javascriptreact': 'jsxRegion',
\ }
" ----------------------------------------------------------------------------
" vim-markdown
" ----------------------------------------------------------------------------
let g:vim_markdown_folding_disabled=1
let g:vim_markdown_no_default_key_mappings=1
let g:vim_markdown_frontmatter=1
" ----------------------------------------------------------------------------
" vim-bbye
" ----------------------------------------------------------------------------
nnoremap qq :Bdelete<cr>
" ----------------------------------------------------------------------------
" BufOnly.vim
" ----------------------------------------------------------------------------
nnoremap <silent> qo :BufOnly<CR>