Sublime text
Jump to navigation
Jump to search
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
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"'