15,028
edits
(Created page with "[https://www.sublimetext.com/ Sublime Text - Text Editing, Done Right] == How do I open a Sublime Text file in terminal == * Open the terminal * Key in {{kbd | key=<nowiki>s...") |
No edit summary |
||
| Line 5: | Line 5: | ||
* 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>}} | ||
=== Explanation === | |||
1. Determine which shell you're using by running this in Terminal: | |||
<pre> | |||
echo $SHELL | |||
</pre> | |||
2. Edit the appropriate configuration file: | |||
My result on {{Mac}} is | |||
<pre> | |||
/bin/zsh | |||
</pre> | |||
Choose appropriate configuration file | |||
<pre> | |||
For Bash: ~/.bash_profile or ~/.bashrc | |||
For Zsh (default on newer macOS): ~/.zshrc | |||
</pre> | |||
3. Open the file with a text editor: | |||
<pre> | |||
vi ~/.zshrc | |||
</pre> | |||
4. Existing alias in the file: | |||
<pre> | |||
alias subl='open -a "Sublime Text"' | |||
</pre> | |||
== References == | == References == | ||
* [https://www.folkstalk.com/tech/open-file-in-sublime-from-terminal-with-code-examples/ Open File In Sublime From Terminal With Code Examples] | * [https://www.folkstalk.com/tech/open-file-in-sublime-from-terminal-with-code-examples/ Open File In Sublime From Terminal With Code Examples] | ||
* [https://www.sublimetext.com/docs/command_line.html Command Line Interface] | |||
[[Category:Software]] | [[Category: Software]] [[Category: Revised with LLMs]] | ||