From bb0864302d0bf412c1fc833420aa2b17d9928458 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 6 Mar 2020 15:33:12 +0900 Subject: Change default servers_dir --- README.md | 14 ++++++++++++++ autoload/lsp_settings.vim | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 24d869a..d233204 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,20 @@ Plug 'Shougo/deoplete.nvim' Plug 'lighttiger2505/deoplete-vim-lsp' ``` +vim-lsp-settings install Language Servers into: + +#### Windows + +``` +%LOCALAPPDATA%\vim-lsp-settings\servers +``` + +#### Others + +``` +$HOME/.config/vim-lsp-settings/servers +``` + ### Notice If you use plugin manager that is merging plugins (ex. dein), Please setting stop merging work(ex. dein / merged = 0) or set `g:lsp_settings_servers_dir` option to a different directory from the vim-lsp's default. diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim index 5698798..6e2ad38 100644 --- a/autoload/lsp_settings.vim +++ b/autoload/lsp_settings.vim @@ -1,9 +1,14 @@ let s:settings_dir = expand(':h:h') . '/settings' let s:checkers_dir = expand(':h:h') . '/checkers' -let s:servers_dir = expand(':h:h') . '/servers' let s:installer_dir = expand(':h:h') . '/installer' let s:root_dir = expand(':h:h') +if has('win32') + let s:servers_dir = expand('$LOCALAPPDATA/vim-lsp-settings/servers') +else + let s:servers_dir = expand('~/.config/vim-lsp-settings/servers') +endif + let s:settings = json_decode(join(readfile(expand(':h:h') . '/settings.json'), "\n")) call remove(s:settings, '$schema') -- cgit v1.2.3-54-g00ecf From 9be9b69efee5f86905ee2af6e18cf11f81d14f15 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 6 Mar 2020 15:39:01 +0900 Subject: If $XDG_CONFIG_HOME is defined, use it. --- README.md | 8 +++++++- autoload/lsp_settings.vim | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d233204..a1722d0 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,13 @@ vim-lsp-settings install Language Servers into: #### Others ``` -$HOME/.config/vim-lsp-settings/servers +$HOME/.local/share/vim-lsp-settings/servers +``` + +If $XDG_DATA_HOME is defined: + +``` +$XDG_DATA_HOME/vim-lsp-settings/servers ``` ### Notice diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim index 6e2ad38..3b10715 100644 --- a/autoload/lsp_settings.vim +++ b/autoload/lsp_settings.vim @@ -5,8 +5,10 @@ let s:root_dir = expand(':h:h') if has('win32') let s:servers_dir = expand('$LOCALAPPDATA/vim-lsp-settings/servers') +elseif $XDG_DATA_HOME != '' + let s:servers_dir = expand('$XDG_DATA_HOME/vim-lsp-settings/servers') else - let s:servers_dir = expand('~/.config/vim-lsp-settings/servers') + let s:servers_dir = expand('~/.local/share/vim-lsp-settings/servers') endif let s:settings = json_decode(join(readfile(expand(':h:h') . '/settings.json'), "\n")) -- cgit v1.2.3-54-g00ecf From a3a908863b704bb692b313bee29ae7566a021ab4 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 6 Mar 2020 15:41:08 +0900 Subject: silence the reviewdog --- autoload/lsp_settings.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim index 3b10715..14dab41 100644 --- a/autoload/lsp_settings.vim +++ b/autoload/lsp_settings.vim @@ -5,7 +5,7 @@ let s:root_dir = expand(':h:h') if has('win32') let s:servers_dir = expand('$LOCALAPPDATA/vim-lsp-settings/servers') -elseif $XDG_DATA_HOME != '' +elseif $XDG_DATA_HOME !=# '' let s:servers_dir = expand('$XDG_DATA_HOME/vim-lsp-settings/servers') else let s:servers_dir = expand('~/.local/share/vim-lsp-settings/servers') -- cgit v1.2.3-54-g00ecf From d2560e42feafcefc1edfbe57caace8ae1b01ae5f Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 6 Mar 2020 15:50:04 +0900 Subject: Update README.md --- README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a1722d0..ac4006c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Auto configurations for Language Server for [vim-lsp](https://github.com/prabirs ## Introduction -Language Servers is not easily to install. Visual Studio Code provide easy way to install/update Language Server and Language Server Client. This plugin provide same feature on Vim. +Language Servers is not easy to install. Visual Studio Code provide easy way to install/update Language Server and Language Server Client. This plugin provide same feature on Vim. ## Installation instruction @@ -39,6 +39,12 @@ Plug 'Shougo/deoplete.nvim' Plug 'lighttiger2505/deoplete-vim-lsp' ``` +### Notice + +If you use plugin manager that is merging plugins (ex. dein), Please setting stop merging work(ex. dein / merged = 0) or set `g:lsp_settings_servers_dir` option to a different directory from the vim-lsp's default. + +_reason_: + vim-lsp-settings install Language Servers into: #### Windows @@ -53,20 +59,12 @@ vim-lsp-settings install Language Servers into: $HOME/.local/share/vim-lsp-settings/servers ``` -If $XDG_DATA_HOME is defined: +If you define $XDG_DATA_HOME: ``` $XDG_DATA_HOME/vim-lsp-settings/servers ``` -### Notice - -If you use plugin manager that is merging plugins (ex. dein), Please setting stop merging work(ex. dein / merged = 0) or set `g:lsp_settings_servers_dir` option to a different directory from the vim-lsp's default. - -_reason_: - -Servers are installed in `./servers` directory at the caching area in default. -But when rebuild the cache, any merging plugin manager erases old cached files(include `./servers` and server execute files) before install. You can change the directory to install servers by set `g:lsp_settings_servers_dir` option in full path. ## Usage @@ -76,7 +74,13 @@ While editing a file with a supported filetype: :LspInstallServer ``` -Currently, no way to uninstall/update server. Run this command again, newer version will be installed. +To uninstall server: + +``` +:LspUninstallServer +``` + +Because no way to update server, please run `:LspInstallServer` again, newer version will be installed. ## Supported Languages -- cgit v1.2.3-54-g00ecf