Compare commits

..

2 Commits

Author SHA1 Message Date
Jay
687272ed26 Merge branch 'master' of ssh://git.trj.tw:10022/jay/dotfiles 2021-02-22 10:00:32 +08:00
Jay
c7f43a32b5 [feat] remove js/ts lsp plugin 2021-02-22 10:00:12 +08:00

25
.vimrc
View File

@ -38,12 +38,6 @@ Plug 'Shougo/defx.nvim'
Plug 'roxma/nvim-yarp' Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc' Plug 'roxma/vim-hug-neovim-rpc'
" LSP
" JS/TS require
" npm install -g typescript typescript-language-server
Plug 'ryanolsonx/vim-lsp-javascript'
Plug 'ryanolsonx/vim-lsp-typescript'
Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline'
Plug 'kien/tabman.vim' Plug 'kien/tabman.vim'
@ -321,6 +315,25 @@ if executable('rust-analyzer')
\ }) \ })
endif endif
" LSP
" JS/TS require
" npm install -g typescript typescript-language-server
if executable('typescript-language-server')
au User lsp_setup call lsp#register_server({
\ 'name': 'javascript support using typescript-language-server',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'package.json'))},
\ 'whitelist': ['javascript', 'javascript.jsx'],
\ })
au User lsp_setup call lsp#register_server({
\ 'name': 'typescript support using typescript-language-server',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'tsconfig.json'))},
\ 'whitelist': ['typescript', 'typescript.tsx', 'typescriptreact'],
\ })
endif
" auto completer " auto completer
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"