Sublime text

From LemonWiki共筆
Jump to navigation Jump to search

Sublime Text - Text Editing, Done Right

How do I open a Sublime Text file in terminal

  • Open the terminal
  • Key in subl path/to/file.txt where subl is the alias shorthand for sublime text

Explanation

1. Determine which shell you're using by running this in Terminal:

echo $SHELL

2. Edit the appropriate configuration file:

My result on macOS icon_os_mac.png is

/bin/zsh

Choose appropriate configuration file

For Bash: ~/.bash_profile or ~/.bashrc
For Zsh (default on newer macOS): ~/.zshrc

3. Open the file with a text editor:

vi ~/.zshrc

4. Existing alias in the file:

alias subl='open -a "Sublime Text"'

References