From 0480b2243cf7141bcbe554cd7f800532c6431e3e Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Mon, 2 Nov 2015 06:38:15 +0100 Subject: [PATCH] Adapt to changed Neovim configuration directory. Fixes #596. --- pythonx/UltiSnips/snippet_manager.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pythonx/UltiSnips/snippet_manager.py b/pythonx/UltiSnips/snippet_manager.py index b4e99c7..d9377e3 100644 --- a/pythonx/UltiSnips/snippet_manager.py +++ b/pythonx/UltiSnips/snippet_manager.py @@ -748,15 +748,14 @@ class SnippetManager(object): if _vim.eval("exists('g:UltiSnipsSnippetsDir')") == '1': snippet_dir = _vim.eval('g:UltiSnipsSnippetsDir') else: + home = _vim.eval('$HOME') if platform.system() == 'Windows': - snippet_dir = os.path.join(_vim.eval('$HOME'), - 'vimfiles', 'UltiSnips') + snippet_dir = os.path.join(home, 'vimfiles', 'UltiSnips') elif _vim.eval("has('nvim')") == '1': - snippet_dir = os.path.join(_vim.eval('$HOME'), - '.nvim', 'UltiSnips') + xdg_home_config = _vim.eval('$XDG_CONFIG_HOME') or os.path.join(home, ".config") + snippet_dir = os.path.join(xdg_home_config, 'nvim', 'UltiSnips') else: - snippet_dir = os.path.join(_vim.eval('$HOME'), - '.vim', 'UltiSnips') + snippet_dir = os.path.join(home, '.vim', 'UltiSnips') filetypes = [] if requested_ft: