I'm trying to split my vimrc
up into multiple files - init.vim
, keybindings.vim
, ui.vim
, etc. - but I can't get Vim to source files relative to init.vim
(it instead sources relative to where I launch Vim from.
This is what I've got at the top of init.vim
:
source keybindings.vim
source ui.vim
If I run vim
from the same directory as those files, it works fine; if I run it from any other directory, I get the following errors:
Error detected while processing /path/to/vimrc:
line 1:
E484: Can't open file keybindings.vim
line 2:
E484: Can't open file ui.vim
Press ENTER or type command to continue
Edit: It's worth noting that I'm using NixOS, so I don't know what the absolute paths will be, nor if they would be constant if I found out.
I think you can use
runtime keybindings.vim
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With