Skip to content

Instantly share code, notes, and snippets.

@NigelThorne
Created June 24, 2015 03:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NigelThorne/067cb108c55162bad2aa to your computer and use it in GitHub Desktop.
Save NigelThorne/067cb108c55162bad2aa to your computer and use it in GitHub Desktop.
Use sublime text with 7zip
"%~dp0subl.exe" -n -w %1
@NigelThorne
Copy link
Author

Drop the above script into the same folder as subl.exe (c:\Program files\Sublime Test 3\ for me)
Set Zip's "Editor" to the full path of the above script.
Now you can edit files from within zip files.. right click, edit... then save/close the document to get a "this has changed do you want to update the zip?" message box.

@xaume
Copy link

xaume commented Sep 3, 2015

Amazing. I've been looking for this. Thanks.

@thefuntastic
Copy link

Awesome thank you!

One line that's a bit ambiguous "Set Zip's "Editor" to the full path of the above script." For anyone else confused I take this to mean set the path in 7zips Tools>Options>Editor>Editor

@likenspio
Copy link

Great, thank you! 😃

Only one question: how to make the script work when closing the tab? Because I have to close the whole program (Sublime 3) for 7zip to detect there is a change in the file.

@NigelThorne
Copy link
Author

I don't think you can. 7Zip launches the process, then needs to know when you have finished editing, so it knows when to update the Zip file. It does that by detecting when the launched process exits.

@likenspio
Copy link

likenspio commented Jul 17, 2019 via email

@tanyanghan
Copy link

You don't need to have a separate batch file. In 7zips Tools>Options>Editor>Editor, just enter the full path in double quotes followed by -n -w:

In the 7Zip menu Tools>Options>Editor>Editor, enter:

"C:\Program Files\Sublime Text 3\subl.exe" -n -w

@Narretz
Copy link

Narretz commented Oct 26, 2021

You don't need to have a separate batch file. In 7zips Tools>Options>Editor>Editor, just enter the full path in double quotes followed by -n -w:

That's the easiest solution, but not all versions support it. I tested it with 7ZIP 16.04, and it didn't work. Updated to 19.0, and it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment