
This tip can be used for other commands you find it hard to remember. if you use BBEdit, TextMate, etc. Other relevant options-t opens in the default editor (i.e. The -a flag specifies any application you want, so it's applicable to any number of situations, including ones where TextEdit isn't the default editor. Now when you want to edit a file from Terminal just type in: textedit /path/filename.txt open -a TextEdit filename should do the trick. I had tried assigning in the Apple's System Preferences > Keyboard > Keyboard Shortcuts > Application Shortcuts and on OS X 10.8.5 and while I can technically assign command-enter for the script menu command in TextWrangler nonetheless it doesn't work. Also thanks for the tip on assigning command-enter from TextWrangler Preferences. You’ll need to reload the bash_profile if you want this to function immediately. jackjr300, Thanks for the info on the image annotation. You can put something else in place of the alias “textedit” if you like, such as “tedit”. Now, add these two lines: alias textedit='open -a TextEdit’
Mac open bbedit from terminal update#
If you don’t have a bash_profile (you’ll get an error telling you so), just use the touch command to create one (Note: the touch command is designed to update the modified data on a file, but if the file does not exist, it will create it): touch ~/.bash_profile We’ll do this by setting up an alias in your bash_profile. You can make this even easier, by eliminating the need to remember the original command I gave above. sudo open -e /path/lockedfile.txt Making it easier to remember Just use this command (but only if you need to). Then it is better to use the -e switch, because if you specify TextEditor directly, the file may still be un-editable once opened. If the file is locked, you may need admin rights.

It would look like this: open -e /path/file.txt

Then there’s the -e which will open the file automatically with TextEditor, so there is no need to specify TextEditor yourself.

You can also use the -t switch to open the file in whatever the default application is for that filetype. The five commands we just ran above only need to be run once: the flag. Also, you won’t need to put in the /path if you’re already in the directory where the file exists. BBEdit (Mac, with command line tools), git config -global core.editor bbedit. There is special support for MacVim, TextMate, and BBEdit when you. You can also call up any other text editor you prefer, such as BBEdit or Coda for example. Unlike most macOS apps, iTerm2 can open a fullscreen. In this case, if you have TextEditor already open, the file will open in a new window on that instance of TextEditor. The -a switch allows you to specify any application you like, and it will call up any existing instance of that app. To open a file within Terminal using TextEditor, use this command: open -a TextEditor /path/file.txt
Mac open bbedit from terminal how to#
Here’s a few suggestions on how to easily invoke TextEditor (or any other GUI based editor you prefer) from the command line in Terminal. A lot of people find the ASCII based command-line text editors (like Vim) a pain to work with.
