![]() Normally (in most cases, but see below) if you say subl -w test.txt, it will open the file, and when you close it focus goes back to the terminal that you used to run subl. It’s not mentioned here, but this command only does anything if you’re also using -w or -wait command to wait for the file to be closed before exiting. s or -stay: Keep the application activated after closing the file ![]() You might use that if you want to queue up a file for editing but you’re still doing something else and not ready to get to editing yet. Saying subl -b test.txt tells it to open the file, but the focus remains where it was Sublime is now sitting with the file open for you, but you can continue in the command line. Normally subl test.txt would tell Sublime to open the file, and then give Sublime the input focus so that you can immediately start editing. b or -background: Don't activate the application This is useful if you’re using Sublime in a script or process that should not continue until you’re done editing the file (for example, using Sublime as the editor for your git commit messages). Saying subl -w test.txt instead tells it to wait until you’ve closed the file, and then quit. Normally if you said subl test.txt, the command would tell Sublime to open the file, and then it would quit. w or -wait: Wait for the files to be closed before returning That said, those arguments change what the command line portion of Sublime does in addition to passing the command along. Those arguments are only of use to you if you’re using the command prompt if you’re just setting up Windows or your OS to open files, including creating shortcuts or what have you, you don’t need to worry about them. If there’s not already a copy of Sublime running, it starts it running and then passes the command along before quitting. When you run Sublime from a terminal, it interacts with the running copy of Sublime and tells it what you asked it to do, and then quits, leaving the already running copy of Sublime to carry out your instructions. h or -help: Show help (this message) and exitįilenames may be given a :line or :line:column suffix to open at a specific ![]() a or -add: Add folders to the current window You may want to work it so that you get both options (one with the -add and one without) in case you want it to work both ways. In that case you need to specifically tell Sublime that it’s supposed to add the folder to the current window instead of opening a new one, which you can do by adding the -add command line option (see below).įor example, sublime_text c:\myFolder will open the folder in a new window while sublime_text -add c:\myfolder will add it to the existing window. [HKEY_CLASSES_ROOT\*\shell\Open with Sublime Files\\Sublime Text 3\\sublime_text.exe \"%1\"" "Icon"="C:\\Program Files\\Sublime Text 3\\sublime_text.exe,0" [HKEY_CLASSES_ROOT\*\shell\Open with Sublime with &Sublime Text" create a file sublimetext.reg with the content:.insert the value C:\Program Files\Sublime Text 3\sublime_text.exe,0.right click and select New > string/char array and call it Icon.select the “Open with Sublime Text” key.Now you should have the command and it should work. Insert C:\Program Files\Sublime Text 3\sublime_text.exe "%1" (you may need to adapt the path to your installation).Double click on this to change the value. On the right side there should be something like (standard) on the top.right click on that key and again select New > Key and name it “command” and select it with left click.right click on shell and select New > Key and name it “Open with Sublime Text”. ![]() write regedit and press enter, this should open a window with a tree structure on the right.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |