From 6b6f018f84e8e2c74dbcf79e8b8214fd0622b43a Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Wed, 28 Oct 2015 10:17:43 +0100 Subject: [PATCH] spellfile: follow the XDG spec Closes #3535 --- runtime/autoload/spellfile.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/autoload/spellfile.vim b/runtime/autoload/spellfile.vim index 5b1079e919..c32dd5df9b 100644 --- a/runtime/autoload/spellfile.vim +++ b/runtime/autoload/spellfile.vim @@ -196,9 +196,11 @@ function! spellfile#GetDirChoices() endfunc function! spellfile#WritableSpellDir() - if has("unix") - " For Unix always use the $HOME/.nvim directory - return $HOME . "/.nvim/spell" + " Always use the $XDG_DATA_HOME/nvim/site directory + if exists('$XDG_DATA_HOME') + return $XDG_DATA_HOME . "/nvim/site/spell" + else + return $HOME . "/.local/share/nvim/site/spell" endif for dir in split(&rtp, ',') if filewritable(dir) == 2