Coc.nvim: Use XDG Base Directories for storing data on Freedesktop-compatible systems (e.g. Linux)

Created on 15 Aug 2020  Â·  6Comments  Â·  Source: neoclide/coc.nvim

User data is currently stored in $HOME/.config/coc. This is non-standard; $XDG_DATA_HOME should be used instead.

Is your feature request related to a problem? Please describe.

The GNOME project has a good list of the problems caused by not using the standard XDG base directories.

Describe the solution you'd like

User data stored in $XDG_DATA_HOME on supporting systems.

Describe alternatives you've considered

User data could be stored somewhere under .vim. This seems like a less standards-compliant approach and has a potential to be conflated with manual configuration files.

Additional context

Reference specification
Summary of XDG base directories on the Arch Linux Wiki
GNOME project's usage guide

Most helpful comment

IMO, the request is understandable, but seems a rather breaking/problematic change for all current coc.nvim users, that matter more than sticking to some not-so-relevant directory pattern (few users are currently bothered about that). So maybe this is worth being considered for a breaking-change release, in some remote future?

All 6 comments

Currently, we use $XDG_CONFIG_HOME for config home.

@fannheyward There's a lot of stuff in there that belongs in XDG_DATA_HOME as the original poster said. A concrete example is history.json - this is not in any sense configuration.

Just noticed that my patch for this was nonsense, so fixed the commit.

@fannheyward re: your point, this is about user data, not config. There is a separation of these concepts within coc.nvim -- the functions coc#util#get_data_home vs. coc#util#get_config_home are separate.

As the code stands, we use $XDG_CONFIG_HOME for user data as well as config, which is non-standard. This patch fixes this by using $XDG_DATA_HOME, which is standard.

Please re-open.

It is non-standard on your system, but this change would make many current user would experience extensions not work at all.
We choose XDG_CONFIG_HOME since the files are not only data, but also extensions.
You can use let g:coc_data_home = $XDG_DATA_HOME."/coc" in your vimrc.

Extensions managed by coc.nvim are user data. If an application is
storing an entire checkout of a git repository, it cannot be considered
simply config. This is user data.

This is not just non-standard on my system, but rather on all
Freedesktop-compatible systems.

On Thu, 20 Aug 2020 at 12:14, Qiming zhao notifications@github.com wrote:

Closed #2245 https://github.com/neoclide/coc.nvim/issues/2245.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/neoclide/coc.nvim/issues/2245#event-3674953825, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAJYYLHDZVK7WURTDJ45O4DSBUHRVANCNFSM4P77T26A
.

IMO, the request is understandable, but seems a rather breaking/problematic change for all current coc.nvim users, that matter more than sticking to some not-so-relevant directory pattern (few users are currently bothered about that). So maybe this is worth being considered for a breaking-change release, in some remote future?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chemzqm picture chemzqm  Â·  3Comments

svenstaro picture svenstaro  Â·  4Comments

skylite21 picture skylite21  Â·  3Comments

lanox picture lanox  Â·  3Comments

ctaylo21 picture ctaylo21  Â·  4Comments