I have created aliases
in my .bashrc
for various frequently used long paths but I can not seem to be able to use them inside vim
or with commands such as find
or grep
.
E.g the following:
db
in cli does cd /some/very/long/path/db
But in vim this:
:e db/file.java
or on the command line: grep -r string db
do not work.
How is this fixed?
Bash – How to use aliases in commands
aliasbashrcfilenamesvim
Best Answer
You can set an environmental variable for that directory.
Then you can use the exported variable in Vim as such:
and in your shell as such:
The variable-substitution facilities of Vim and bash are entirely independent from each other. Vim just happens to substitute environmental variables in a manner similar to bash (and many other shells).