aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md8
-rw-r--r--autoload/lsp_settings.vim4
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('<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('~/.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('<sfile>:h:h') . '/settings.json'), "\n"))