有时候,就算在用git,也希望 ack时,提示的Directory是buffer所在目录。
(defun ack-pwd ()
"return the current buffer's directory"
(file-name-directory buffer-file-name))
(global-set-key (kbd "<f8>") 'ack)
再将ack-pwd
添加到ack-root-directory-functions
的第一位:
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ack-prompt-for-directory t)
'(ack-root-directory-functions (quote (ack-pwd ack-guess-project-root))))