Reputation: 20628
How can I use shell like command substitution in the vim command-line mode?
For example, if I want to edit a particular path whose path is available as output of another command, say, which foo
, I could do something like this on the shell.
vim "$(which foo)"
How can I do this with the :e
command when I am already within Vim?
I am looking for something that is the equivalent of :e $(which foo.txt)
.
The above is just a short example so that this question makes sense for everyone. Here is the real reason why I am looking for this answer.
In the shell, I can execute gdb -p $(pidof bar)
to attach to a process bar and debug it. With Vim, I am using ConqueGdb which accepts the same arguments as gdb, so I would want to do something like :ConqueGdb -p $(pidof bar)
from within Vim.
Upvotes: 5
Views: 1084