I had installed Sublime Text 3 a few months back, and using some online resource I had made it accessible through Unity Launcher(unfortunately, I don’t remember which resource, or how I did it).
So, currently I can only open Sublime Text using launcher and to open a new file I have to use the menu(or Control+N).
I want to be able to open a file in sublime text using terminal.i.e something like:
sublime_text newfile.txt
.Steps I took:
1…..
I searched and found that SublimeText folder(and the script) was in
/opt
directory.So I wrote a 2 line script to point to the script and run it, and then wrote an an alias called Sublime_Text to run that script and put it in the .bashrc file.So now I can write
Sublime_Text
and it opens the sublime_text3 editor, but command likeSublime_Text newfile.txt
does not give me a new file(only opens sublime_text and no newfile)2…..
I tried to copy the sublime_text script originally in the /opt/sublime_text folder into /usr/bin/ directory (since vim, vi and other terminal commands are kept in that folder). Unfortunately,
sublime_text newfile.txt
shows several errors like:
Error loading colour scheme Packages/Color Scheme - Default/All Hallow's Eve.tmTheme: Unable to open Packages/Color Scheme - Default/All Hallow's Eve.tmTheme
and other 3 errors of the form:
Error loading syntax file"XYZ"
Answer
You can launch Sublime Text 3 using subl
or subl file
in the terminal.
Attribution
Source : Link , Question Author : viv1 , Answer Author : ShadowMitia