Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to use XDG_CONFIG_HOME path for ZK's config and templates #10

Closed
megalithic opened this issue Mar 15, 2021 · 13 comments · Fixed by #12
Closed

Ability to use XDG_CONFIG_HOME path for ZK's config and templates #10

megalithic opened this issue Mar 15, 2021 · 13 comments · Fixed by #12
Labels
enhancement New feature or request
Projects

Comments

@megalithic
Copy link

megalithic commented Mar 15, 2021

Hey there @mickael-menu!

I was recently alerted to this project by @evantravers and am super excited to dive in!

One thing I've been trying to do with my dotfiles and my system setup in general, is to move everything config-wise to XDG_CONFIG_HOME (~/.config/). I see there looks to be some flexibility for path in zk.go where you're joining that given path with a fixed .zk dir for those config items. I'm a little bit confused on what the .zk/ path is relative to.

Any thoughts around this as an option?

Thanks again for such a wonderful tool!

@mickael-menu
Copy link
Collaborator

Hi Seth, welcome!

zk is working a bit like Git, in that its config is local to a particular notebook. The .zk folder is located at the root directory of a notebook. You can find more info about it here.

But I think some of zk's settings would definitely make sense in a global config, such as command aliases and templates. XDG_CONFIG_HOME seems a perfect fit for this! I think this could be implemented by reading the global config, then merging the local one when opening the current notebook.

@mickael-menu mickael-menu added the enhancement New feature or request label Mar 15, 2021
@mickael-menu mickael-menu added this to Backlog in zk via automation Mar 15, 2021
@megalithic
Copy link
Author

megalithic commented Mar 15, 2021

Ahh, that makes more sense. I was trying to get a sense of how/what was acting as the root "key" for the config and the notebooks.

I'm looking at ways to make link-following easier; since this is tool agnostic for editing/etc; and you seem to be a (n)vim user; do you recommend something like vim-wiki/vimwiki for handling the link expansion and creation?

Basically, I think I'm looking to utilize zk for management of zettels, as well as it's journaling feature for more long-form day-to-day work notes.

Ever considered doing a live-stream or a youtube video showing some of your real-world usages? 🙏

@mickael-menu
Copy link
Collaborator

I spawned a new discussion for Vim: https://github.com/mickael-menu/zk/discussions/11

Ever considered doing a live-stream or a youtube video showing some of your real-world usages? 🙏

No but why not! I don't think my setup is very special, but it could help showcase some of zk's coolest features better than the animated SVGs in Getting started.

@evantravers
Copy link

I'm going to 👍 this idea… mostly because I sync my wiki back and forth on dropbox… and I can't figure out how to tell the second computer to use ~/Dropbox/wiki as it's primary notebook. On the first computer, I just ran zk init, and everything was fine, but I can't figure out how to point zk at the folder on the second… I think a config file would be good.

@mickael-menu
Copy link
Collaborator

mickael-menu commented Mar 16, 2021

@evantravers I started working on the global config, but I'm not sure this is going to solve your problem.

A zk notebook is really like a Git repository, and zk init is similar to git init: it creates a .zk folder in the current directory. As long as the .zk folder is also synchronized with Dropbox, you should not need to run zk init on the other computer.

There is no notion of "global notebook" with zk, the shell needs to be inside a notebook directory to run zk commands.

I can understand the appeal of running zk commands from anywhere with a global notebook, but I'm afraid this would make it more complicated to work with several notebooks.

@mickael-menu
Copy link
Collaborator

I implemented it in this PR: https://github.com/mickael-menu/zk/pull/12

Here's a macOS build, I will wait for your feedback before merging the PR. And I'm looking forward to any cool aliases you may add to your dotfiles repos! ;)

@mickael-menu
Copy link
Collaborator

@evantravers @megalithic I've given more thought to the global notebook issue and came up with this potential solution: https://github.com/mickael-menu/zk/issues/13

@megalithic
Copy link
Author

Your solution from #13 makes complete sense and seems like the direction to go.

@evantravers
Copy link

evantravers commented Mar 17, 2021 via email

zk automation moved this from Backlog to Done Mar 17, 2021
@mickael-menu
Copy link
Collaborator

Here's an updated macOS build supporting the ZK_NOTEBOOK_DIR env variable per #14. Thanks again for your feedback, I think it's making zk more enjoyable to use!

@evantravers
Copy link

evantravers commented Mar 18, 2021 via email

@megalithic
Copy link
Author

@mickael-menu quick question around global config/templates (https://github.com/mickael-menu/zk/blob/main/docs/config.md#global-configuration-file)..

there still seems to be a requirement that a config.toml exist in your notebook's directory (even the notebook defined in the ZK_NOTEBOOK_DIR; is this expected behaviour?

thanks!

@mickael-menu
Copy link
Collaborator

Not really, it's probably just a leftover from the previous behavior. I guess checking the presence of the .zk marker should be enough. Thanks for spotting that 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
zk
Done
Development

Successfully merging a pull request may close this issue.

3 participants