Better Ctrl-W

#4 / 15 rate

Better Ctrl-W

1,000 users

2020-05-02

thalesmello

Extension Information

5 star
68%
4 star
0%
3 star
0%
2 star
8%
1 star
24%

Supported Languages

Description

Closes highlighted tabs. To replace ctrl-w on Windows/Linux for Vim users!

# Better Ctrl-W

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

Reviews

Andrew Breidenbach
Andrew Breidenbach

Make sure to follow usage instructions

Elroyskimms
Elroyskimms

This extension does not work automatically after installation. You have to find the "Usage" instructions in the Overview to configure it. The configuration is simple and this extension works perfectly. I can finally use the browser-based terminal application without constantly closing the browser tab.

Miffy Poi
Miffy Poi

does not work on Chrome 105.x 在 Chrome 105.x 版本无法正常工作

Similar extensions

Keyboard Shortcuts
Keyboard Shortcuts

Joe Pestro

ctrlw
ctrlw

Sam Lazarus

Block Ctrl W
Block Ctrl W

Lawrence Lin

Hotkeys
Hotkeys

owq

Disable keyboard shortcuts
Disable keyboard shortcuts

Benjamin Barenblat

Shortkeys (Custom Keyboard Shortcuts)
Shortkeys (Custom Keyboard Shortcuts)

Mike Crittenden

QuicKey – The quick tab switcher
QuicKey – The quick tab switcher

https://fwextensions.github.io/QuicKey

Block keys to kiosk mode
Block keys to kiosk mode

josecayo4

wasavi
wasavi

https://appsweets.net

Vimsert
Vimsert

gabriel

Surfingkeys
Surfingkeys

https://brookhong.github.io

AutoControl: Keyboard shortcuts, Mouse gestures
AutoControl: Keyboard shortcuts, Mouse gestures

https://autocontrol.app