pimterry/notes

Feature Request: ~/.notesrc config file

primis opened this issue · 7 comments

Rather than check for $notes_editor (proposed) and $NOTES_Directory, we should check for a config file in the home directory. This is how most applications work, and it provides a cleaner way to set all the configurations (and gives us the ability to stop worrying about adding enviorment variables)

I would suggest to also having it XDG conform under ~/.config/notes/config

I agree, that's a better place for it.

Yes, moving to config is a good idea, and following XDG sounds sensible. I'd be happy to see a PR taking a first shot at this.

I would like to ensure that for most users this config is unnecessary; sensible defaults and relying on standard OS configs ($EDITOR and the editor symlink) should cover most user cases, and it would be great to not create any extra config at all for most users. Having config as a place that users can configure notes for trickier corner cases is a very good idea though, you're right that we can't let env vars proliferate.

That one part I'm not sure about is including $NOTES_DIRECTORY itself in this, simply because it's a core thing that I imagine almost all users will want to set (I imagine?). I'm happy with special config and uncommon options moving elsewhere, but I do like the simplicity of "set one env var and go", and having that cover normal user setup completely. It keeps the barrier to getting set up as low as possible. Thoughts?

Gonna write this up... Would we want the values in the rc file to override env or vice versa?

Config should override env.

  • For $EDITOR/editor I think that's clear.
  • Any more specific config needed in future (e.g. for git integration: #17) should be managed in config only, so there's no env settings to override.
  • For $NOTES_DIRECTORY, I'm tempted to say it should only be configurable by env, so it doesn't matter. I think some people might disagree with that though? If there are indeed some people who'd like to be able to configure this in config instead of just env, then having config override env is fine by me.

Just created pull request #28 to finish this off

Commit #28 Merged, This Feature Request is now closed.