Better Grep Defaults for Emacs
; Better GREP Defaults
; `grep --color=auto -nH --null -e' + "pattern" filename(s)
;; --color=auto: Colorizes matches
;; -n: Shows line numbers
;; -H: Shows filenames
;; --null: Uses the null character as the separator
;; -e: Explicitly specifies the search pattern
;; XEmacs
;; Simple: grep -n
(setopt grep-command "grep --color=auto -rni -A1 ")
;; -r: Recursive searching; implies -H
;; -n: Shows line numbers
;; -A1: Adds a single line of context
;; A space to input your search query
;; (global-set-key (kbd "M-s g") 'grep)
Return to Home