Add JS support in vim

This commit is contained in:
Cyryl Płotnicki 2019-02-25 15:36:14 +00:00
parent 5671bc11c2
commit 07ec31112a
2 changed files with 12 additions and 0 deletions

View file

@ -11,6 +11,7 @@ Plug 'airblade/vim-gitgutter'
Plug 'cespare/vim-toml' Plug 'cespare/vim-toml'
Plug 'Chiel92/vim-autoformat' Plug 'Chiel92/vim-autoformat'
Plug 'drmingdrmer/vim-toggle-quickfix' Plug 'drmingdrmer/vim-toggle-quickfix'
Plug 'editorconfig/editorconfig-vim'
Plug 'godlygeek/tabular' Plug 'godlygeek/tabular'
Plug 'https://github.com/cyplo/vim-colors-solarized.git' Plug 'https://github.com/cyplo/vim-colors-solarized.git'
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
@ -25,6 +26,8 @@ Plug 'prabirshrestha/vim-lsp'
Plug 'roxma/nvim-yarp' Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc' Plug 'roxma/vim-hug-neovim-rpc'
Plug 'rust-lang/rust.vim' Plug 'rust-lang/rust.vim'
Plug 'ryanolsonx/vim-lsp-javascript'
Plug 'ryanolsonx/vim-lsp-typescript'
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
Plug 'timonv/vim-cargo' Plug 'timonv/vim-cargo'
Plug 'tpope/vim-cucumber' Plug 'tpope/vim-cucumber'

View file

@ -24,6 +24,15 @@ au User lsp_setup call lsp#register_server({
\ 'whitelist': ['rust'], \ 'whitelist': ['rust'],
\ }) \ })
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_directory(lsp#utils#get_buffer_path(), '.git/..'))},
\ 'whitelist': ['javascript', 'javascript.jsx', 'typescript', 'typescript.tsx'],
\ })
endif
let g:lsp_signs_enabled = 1 let g:lsp_signs_enabled = 1
let g:lsp_diagnostics_echo_cursor = 1 let g:lsp_diagnostics_echo_cursor = 1