I would like to get an AND -operator to the following Vim command
:command! -nargs=1 GrepSource :! grep <args> `sed -n 's/^source \(.*\)/\1/p' %`
such that I can use the command to find sources at
# source <path>
# . <path>
source <path>
. <path>
I am not sure whether it is possible or not to get AND -operator to SED or Vim.
How can you add an AND -operator to the SED command?
You can just use Vim regular expressions to find the
<path>name, instead of usingsed:I think that command should do what you want. You can use the next command to test what is happening (‘exe’ is changed to ‘echo’):
The command must be used on a line in one of the following forms: