├── Default (Linux).sublime-keymap ├── Default (OSX).sublime-keymap ├── Default (Windows).sublime-keymap ├── Context.sublime-menu ├── Default.sublime-commands ├── Main.sublime-menu ├── close_others.py └── README.md /Default (Linux).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "keys": ["alt+super+w"], "command": "close_other_windows" 4 | }, 5 | { 6 | "keys": ["ctrl+super+w"], "command": "close_other_tabs" 7 | } 8 | 9 | ] 10 | -------------------------------------------------------------------------------- /Default (OSX).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "keys": ["alt+super+w"], "command": "close_other_windows" 4 | }, 5 | { 6 | "keys": ["ctrl+super+w"], "command": "close_other_tabs" 7 | } 8 | 9 | ] 10 | -------------------------------------------------------------------------------- /Default (Windows).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "keys": ["alt+super+w"], "command": "close_other_windows" 4 | }, 5 | { 6 | "keys": ["ctrl+super+w"], "command": "close_other_tabs" 7 | } 8 | 9 | ] 10 | -------------------------------------------------------------------------------- /Context.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "CloseOtherWindows", 4 | "command": "close_other_windows", 5 | "caption": "Close Other Windows" 6 | }, 7 | { 8 | "id": "CloseOtherTabs", 9 | "command": "close_other_tabs", 10 | "caption": "Close Other Tabs" 11 | }, 12 | 13 | 14 | ] 15 | -------------------------------------------------------------------------------- /Default.sublime-commands: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "Close Other Windows: Close all windows except the active one", 4 | "command": "close_other_windows" 5 | }, 6 | { 7 | "caption": "Close Other Tabs: Close all tabs except the active one", 8 | "command": "close_other_tabs" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "File", 4 | "mnemonic": "F", 5 | "id": "file", 6 | "children": 7 | [ 8 | { 9 | "caption": "Close Other Windows", 10 | "mnemonic": "", 11 | "id": "close_other_windows", 12 | "command":"close_other_windows" 13 | }, 14 | { 15 | "caption": "Close Other Tabs", 16 | "mnemonic": "", 17 | "id": "close_other_tabs", 18 | "command":"close_other_tabs" 19 | } 20 | ] 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /close_others.py: -------------------------------------------------------------------------------- 1 | #------------------------------------Close Other Windows ---------------------- 2 | # Author: Manfred Wuits 3 | # Email : manfred@werkzeugh.at 4 | # Version : 1.0 5 | #---------------------------------------------------------------------------- 6 | 7 | import sublime, sublime_plugin 8 | 9 | class closeOtherWindowsCommand(sublime_plugin.WindowCommand): 10 | def run(self): 11 | allWindows=sublime.windows() 12 | currentWindow = sublime.active_window() 13 | for i,w in enumerate(allWindows): 14 | if currentWindow != w: 15 | w.run_command('close_window') 16 | 17 | class closeOtherTabsCommand(sublime_plugin.TextCommand): 18 | def run(self, edit): 19 | window = self.view.window() 20 | group_index, view_index = window.get_view_index(self.view) 21 | window.run_command("close_others_by_index", { "group": group_index, "index": view_index}) 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CloseOtherWindows-Sublime-PLugin 2 | ============================== 3 | 4 | what it does 5 | ------------ 6 | it provides 2 commands: 7 | 8 | - Close all windows except current window. 9 | - Close all tabs except current tab 10 | (you could achieve the same by right-clicking on a tab and choose 'close other tabs') 11 | this package gives you a keyboard shortcut for that (btw, the same as on TextMate) 12 | 13 | Key and menu options 14 | -------------------- 15 | - Click File menu option and select Close Other Windows 16 | - Right click and select Close Other Windows 17 | - Press `Alt`+`Super`+`w` 18 | 19 | - Click File menu option and select Close Other Tabs 20 | - Right click and select Close Other Tabs 21 | - Press `Ctrl`+`Super`+`w` 22 | 23 | How to download 24 | ----------------- 25 | 26 | With Package Control: 27 | 28 | Run “Package Control: Install Package” command, find and install `Close Other Windows` plugin. 29 | Restart ST editor (if required) 30 | 31 | * Do a git clone in package directory: 32 | https://github.com/werkzeugh/CloseOtherWindows-SublimePlugin.git 33 | 34 | License 35 | ------- 36 | Creative Commons License
CloseOtherWindows by Manfred Wuits is licensed under a Creative Commons Attribution 3.0 Unported License.
Permissions beyond the scope of this license may be available at manfred@werkzeugh.at. 37 | --------------------------------------------------------------------------------