Sublime Forum

"Close All"

#1

When you right click on a tab you can “Close”, “Close others” and “Close tabs to the right”.

That last option I can’t imagine many scenarios where I would use it, and wouldn’t complain if it were removed, but that’s not what my suggestion is about.

I quite often want to close all open tabs (for various reasons - done for the day and want to close out the files I was working on, done working on something specific and want to clear out the opened files to work on something else, etc.). I would love a “Close all” option that closes all tabs. As it is now, I choose “Close others” and then have to click the ‘x’ on the one remaining tab. Seems like it would be easy to add this small option.

(I was last using phpDesigner which has this option)

0 Likes

#2

Have you tried “File > Close All Files”?

0 Likes

#3

You can easily do this yourself, the command is “close_all”. For example I have the following in my user key bindings:

{ "keys": "super+shift+w"], "command": "close_all" },

But if you want it in the tab right click menu:

  • go to your User folder (on OSX it’s in the menu item Sublime Text 2->Preferences->Browse Packages, and then the folder “User”).

  • Create a file named “Tab Context.sublime-menu”.

  • Add the following text to that file:


	{"command": "close_all", "caption": "Close all tabs" }
]
  • Save the file and now when right clicking a tab you should have the “Close all tabs” item listed there
1 Like

#4

I gotta admit - that’s pretty cool, and works perfectly. I’d prefer it be grouped with the other ‘Close’ options at the top instead of listed all the way at the bottom, but beggars can’t be choosers, etc. :wink:

Thanks for the tip!

0 Likes

#5

[quote=“bfarber”]I’d prefer it be grouped with the other ‘Close’ options at the top instead of listed all the way at the bottom, but beggars can’t be choosers, etc.
[/quote]

You can do this by editing “/Default/Tab Context.sublime-menu” rather than your user version. Beware though that it might get overwritten when updating Sublime Text 2 to a newer version.

0 Likes

#6

Thanks for the tip. :smile: I think I will stick with the user preference for now. It would be nice if this was added by default as I mentioned initially, but if it’s not, the user one will work fine for me (and I’m sure I’ll adjust to the location of the option vs the defaults over time).

0 Likes