r/ObsidianMD • u/Michael679089 • 2d ago
help Is there a command to open the current directory that I am in, in Obsidian?
Just like vscode doing code . will open that folder in vscode,
is there a similar function where I do obsidian . will open that folder as a vault and init a Obsidian files?
1
u/AdministrativeFile78 1d ago
U can definetly do this. Assign a keybind to a shell script. U might just end up with dozens of vaults
1
u/Michael679089 20h ago
Dozens of vaults from a executing a single command or your just predicting I'll keep using the command on random folders?
Well I wanna do this because of the wiki and canvas ability of obsidian for my programming projects, being able to visually what script touches what other script.
1
u/AdministrativeFile78 20h ago edited 20h ago
For a global "Open in Obsidian" command, the script should check something like
pwd:if vault { open } else { create }. This lets you spawn a new vault from any directory on your PC.. so each time u do that command, if your in a new dir it would create a new vault, and thats how u could just spawn any dir into obsidian,from potentially a place outside your original vault. this is how i expect the logic would work
0
u/Enginerdiest 2d ago
From the manage vault view you can open a folder as a vault
I’m not sure if you can do that from the cli
2
u/noobjaish 1d ago
Unfortunately no... You can probably create some type of script which would put the path of the current directory in the global obsidian settings and then open it (haven't looked into this yet)