我希望能够搜索仅驻留在我在 vim 中打开的文件目录中的文件。
阿克的纪录片说:
:Ack[!] [options] {pattern n} [{directory}] *:Ack*
Search recursively in {directory} (which defaults to the current
directory) for the {pattern}. Behaves just like the |:grep| command, but
will open the |Quickfix| window for you. If [!] is not given the first
occurrence is jumped to.
在VimFandom 上,我发现我可以获取文件的当前目录,
echo expand('%:p:h')
但我如何才能在 Ack 命令中对其进行评估?
我需要这样的东西:
:Ack searchpattern expand('%:p:h')