slap-editor / slap

Sublime-like terminal-based text editor
MIT License
6.14k stars 216 forks source link

Move ~/.slaprc to $XDG_CONFIG_HOME/slaprc #40

Closed jeena closed 10 years ago

jeena commented 10 years ago

Please don't use the hardcoded ~/.slaprc path for the configuration file, instead use something like this:

config = getenv("XDG_CONFIG_HOME")
if (!config) config = getenv("HOME") + "/.config"
config = config + "/slaprc"

This has many advantages for the users and almost no disadvantages for you (besides the fact that you have to change your code).

For more information see the Freedesktop specification: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

rnhmjoj commented 10 years ago

+1 I hate the home spammed with dotfiles.

pwoolcoc commented 10 years ago

+1

dbkaplun commented 10 years ago

Hi all,

Actually slap uses rc for configuration management, which means you can store configuration in ~/.config/slap if you want to, as well as many other locations which are searched automatically. Hope this helps!

rnhmjoj commented 10 years ago

@beardtree Yes it works, however every time you start slap a new ~/.slaprc is created.

dbkaplun commented 10 years ago

@Rnhmjoj I have filed a new ticket, #62, for that issue. Thanks!

Closing this issue.