aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Contributions/manpages/brew.1.md11
-rw-r--r--Library/Homebrew/utils.rb7
-rw-r--r--share/man/man1/brew.19
3 files changed, 24 insertions, 3 deletions
diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md
index 0c5ce1eff..1b1939eac 100644
--- a/Library/Contributions/manpages/brew.1.md
+++ b/Library/Contributions/manpages/brew.1.md
@@ -149,6 +149,14 @@ didn't include with OS X.
* HOMEBREW\_DEBUG:
If set, instructs Homebrew to always assume `--debug` when running commands.
+ * HOMEBREW\_EDITOR:
+ If set, Homebrew will use this editor when editing a single formula, or
+ several formulae in the same folder.
+
+ *NOTE*: `brew edit` will open all of Homebrew as discontinuous files and
+ folders. TextMate can handle this correctly in project mode, but many
+ editors will do strange things in this case.
+
* HOMEBREW\_SVN:
When exporting from Subversion, Homebrew will use `HOMEBREW_SVN` if set,
a Homebrew-built Subversion if installed, or the system-provided binary.
@@ -165,7 +173,8 @@ didn't include with OS X.
configurations.)
* HOMEBREW\_USE\_LLVM:
- If set, instructs Homebrew to use the LLVM front-ends to the GCC compilers.
+ If set, instructs Homebrew to use the LLVM front-ends to the GCC compilers.
+
*NOTE*: Not all formulae will build correctly under LLVM.
* HOMEBREW\_VERBOSE:
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 1fc8a9544..8b3d6fb79 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -140,11 +140,16 @@ def puts_columns items, cols = 4
end
def exec_editor *args
- editor=ENV['EDITOR']
+ editor = ENV['HOMEBREW_EDITOR'] || ENV['EDITOR']
if editor.nil?
if system "/usr/bin/which -s mate"
+ # TextMate
editor='mate'
+ elsif system "/usr/bin/which -s edit"
+ # BBEdit / TextWrangler
+ editor='edit'
else
+ # Default to vim
editor='/usr/bin/vim'
end
end
diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1
index bb5853e36..67c34b3e0 100644
--- a/share/man/man1/brew.1
+++ b/share/man/man1/brew.1
@@ -164,6 +164,13 @@ HOMEBREW_DEBUG
If set, instructs Homebrew to always assume \fB\-\-debug\fR when running commands\.
.
.TP
+HOMEBREW_EDITOR
+If set, Homebrew will use this editor when editing a single formula, or several formulae in the same folder\.
+.
+.IP
+\fINOTE\fR: \fBbrew edit\fR will open all of Homebrew as discontinuous files and folders\. TextMate can handle this correctly in project mode, but many editors will do strange things in this case\.
+.
+.TP
HOMEBREW_SVN
When exporting from Subversion, Homebrew will use \fBHOMEBREW_SVN\fR if set, a Homebrew\-built Subversion if installed, or the system\-provided binary\.
.
@@ -181,7 +188,7 @@ This issue typically occurs when using FileVault (or certain custom SSD configur
HOMEBREW_USE_LLVM
If set, instructs Homebrew to use the LLVM front\-ends to the GCC compilers\.
.
-.br
+.IP
\fINOTE\fR: Not all formulae will build correctly under LLVM\.
.
.TP