Closed srid closed 4 years ago
Yeah that was my idea in #2, but I thought switching would be rare.
I have no idea how to implement this, I'll investigate how counsel-recentf
works.
SPC p p
(projectile-switch-project
) works like this.
I think that neuron-zettelkasten
should be a function and not a variable. It would first check to see if default-directory
is a zettelkasten and if so use it. Otherwise fall back on neuron-default-zettelkasten-directory
.
In a similar fashion, neuron-default-zettelkasten-directory
should be settable to a directory path (like how it is now) or a user-supplied function that returns a directory path. This would allow the user to decide what directory to use if neuron-zettelkasten
can't figure it out automatically.
Yeah that would be an easy way to implement it. To detect the current zettelkasten root, we could also wait for https://github.com/srid/neuron/issues/161 which could provide a command to get the zettelkasten's root from the current directory, like git rev-parse --show-toplevel
. But for now, the hierarchy could be recursively traversed upwards until a file named neuron.dhall
is detected.
This has been implemented in https://github.com/felko/neuron-mode/commit/60be5c1740385a2b1cb92c83931494667fb1da3c, neuron-select-zettelkasten
is now deprecated.
The detection of the zettelkasten is achieved by traversing upwards the directory tree until a neuron.dhall file is found.
When no neuron.dhall file is found, it choses neuron-default-zettelkasten-directory
. The zettel cache is refreshed accordingly.
I have been using
neuron-select-zettelkasten
to switch between multiple zettelkastens. Each time, this command prompts me to enter the full path (doom-emacs' auto-completion makes this comfortable).It would be nice if there was command (
neuron-switch-zettelkasten
?) that gave me a list of recently selected zettelkastens. That would be a faster way to switch.Just like
counsel-recentf
behaves.