How to change default terminal editor
It should be possible to change the default terminal editor by setting an environment variable in .bash_profile.
I have tried various permutations of, for instance:
export EDITOR=/Applications/TextWrangler.app
including:
export EDITOR=/Applications/TextWrangler.app/Contents/MacOS/TextWrangler
and TextEdit tenaciously holds on as the default editor.
"prinetenv" even displays the default at:
EDITOR=/Applications/TextWrangler.app
Yet, Textedit remains the default editor.
Can anyone help me figure this out. Apple must set the default editor sin some oddball way.
Thanks,
--Kenoli
The default editor would need to be a unix editor that's compatible with running in the terminal. To run a gui app from the terminal, you use the open command.
TextWrangler has an optional install for terminal commands. Do the install. Use the textwrangler command in your edit line.
R
I have installed the command line tools for TextWrangler.
As far as I can tell
open -t
in the terminal should open the default editor. Instead it opens TextEdit.
Also, I believe:
export EDITOR=/Applications/TextWrangler.app
or
export EDITOR=/Applications/TextWrangler.app/Contents/MacOS/TextWrangler
should set the default editor to TextWrangler.
open -a /Applications/TextWrangler.app
causes the terminal to open TextWrangler.
The reason this is important here is that I am trying to set TextWrangler as default editor in GIT because there is something in TextEdit that causes characters to read incorrectly in the terminal.
--Kenoli
This worked for me:
1) install textwrangle command line tools.
https://www.barebones.com/support/textwrangler/cmd-line-tools.html
2)
mac $ echo $EDITOR /usr/bin/nano mac $ export EDITOR=edit mac $ echo $EDITOR edit
echo "export EDITOR='twr'">>~/.bashrc
echo "export PATH=${PATH}:/usr/local/bin">>~/.bashrc
ln -s /Applications/TextWrangler.app/Contents/MacOS/TextWrangler /usr/local/bin/twr
echo "[[ -s ~/.bashrc ]] && source ~/.bashrc
">>~/.bash_profile
Restart the terminal
twr .
should work!
open filename.txt -> should open using textwrangler
最后更新:2017-08-26 06:42:10
上一篇:
Drivers??
下一篇:
Short cut not synchronising on my new 10.5" iPad
Problems opening laptop pro early 2011 after Si...
I have a macbook pro 2012, bought power cable M...
Issues: "Mac can't connect to iCloud because of...
Trash empty problem
Unfortunately I inadvertently perchased this item
Mickey mouse not talking watch series 3
Some of my calendar dates and appointments From...
One of an Apps never worked
How do I get rid of unwanted pop
my ipad is disable due to a wrong pasword
相关内容
"com.apple.installer.pagecontroller error
any idea what error 3503 is?
Underallocation Detected on Main device
The operation couldn’t be completed. (BKA...
is ctoid.exe a virus on my ipad safari browser?
iTunes Error: Declined to authorize this image ...
Keep High Efficiency Original if Available Chec...
iTunes 12.7 cannot edit playlist
High Sierra Stuck & Decryption paused
Need to unlock iphone 5 to reactivate the phone...
热门内容
Christian Music Removed From Itunes
I'm being billed twice every month for Apple Mu...
iMac running slow
Fix disappearing album art after moving iTunes
Activation Locked iWatch
Can I change the iwatch to miles instead of kil...
I keep seeing the "You don't have permission to...
can't read any menus macbook air
iPad 2, iOs9.3, taking days to restore
charges made under itune memeberships