-
Notifications
You must be signed in to change notification settings - Fork 42
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
How to create obsidian-style links #104
Comments
Hi @mediapathic
I'm unfamiliar with Obsidian, but this way of working seems inconvenient when you decide to rename files, no?
You could write a new function that resembles the That would look like this: (defun efls/zetteldeft-search-file-at-point ()
"Search via `deft' with `thing-at-point' as filter.
Thing can be a double-bracketed link, a hashtag, or a word.
Searches filenames only. When a single file is found, it is opened."
(interactive)
(let ((string (zetteldeft--get-thing-at-point)))
(if string
(zetteldeft--search-filename string nil)
(user-error "No search term at point")))) One potential issue is that |
If you find a setup that works let me know and/or submit a note to or PR for |
It is indeed. One of the major selling points of Obsidian is that it has internal detection and automatic update of all links across your files when a file is renamed (it's really quite amazing). So, this works great, but after working in Obsidian for a long time and then moving to emacs... I have a lot of files without UIDs in the filename. I also have been taking notes in plain text form for a long, long time before I learned about the zettelkasten method, so I have lots of old files from vimwiki, log files named things like "2013-04-01.md", etc. As I find these I am very slowly adding UIDs to the ones that are actually useful, but for now it is very helpful to be able to link to even badly-formed files.
Initial, brief testing indicates that not only does this work, it actually solves my other problem I mentioned in #99 . This function seems to directly open both md-style and org-style links (assuming I set the filename as the link text, which is my usual practice) in both markdown and org files. This little chunk of code solves a problem I have been beating my head against for days now! If I didn't already owe you a beverage of your choice for writing zetteldeft, now I owe you at least two. Thank you, even moreso than usual. |
In Zetteldeft, when you update a file, is there a way to update all links in associated files to it? |
Links are resolved via the unique ID. So long as you don't change the ID in the filename, there's no need to update any links. |
Obsidian is an increasingly popular markdown editor. I used it for a while, and I have a bunch of files that use its link method, which is essentially full filename and no UID required. I wrote some code to insert links in this style:
I also have set
I have yet to find a way to actually follow these as links; I am using
zetteldeft-search-at-point
which works well enough for both use cases of filename and uid, but if anyone has suggestions for treating these as proper links, I would appreciate it.I post this here mostly to help anyone who like me was struggling with links like this, and also @EFLS I will be happy to make a PR for this if you'd like, though I expect if you want to include this just copying and pasting will be easier :)
The text was updated successfully, but these errors were encountered: