I want to edit a file with (:e
) which is a symlink and make vim follow it. I dont want this to be the default behavior or anything.
I know that using resolve and expand I can get full link.
:echo resolve(expand("~/.vimrc"))
prints the full link.
I want to be able to do something like this
:e resolve(expand("~/.vimrc"))
Note: I want it to follow the symlink because of context, like quickly editing other files in that folder and stuff like that.
You can insert any Vimscript expression into the command-line via <C-r>
and the expression register =
:
:e <C-r>=resolve(expand("~/.vimrc"))<CR><CR>
Alternatively, for files, there's the rather obscure backtick expansion of Vimscript:
:e `=resolve(expand("~/.vimrc"))`<CR>
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