I have a Vim mapping to start searching (ack-grep with ack.vim plugin) for a pattern from the directory that is the current directory (so the result after :pwd
). This mapping works when I'm looking at a buffer.
I want to use the same mapping while I'm in netrw. But, I want to change the current directory (:pwd) to the directory netrw is showing me, so the search will be started from the directory I'm looking at. I know I can do this with the netrw c
command, but obviously I only want to give this command if I'm actually in netrw.
Question How do I detect whether the current window is in netrw "mode"?