reddit / emacs

Obsidian.el — Obsidian Notes within Emacs

licht1nstein · 2022-07-25 22:31
There were several discussions over the past year about supporting Obsidian Notes within Emacs. Which I thought was a neat idea, so I built [obsidian.el](https://github.com/licht1stein/obsidian.el) You can read the details in the readme, but even though it's still WIP, it already can: \- autocomplete tags \- insert links from selection \- jump between notes \- capture notes \- correctly follow notes generated by obsidian Give it a try please and let me know what you think! [https://github.com/licht1stein/obsidian.e](https://github.com/licht1stein/obsidian.el)l UPDATE: Added `obsidian-follow-link-at-point` and updated documentation. Now all kinds of obsidian markdown and wikilinks work correctly. UPDATE Jul 30: Implemented `obsidian-search` and `obsidian-tag-find`
uptocode · 2022-07-26 02:31
may the ground you walk on be blessed
RogueToad · 2022-07-26 02:48
Forgive me for going in the obvious direction here, but would there be any tangible benefit to switching to obsidian from org-roam? Great work by the way. Edit: Lol sorry, you answered in your README.
WillCode4Cats · 2022-07-26 03:09
The lack of emacs integration is the reason I have held off from using Obsidian. It looks like the Volcano Gods have blessed me. (Seriously, thank you)
celeritasCelery · 2022-07-26 06:23
The reason given in the readme is mobile support. I have been [using logseq with org-roam](https://coredumped.dev/2021/05/26/taking-org-roam-everywhere-with-logseq/) on mobile with good success. The obsidian app (I would imagine) works better, but doesn’t support org-mode like logseq does.
licht1nstein · 2022-07-26 11:24
No, it's markdown only. But for my use case it's enough :)
licht1nstein · 2022-07-26 11:24
Thank you, you made me blush :)
licht1nstein · 2022-07-26 11:25
Thanks for trying it :)
Sepulta · 2022-07-26 22:46
I see you mention org-roam as an alternative to this, but is there any reason why org-roam could not be included in the functionality you provide/made compatible with? I'm probably overlooking something obvious here, but I've grown quite accustomed to org-roam but i also see the potential of obsidian. Would be great to see them compatible/combined!
[deleted] · 2022-07-27 00:11
[deleted]
licht1nstein · 2022-07-27 00:30
Too much hassle managing two pkms systems. I feel like I won’t have time for the knowledge itself :) I like org-roama lot, and maybe they’ll have a worthy mobile solution one day. But I went the markdown/obsidian way.
pedxing128 · 2022-07-27 03:59
I was looking for something like this ever since I decided to move off of org-mode for my PKM, too. One issue I ran into was having wikilinks work in emacs. Mark-down mode and gfm-mode don't like whitespace in the link URL. I'm accustomed to writing title case titles, which Obsidian copies the case in the filename. For example, a note titled "This is a note" will have filename "This is a note.md." Do you know how to have filenames with whitespace work in emacs? I notice that you use kebab case in your example screenshots. Is this the route you had to take to make the links work in emacs?
licht1nstein · 2022-07-27 13:14
I have implemented a custom function `obsidian-follow-link-at-point` and updated readme to show how to use it with `C-c C-o` in obsidian-mode. Should do the job most of the times. Tested it on funky file links like these: `[[subdir/2-sub with spaces and буквы.md|complex file name wiki link]]` `[complex file name md link](subdir/2-sub%20with%20spaces%20and%20`[`буквы.md`](https://буквы.md)`)` Note how Obsidian app replaces spaces with \`%20\` when inserting markdown links, and doesn't do that in wiki links. Obsidian.el does the same when inserting link for complete compatibility with the Obsidian app.
pedxing128 · 2022-07-27 15:08
Wow! Did you just add the link functionality? That was fast! Thanks for being so responsive. I almost didn't switch to Obsidian from org-mode because of the I wanted to edit Obsidian notes in emacs but the user experience wasn't there without a package like yours. So thank you! You're a life saver. One suggestion on `obsidian-follow-link-at-point`: when Obsidian inserts links, it does so without the .md file extension and without being explicit on file link and display name. For example, the note `This is a New note.md` will be inserted as a wikilink like so: \[\[This is a New note\]\], instead of \[\[This is a New note.md|This is a New note\]\]. Would it be possible to add that format for following and inserting links? I think the more explicit method you shared would be better for cross app markdown compatibility and future proofing. I don't see the option to insert wikilinks like this in Obsidian, so let me know if that's possible.
licht1nstein · 2022-07-27 15:43
Thanks, I'll play with link formats some more. Shouldn't be a problem.
licht1nstein · 2022-07-27 15:50
The top link was created by Obsidian App, the bottom one was created by Obsidian.el: `[2-sub](2-sub.md)` `[2-sub](subdir/2-sub.md)` Obsidian would create the same links as obsidian.el did (with relative path) when there is more than 1 file with same name. So I'll keep the `obsidian-insert-link` as is, and adjust `obsidian-follow-link-at-point` to find files in subdirectories without the path specified.
licht1nstein · 2022-07-27 16:25
Ready. Now it works like this: https://github.com/licht1stein/obsidian.el#multiple-matches
licht1nstein · 2022-07-27 19:49
I added support for Obsidian style wikilinks in both obsidian-insert-wikilink and obsidian-follow.. :)
[deleted] · 2022-07-28 04:03
[deleted]
javierinsituok · 2022-08-18 04:19
Great idea. Thanks a lot. Now I can work with all my notes within Emacs. :)
licht1nstein · 2022-08-18 05:57
Thanks! I rarely open obsidian on the desktop since I made this :)
mastro35 · 2022-10-01 21:18
Thanks for your work man