I want to have vim .vimrc do something like:
let root = :pwd
and the variable root
will have memorized that "pwd" that vim was in at that moment. How do I do this?
Another person asked this question, but another solution was found, so the question was never really answered (http://stackoverflow.com/questions/2540524/vim-call-an-ex-command-set-from-function)
Also, once I assign root to a value, how do I do the following:
:cd root
Every time I do that, vim gives me the following error:
E344: Can't find directory "root" in cdpath
E472: Command failed
:let root = getcwd()
:exe 'cd ' . root
There are probably nicer ways to do this (especially the last part) but it works.
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