persistence.nvim icon indicating copy to clipboard operation
persistence.nvim copied to clipboard

use stdpath('data') instead of stdpath('config')

Open goolord opened this issue 2 years ago • 5 comments

i feel like session files don't belong in the neovim config dir by default

goolord avatar Sep 04 '21 23:09 goolord

I think using stdpath('data') is more appropriate rather than using stdpath('cache'), like shada file.

bruhtus avatar Sep 13 '21 00:09 bruhtus

i think that's just bikeshedding. as long as it's in an even mildly appropriate directory, i am not personally invested in which base directory it's in

goolord avatar Sep 13 '21 21:09 goolord

@bruhtus is right. XDG_CACHE_HOME is supposed to store non-persistent files that can be painlessly removed any time. Cleaning file manager thumbnails and compilation caches should not remove Neovim sessions. Using stdpath('cache') is as appropriate as using stdpath('config').

stdpath('data') should be used instead.

snezhniylis avatar Sep 17 '21 11:09 snezhniylis

the xdg base directory spec does not make any mention of the lifetime of files in XDG_CACHE_HOME, in fact it is intentionally vague, but i'm mildly inclined to agree. it is still bikeshedding

goolord avatar Sep 17 '21 13:09 goolord

As a heads up, I've forked this repo and included your pull request in https://github.com/olimorris/persisted.nvim

olimorris avatar Feb 16 '22 16:02 olimorris