Emacs minor mode for editing Homebrew formulae.
(add-to-list 'load-path "/where/is/homebrew-mode")
(require 'homebrew-mode)
(global-homebrew-mode)
The command prefix is C-c C-h. These are the commands currently mapped to it:
-
C-c C-h f: Download the source file(s) for the formula in the current buffer.
-
C-c C-h u: Download and unpack the source file(s) for the formula in the current buffer.
-
C-c C-h i: Install the formula in the current buffer.
-
C-c C-h r: Uninstall the formula in the current buffer.
-
C-c C-h t: Run the test for the formula in the current buffer.
-
C-c C-h a: Audit the formula in the current buffer.
-
C-c C-h s: Open a new buffer running the Homebrew Interactive Shell (
brew irb
). -
C-c C-h c: Open a dired buffer in the Homebrew cache (default
/Library/Caches/Homebrew
). -
C-c C-h d: Add
depends_on
lines for the specified formulae. Call with one prefix (C-u) argument to make them build-time dependencies; call with two (C-u C-u) for run-time. -
C-c C-h p: Insert Python
resource
blocks (requires poet, installed withpip install homebrew-pypi-poet
).
These are just the most important variables; run M-x customize-group RET homebrew-mode
to see the rest.
-
If you’re using Linuxbrew or a non-standard prefix on Mac OS, you’ll need to update
homebrew-prefix
to point at yourbrew –-prefix
. -
If you’re using Linuxbrew or have your cache in a non-standard location on Mac OS, update
homebrew-cache-dir
. -
If you want to turn on whitespace-mode when editing formulae that have inline patches, set
homebrew-patch-whitespace-mode
tot
. It’s off by default since it looks ugly.