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