Home Download Buy Blog Forum Support

OSX command line "edit" doesn't launch sublime

OSX command line "edit" doesn't launch sublime

Postby jacksonhole on Fri Oct 26, 2012 7:16 pm

I followed the instructions here to set sublime as the default editor to launch from the command line.
http://www.sublimetext.com/docs/2/osx_command_line.html

However, when I run this:
$ edit /tmp/foo.txt

TextWrangler opens. It looks like my EDITOR environment variable is set right:
declare -x EDITOR="subl -w"

Any ideas?
jacksonhole
 
Posts: 2
Joined: Fri Oct 26, 2012 7:11 pm

Re: OSX command line "edit" doesn't launch sublime

Postby phillip.koebbe on Fri Oct 26, 2012 8:47 pm

Do

Code: Select all
$ which edit

and see if you get something like

Code: Select all
/usr/local/bin/edit

Then do

Code: Select all
$ edit --version

and see if you get something like

Code: Select all
    Edit tool version 2.0 (v86) Apr 30 2012
    TextWrangler application version 4.0.1 (3152)

    Copyright 2001-2012 Bare Bones Software, Inc.

Then do

Code: Select all
$ man edit

and see if you get something like:

Code: Select all
NAME
       edit - (TextWrangler) Whip some ASCII.

...

AUTHORS
        Bare Bones Software, Inc.
        Web site: http://www.barebones.com/
        Email: support@barebones.com

04/30/2012                                                 Bare Bones Software, Inc.                                                   EDIT(1)


If you got output something like I posted, 'edit' is a command line interface to TextWrangler.
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: OSX command line "edit" doesn't launch sublime

Postby jacksonhole on Fri Oct 26, 2012 9:36 pm

Thanks Phillip, you pegged it. I found the below online as an "uninstall" for the TextWrangler command line utils. After running, the edit command doesn't work. I added the following as an alias in ~/.bash_profile, and that appears to do the trick.

Alias to fix (?) edit command:
alias edit='subl -w'

TextWrangler command line "uninstall" (produced some errors, but seemed to do the trick):
sudo pkgutil --unlink com.barebones.textwrangler.tools.textwranglerCommandlineTools.edit.pkg;
sudo pkgutil --forget com.barebones.textwrangler.tools.textwranglerCommandlineTools.edit.pkg;
sudo rm /usr/local/bin/edit;

sudo pkgutil --unlink com.barebones.textwrangler.tools.textwranglerCommandlineTools.edit-1.pkg;
sudo pkgutil --forget com.barebones.textwrangler.tools.textwranglerCommandlineTools.edit-1.pkg;
sudo rm /usr/local/share/man/man1/edit.1;

sudo pkgutil --unlink com.barebones.textwrangler.tools.textwranglerCommandlineTools.twdiff.pkg;
sudo pkgutil --forget com.barebones.textwrangler.tools.textwranglerCommandlineTools.twdiff.pkg;
sudo rm /usr/local/bin/twdiff;

sudo pkgutil --unlink com.barebones.textwrangler.tools.textwranglerCommandlineTools.twdiff-1.pkg;
sudo pkgutil --forget com.barebones.textwrangler.tools.textwranglerCommandlineTools.twdiff-1.pkg;
sudo rm /usr/local/share/man/man1/twdiff.1;

sudo pkgutil --unlink com.barebones.textwrangler.tools.textwranglerCommandlineTools.twfind.pkg;
sudo pkgutil --forget com.barebones.textwrangler.tools.textwranglerCommandlineTools.twfind.pkg;
sudo rm /usr/local/bin/twfind;

sudo pkgutil --unlink com.barebones.textwrangler.tools.textwranglerCommandlineTools.twfind-1.pkg;
sudo pkgutil --forget com.barebones.textwrangler.tools.textwranglerCommandlineTools.twfind-1.pkg;
sudo rm /usr/local/share/man/man1/twfind.1;
jacksonhole
 
Posts: 2
Joined: Fri Oct 26, 2012 7:11 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 27 guests