Sublime text: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:


* Open the terminal
* Open the terminal
* Key in {{kbd | key=<nowiki>subl path/to/file.txt</nowiki>}}
* Key in {{kbd | key=<nowiki>subl path/to/file.txt</nowiki>}} where {{kbd | key=<nowiki>subl</nowiki>}} is the alias shorthand for sublime text


=== Explanation ===
=== Explanation ===

Revision as of 15:21, 9 April 2025

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