Skip to content

Instantly share code, notes, and snippets.

View daviderestivo's full-sized avatar
🎧
Focusing

Davide Restivo daviderestivo

🎧
Focusing
View GitHub Profile
@daviderestivo
daviderestivo / helm-ag.el
Created August 22, 2017 06:18
Replace helm grep with ag (The Silver Searcher)
;; Replace the default helm grep command with ag.
;; Requires "The Silver Searcher" (ag) to be installed.
;; On macOS use: 'brew install the_silver_searcher'
(when (executable-find "ag")
;; For helm to recognize correctly the matches we need to enable
;; line numbers and columns in its output, something the
;; --vimgrep option does.
(setq helm-grep-default-command "ag --vimgrep --nogroup --nocolor -z %p %f"
helm-grep-default-recurse-command "ag --vimgrep --nogroup --nocolor -z %p %f"))
@daviderestivo
daviderestivo / python-superword.el
Last active August 22, 2017 06:48
Add superword mode to python-mode
;;
;; superword-mode is a minor mode that allows emacs
;; to treat a word separated by '_' as a single one
;; This might be useful for example when moving betwwen
;; words using 'Alt + F' or 'Alt + B' in python-mode
;;
(add-hook 'python-mode-hook
'(lambda ()
;; Enable superword mode, useful for “snake_case”.