Skip to content

Instantly share code, notes, and snippets.

@ngn999
Last active December 21, 2015 03:28
Show Gist options
  • Save ngn999/6242366 to your computer and use it in GitHub Desktop.
Save ngn999/6242366 to your computer and use it in GitHub Desktop.
full-ack mode的设置

有时候,就算在用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))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment