2021-03-04 13:54:23 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
call plug#begin()
|
|
|
|
|
|
|
|
Plug 'tpope/vim-commentary'
|
|
|
|
Plug 'tpope/vim-surround'
|
|
|
|
Plug 'jiangmiao/auto-pairs'
|
|
|
|
|
|
|
|
Plug 'SirVer/ultisnips'
|
|
|
|
Plug 'honza/vim-snippets'
|
|
|
|
|
2021-03-04 14:11:17 +01:00
|
|
|
" style
|
|
|
|
Plug 'arcticicestudio/nord-vim'
|
|
|
|
|
2021-03-04 13:54:23 +01:00
|
|
|
" js/ts/...
|
|
|
|
Plug 'pangloss/vim-javascript'
|
|
|
|
Plug 'leafgarland/typescript-vim'
|
|
|
|
Plug 'peitalin/vim-jsx-typescript'
|
|
|
|
|
|
|
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
|
|
|
let g:coc_global_extensions = [
|
|
|
|
\ 'coc-tsserver',
|
|
|
|
\ 'coc-html',
|
|
|
|
\ 'coc-json',
|
|
|
|
\ 'coc-pyright'
|
|
|
|
\ ]
|
|
|
|
|
|
|
|
call plug#end()
|
|
|
|
|
2021-03-04 14:11:17 +01:00
|
|
|
|
2021-03-04 13:54:23 +01:00
|
|
|
" snippets
|
|
|
|
let g:UltiSnipsExpandTrigger="<tab>"
|
|
|
|
|
2021-03-04 14:11:17 +01:00
|
|
|
|
2021-03-04 13:54:23 +01:00
|
|
|
" coc
|
|
|
|
" if isdirectory('./node_modules') && isdirectory('./node_modules/prettier')
|
|
|
|
" let g:coc_global_extensions += ['coc-prettier']
|
|
|
|
" endif
|
|
|
|
if isdirectory('./node_modules') && isdirectory('./node_modules/eslint')
|
|
|
|
let g:coc_global_extensions += ['coc-eslint']
|
|
|
|
endif
|
|
|
|
|
2021-03-05 17:41:53 +01:00
|
|
|
" coc shortcuts
|
|
|
|
nnoremap <silent> gK :call CocAction('doHover')<CR>
|
|
|
|
nmap <silent> gd <Plug>(coc-definition)
|
|
|
|
nmap <silent> gy <Plug>(coc-type-definition)
|
|
|
|
nmap <silent> gr <Plug>(coc-references)
|
|
|
|
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
|
|
|
nmap <silent> ]g <Plug>(coc-diagnostic-next)
|
|
|
|
nnoremap <silent> <space>d :<C-u>CocList diagnostics<cr>
|
|
|
|
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
|
|
|
|
nmap <leader>do <Plug>(coc-codeaction)
|
|
|
|
nmap <leader>rn <Plug>(coc-rename)
|
|
|
|
|
2021-03-04 14:11:17 +01:00
|
|
|
|
|
|
|
" style
|
|
|
|
colorscheme nord
|
|
|
|
|