Last active
August 29, 2015 14:15
-
-
Save smockle/c7fde7783ba2841257f5 to your computer and use it in GitHub Desktop.
Close inactive tabs using Option-Command-w in Atom Editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the lines below to your init script, | |
# accessible via Atom > Open Your Init Script | |
atom.commands.add 'atom-workspace', 'tabs:force-close-other-tabs', -> | |
tabBar = atom.workspace.getPanes()[0] | |
tabBarElement = atom.views.getView(tabBar).querySelector(".tab-bar") | |
tabBarElement.querySelector(".active").classList.add("right-clicked") | |
atom.commands.dispatch(tabBarElement, 'tabs:close-other-tabs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the lines below to your keymap, | |
# accessible via Atom > Open Your Keymap | |
'atom-workspace': | |
'alt-cmd-w': 'tabs:force-close-other-tabs' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By using
atom-workspace
instead ofatom-text-editor
, the command will run if (e.g.) the Find in Project pane or the Settings pane is active.