Closes highlighted tabs. To replace ctrl-w on Windows/Linux for Vim users!
Better Ctrl-W Extension
Vim users are used to using the `Ctrl-w` key combination for deleting the last
word when in insert mode. That's no problem for Mac OS users when using
chrome, as the keyboard shortcut for closing a tab is Cmd+w. This is a problem
when using the browser on either Linux or Windows machines, as `Ctrl-w` is the
shortcut for closing a window. So, when editing a text, a Vim user might
accidentally close the current tab by issuing a `Ctrl-w` command, sometimes losing
important text that was being edited.
That annoyance motivated people to discuss solutions on [a StackOverflow thread][1],
in which user [`samson`][2] commented he created [a Chrome extension][3] precisely to:
1. Assign `Ctrl-w` to an extension shortcut that does absolutely nothing
2. Assign a hotkey to close the current tab (I like to use `Alt-w` to mimic Mac OS's `Cmd+w`)
The problem with his extension is that it only works with the currently active tab,
and I regularly use `Shift + Click` to highlight a bunch of tabs, so that I can close them
all at once. His plugin didn't support multiple highlighted tabs, so I created my own.
# Usage
To use this plugin as it's intended, you have to set up the keyboard shortcuts after
installing it. Go to `chrome://extensions/shortcuts` and set the following shortcuts:
1. Assign `Do absolutely nothing` to `Ctrl-w`
2. Assign `Close highlighted tabs` to `Alt-w` or any other key combination of choice
This way, `Ctrl-w` will no longer close the current tab by mistake when editing it,
and you will be able to use `Alt-w` to close either the current of all highlighted tabs.
[1]: https://superuser.com/a/1207752
[2]: https://superuser.com/users/276658/samson
[3]: https://chrome.google.com/webstore/detail/ctrlw/goejokenmdamcapadhgghgpeeaeaaedc?hl=en
Source Manifest.json
Similar Extensions
Keyboard Shortcuts 1,000+ 99 ★ 33.04KiB
Block Ctrl W 1,000+ 4 ★ 16.26KiB
Hotkeys 1,000+ 68 ★ 97.19KiB
Disable keyboard shortcuts 1,000+ 162 ★ 6.29KiB
Shortkeys (Custom Keyboard Shortcuts) 1,000+ 739 ★ 255KiB
QuicKey – The quick tab switcher 1,000+ 117 ★ 441KiB
Block keys to kiosk mode 1,000+ 1 ★ 123KiB
wasavi 1,000+ 141 ★ 475KiB
Vimsert 1,000+ 3 ★ 203KiB
Surfingkeys 1,000+ 279 ★ 1.2MiB
AutoControl: Keyboard shortcuts, Mouse gestures 1,000+ 334 ★ 1.38MiB
Vimium C - All by Keyboard 1,000+ 176 ★ 399KiB
Custom Hotkeys 1,000+ 9 ★ 82.95KiB
Disable key input 1,000+ 2 ★ 6.07KiB
Firenvim 1,000+ 29 ★ 325KiB
Shortcut Forwarding Tool 1,000+ 3 ★ 26.26KiB
Custom Chrome Shortcut Manager 1,000+ 12 ★ 202KiB
Shortcuts for Chromium 1,000+ 5 ★ 537KiB
NewTab Adapter 1,000+ 5 ★ 31.19KiB
Keyboard shortcuts to manage Chrome tabs 1,000+ 28 ★ 295KiB
Rearrange Tabs 1,000+ 153 ★ 7.41KiB
Promnesia 1,000+ 2 ★ 429KiB
Emacs shortcuts IME 1,000+ 3 ★ 26.64KiB
User reviews
Elroyskimms (ID: 00000000e2961e1c) Voted 5 ★ - Updated 02/16/2023
Michael Chao (ID: 0000008915105431) Voted 1 ★ - Updated 12/18/2022
Miffy Poi (ID: 000000e0622f7b61) Voted 2 ★ - Updated 09/15/2022
Lucy (ID: 0000001fbd470ac9) Voted 1 ★ - Updated 06/12/2022
Mike Michael (ID: 00000038366ad137) Voted 1 ★ - Updated 05/08/2022