Endless Parentheses

Concise ramblings on Emacs productivity.

Exclude Directories from Grep

I keep a couple of subdirectories inside my “.emacs.d/” for the purpose of organization, so rgrep'ing is tremendously useful for finding where a variable is being changed. By default, that will also search inside “elpa/”, which slows the search and pollutes the results page.

We can make grep more selective and, while we're at it, enable line truncation.

(eval-after-load 'grep
     (add-to-list 'grep-find-ignored-directories "auto")
     (add-to-list 'grep-find-ignored-directories "elpa")))
(add-hook 'grep-mode-hook (lambda () (toggle-truncate-lines 1)))

And don't forget to bind rgrep to your Launcher Keymap!

Tags: init.el, emacs

Say thanks on Gratipay
comments powered by Disqus