obsidian-vimrc-support icon indicating copy to clipboard operation
obsidian-vimrc-support copied to clipboard

Symlinks and sourcing from another file

Open jsrozner opened this issue 2 years ago • 2 comments

Describe the feature that you'd like: I manage my dotfiles using git in a centralized repo. I want to be able to symlink from my central repo to the obsidian vault, but it looks like this plugin does not support loading symlink?

For example ln -s ~/.dotfiles/.vimrc.obsidian ~/obsidian_vault/.obsidian.vimrc

A clear and concise description of what you want to happen.

  • I would like .obsidian.vimrc to still work if it is a symlink and not a file

  • Additionally it looks like the command source <other file> is not supported from within the obsidian vimrc

jsrozner avatar May 24 '23 18:05 jsrozner

If works with a symlink for me. Did you restart Obsidian after creating the symlink?

oskarryn avatar Sep 14 '23 07:09 oskarryn

Sorry for the delay. I think my symlink setup somehow had a bug. I am not sure exactly why (ln -s would succeed but the alias was immediately broken). It works now!

source <file> does work, but only if the file is in the obsidian vault root. In particular, sourcing a file outside the vault, even using an absolute path, does not work

jsrozner avatar Feb 14 '24 23:02 jsrozner

The line involved is here. I guess it makes sense we cannot source from outside the vault: how would we read from another file.

Solution is to set up my symlinks to link both files to the vault and then source from within the vault.

jsrozner avatar Mar 21 '24 22:03 jsrozner