Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use BBEdit as your terminal editor UNIX
You can use BBEdit as your default shell (terminal) editor instead of pico by setting the EDITOR environment variable to BBEdit. Since version 6.5 (I believe) BBEdit has come with a command line program to launch bbedit from the terminal.

Add the following to your ~/.cshrc file (you can also type it in the terminal to check the effect).

  setenv EDITOR bbedit
That will set your editor to BBEdit. If you want to try it out, use a program such as less to open a text file (e.g. less /etc/hostconfig). Then type the letter v in less, and the file will open in BBEdit for editing rather then pico.

Note: If you change your .cshrc file, you should log into a new shell or use source ~/.cshrc to change the setting.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[10,161 views]  

Use BBEdit as your terminal editor | 12 comments | Create New Account
Click here to return to the 'Use BBEdit as your terminal editor' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
re: Use BBEdit as your terminal editor
Authored by: spnyc on Mar 04, '03 10:26:57AM

if for some reason you don't want to change your default editor from pico/vi to bbedit you can also add this to your login file (~/.cshrc or ~/.login or ~/Library/init/tcsh/aliases.mine):

alias bbedit "open -a bbedit"

then in the terminal type

bbedit FILE_NAME



[ Reply to This | # ]
re: Use BBEdit as your terminal editor
Authored by: Anonymous on Mar 04, '03 11:01:14AM
Um, why not just install the bbedit command line tool? I believe it comes with both 6.5 and 7.0, has a bunch of options, and lets do Unix-y thinkgs like pipe commands to BBEdit.

[ Reply to This | # ]
re: Use BBEdit as your terminal editor
Authored by: ClarkGoble on Mar 04, '03 02:18:42PM

It only came with the pro version. Those of use using BBEdit Lite, since we used it only occasionaly, made use of the above. Actually you had to have the full path for it to work.

i.e.
/Applications/BBEdit\ Lite\ 6.5/BBEdit\ Lite

or whatever it was.

Now that BBEdit Lite is apparently being discontinued I don't know if this is an issue. (The old Lite does everything I need, so it isn't an issue to me - I do my HTML in GoLive)



[ Reply to This | # ]
Use BBEdit as your terminal editor
Authored by: djn1 on Mar 04, '03 10:29:32AM

This looks useful. Is there some way of getting a file to open directly with BBEdit; i.e. if I type 'pico <path/filename>' it will open the file with Pico - is there an equivalent for getting it to open with BBEdit?



[ Reply to This | # ]
Use BBEdit as your terminal editor
Authored by: djn1 on Mar 04, '03 10:31:07AM

ok, my question was answered even before I posted it - such is the efficiency of this site ;-)



[ Reply to This | # ]
Use BBEdit as your terminal editor
Authored by: bluehz on Mar 04, '03 10:51:10AM

Not having any luck with this one. Setenv and verified the EDITOR was set to "bbedit" no matter what I try less, crontab, etc... all open in the old EDITOR pico.



[ Reply to This | # ]
Use BBEdit as your terminal editor
Authored by: wzpgsr on Mar 04, '03 11:09:27AM

Read the man pages for the bbedit command - some these questions are answered there.



[ Reply to This | # ]
Use BBEdit as your terminal editor
Authored by: ackbar on Mar 04, '03 12:06:12PM

Good tip, just one piece of advice- when setting your editor, it's always good to provide a full path. So, make that /usr/bin/bbedit.



[ Reply to This | # ]
Use BBEdit as your terminal editor
Authored by: jzsimon on Mar 04, '03 12:49:09PM

You'll probably want to use the -w option (i.e. bbedit -w) if you use bbedit as a default editor. This causes bbedit to wait until you've finished editing the file is closed before returning to the program that called it.

To quote from the bbedit man page:
------------------------------------
-w

Wait until the file is closed in BBEdit. Normally, the bbedit tool exits immediately after the file arguments are opened in BBEdit. The -w option allows the bbedit tool to be used as an external editor for Unix tools that use the EDITOR global environment variable. To make this work using tcsh, add the following line to your .cshrc file:

setenv EDITOR "bbedit -w"



[ Reply to This | # ]
Use BBEdit as your terminal editor
Authored by: vanye451 on Mar 04, '03 04:36:39PM

I've mucking around in the bash man pages looking for a way to do this for the bash shell from the command line. Does anyone know the proper command syntax?



[ Reply to This | # ]
Use BBEdit as your terminal editor
Authored by: ab on Mar 04, '03 10:52:50PM

Just put this in your .bashrc:

export EDITOR="bbedit -w"

-ab



[ Reply to This | # ]
Use BBEdit as your terminal editor (bash)
Authored by: vanye451 on Mar 05, '03 12:01:25AM

thnx ab!



[ Reply to This | # ]