diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-01-27 15:21:50 +0900 |
---|---|---|
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-01-27 15:21:50 +0900 |
commit | 38ab9a5ec7f8cce9bcdf239ad31431ae5e3101be (patch) | |
tree | eb40bba3042e206433a755d144e89226d20863bc | |
parent | f10d6a9c859e89a8d02ad468a250c782170159eb (diff) | |
download | vim-lsp-settings-38ab9a5ec7f8cce9bcdf239ad31431ae5e3101be.tar.gz vim-lsp-settings-38ab9a5ec7f8cce9bcdf239ad31431ae5e3101be.tar.bz2 vim-lsp-settings-38ab9a5ec7f8cce9bcdf239ad31431ae5e3101be.zip |
Use root_dir
-rw-r--r-- | autoload/lsp_settings.vim | 3 | ||||
-rw-r--r-- | plugin/lsp_settings.vim | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim index 51ff952..e8419a8 100644 --- a/autoload/lsp_settings.vim +++ b/autoload/lsp_settings.vim @@ -1,5 +1,6 @@ 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') function! lsp_settings#get(name, key, default) abort let l:config = get(g:, 'lsp_settings', {}) @@ -100,7 +101,7 @@ function! lsp_settings#autocd(server_info) abort endfunction function! lsp_settings#complete_installer(arglead, cmdline, cursorpos) abort - let l:settings = json_decode(join(readfile(expand('<sfile>:h:h').'/settings.json'), "\n")) + let l:settings = json_decode(join(readfile(s:root_dir . '/settings.json'), "\n")) call remove(l:settings, '$schema') let l:ft = tolower(get(split(&filetype, '\.'), 0, '')) diff --git a/plugin/lsp_settings.vim b/plugin/lsp_settings.vim index 2fade35..569e28d 100644 --- a/plugin/lsp_settings.vim +++ b/plugin/lsp_settings.vim @@ -14,7 +14,7 @@ let s:settings_dir = expand('<sfile>:h:h').'/settings' let s:checkers_dir = expand('<sfile>:h:h').'/checkers' let s:installer_dir = expand('<sfile>:h:h').'/installer' let s:servers_dir = expand('<sfile>:h:h').'/servers' -let s:settings = json_decode(join(readfile(expand('<sfile>:h:h').'/settings.json'), "\n")) +let s:settings = json_decode(join(readfile(expand('<sfile>:h:h') . '/settings.json'), "\n")) let s:ftmap = {} call remove(s:settings, '$schema') |