aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2020-03-07 20:07:38 +0900
committerGitHub <noreply@github.com>2020-03-07 20:07:38 +0900
commitfa3975425e71cc2cd14152fdb435c85a100cf272 (patch)
tree909a2946c79d9332d5a3da99807c7f9bb421777d
parent42a1e7ec4e8764798cdc934cd31ff9ad715d7751 (diff)
parentd2560e42feafcefc1edfbe57caace8ae1b01ae5f (diff)
downloadvim-lsp-settings-fa3975425e71cc2cd14152fdb435c85a100cf272.tar.gz
vim-lsp-settings-fa3975425e71cc2cd14152fdb435c85a100cf272.tar.bz2
vim-lsp-settings-fa3975425e71cc2cd14152fdb435c85a100cf272.zip
Merge pull request #189 from mattn/move-servers-dir
Change default servers_dir
-rw-r--r--README.md32
-rw-r--r--autoload/lsp_settings.vim9
2 files changed, 36 insertions, 5 deletions
diff --git a/README.md b/README.md
index 24d869a..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
@@ -45,8 +45,26 @@ If you use plugin manager that is merging plugins (ex. dein), Please setting st
_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.
+vim-lsp-settings install Language Servers into:
+
+#### Windows
+
+```
+%LOCALAPPDATA%\vim-lsp-settings\servers
+```
+
+#### Others
+
+```
+$HOME/.local/share/vim-lsp-settings/servers
+```
+
+If you define $XDG_DATA_HOME:
+
+```
+$XDG_DATA_HOME/vim-lsp-settings/servers
+```
+
You can change the directory to install servers by set `g:lsp_settings_servers_dir` option in full path.
## Usage
@@ -56,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
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim
index 5698798..14dab41 100644
--- a/autoload/lsp_settings.vim
+++ b/autoload/lsp_settings.vim
@@ -1,9 +1,16 @@
let s:settings_dir = expand('<sfile>:h:h') . '/settings'
let s:checkers_dir = expand('<sfile>:h:h') . '/checkers'
-let s:servers_dir = expand('<sfile>:h:h') . '/servers'
let s:installer_dir = expand('<sfile>:h:h') . '/installer'
let s:root_dir = expand('<sfile>: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('~/.local/share/vim-lsp-settings/servers')
+endif
+
let s:settings = json_decode(join(readfile(expand('<sfile>:h:h') . '/settings.json'), "\n"))
call remove(s:settings, '$schema')