I run vim .
in some directory. Inside vim I move to another directory. There I run :grep
command which searches from the first directory where I run vim .
. How to configure vim to :grep
from the path where currently it is?
I have the <leader>cd
to %:p:h
mapping too, it is nice.
However for your needs, this line may be better
:grep [options] 'pattern' %:p:h/*
this will do grep
from the path of current open file, and keep your real current directory (pwd
) untouched.
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