Comments (6)
Perfect. I created a hydra. Thank you again!
(defun zd-a ()
(interactive)
(deft)
(setq deft-directory "~/zd-a/")
(deft-refresh))
(defun zd-b ()
(deft)
(interactive)
(setq deft-directory "~/zd-b/")
(deft-refresh))
;(require 'hydra)
(defhydra zd-switch (nil nil :foreign-keys nil :hint nil :exit t)
"
Open:
----------------------
_m_ A zettelkasten
_t_ B zettelkasten
_q_ quit"
("q" nil)
("a" zd-a)
("b" zd-b))
(global-set-key (kbd "<f9>") 'zd-switch/body)
from zetteldeft.
I do this between three Zettelkasten. I use functions, like the ones above, but also take the liberty of changing other settings:
(defun gk/nv ()
(interactive)
(let ((gc-cons-threshold most-positive-fixnum))
(setq deft-directory "~/NVIDIA")
(setq deft-recursive nil)
(setq deft-file-limit 200)
(setq zetteldeft-id-format "%Y%m%d-%H%M")
(deft-refresh)))
Seems to work so far. (Since some of these have several thousand notes, I suspend garbage collection during the deft-refresh
.)
from zetteldeft.
This is more related to deft
than it is to zetteldeft
.
Anyway, it should be easy for you to achieve something like this in your private setup: change the variable deft-directory
and call deft-refresh
afterwards. To let a simple function do that for you:
(defun set-zd-dir ()
(interactive)
(setq deft-directory "~/mydir")
(deft-refresh))
You could make another function to switch back to your original directory. What it doesn't allow, however, is using two directories at once: zetteldeft
wont find links between them, since it looks only in one deft
directory at a time.
Does this suffice for your workflow?
from zetteldeft.
Awesome. Thank you!
I can switch into my second zd now. Curious about the best way to switch between them. Is there a simple way, to make the new function either switch back to the other, or else list a pre-set number of directories to select from?
Thanks again! Zetteldeft is an awesome package!
from zetteldeft.
The easiest would be to write two separate functions. Simply set the deft-directory
variable accordingly. You could make a more complex function that prompts for a directory, but this is the simplest approach.
One thing to note: I think deft-refresh
only works when deft
is already loaded, so you need to start deft
(with the default directory) before you can switch to another one.
Glad to hear that zetteldeft
is of use to you. That's my reason to share it: to contribute to the wonderful emacs community that I benefit so much from.
from zetteldeft.
I've included these code snippets in zd-tutorial
.
from zetteldeft.
Related Issues (20)
- Error in zetteldeft-new-file-and-backlink and update the function HOT 2
- Deft doesn't strip #+STARTUP options at the beginning of note from title HOT 4
- FeatureRequest: Inform about dead link when `C-c d f` HOT 4
- Question: Batch rename tags on all related zettels HOT 1
- Which special characters can be used to distinguish special tags? HOT 3
- Question: What is a backlink HOT 1
- FeatureRequest: Handle special characters in zettels filenames HOT 7
- zetteldeft-find-file behave different HOT 1
- FeatureRequest: create new note in a sub-directory HOT 1
- zetteldeft-full-search-find-file: possibility to see results as we type keywords? HOT 3
- Org-capture via org-protocol to create notes directly from the browser HOT 2
- Right hand side back-links window HOT 3
- zetteldeft-find-file not using follow mode HOT 5
- Strange line break HOT 2
- Sorting of files in zetteldeft-find-file HOT 2
- Add a function analogous to zetteldeft-insert-link-{zd,org}-style but for markdown
- make the function to extract a title from a note customizable
- shouldn't zetteldeft--check return nonnil or nil rather than signalling an error? HOT 1
- Incompatibility with Org 9.5.5? HOT 3
- Is this expected behavior for dynamic blocks? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zetteldeft.