Expand region is one of those packages that deserves to be built-in. It's so
simple and useful it makes Emacs worthwhile all by itself. Fundamentally, the
entire package boils down to a single command, expand-region, which
incrementally increases the selected region by semantic units. So deciding where
to bind this command is an important decision.
The Readme suggests C-= and I've seen recurring recommendations for S-SPC,
which I used for a while, but neither felt quite right for me. After marking a
small region, the most common operation for me is to copy it, but it's very
awkward for my fingers to hit S-SPCM-w. With that in mind, in one of my
brightest epiphanies, I defined the following keybind.
Not only does M-2 use the same modifier as M-w, but it's right above the
latter. I couldn't hope for a better key. Besides, after years of switching tabs
in Firefox, my fingers are sniper rifles when it comes to hitting M-2, making
this combo extra speedy. The downside is that you forgo using Meta for prefix
arguments, but I'm fine with that.
When I select large regions, I'm probably killing instead of copying. While
M-2C-w is not terribly natural, it's also not awkward, so the key is good
enough here. Finally, M-2 also fits well with my multiple-cursors keybinds,
but that's a topic for another post.
Where do YOU bind expand-region?
22 Dec 2014, by Artur Malabarba.Meta Binds post series
Expand region is one of those packages that deserves to be built-in. It's so simple and useful it makes Emacs worthwhile all by itself. Fundamentally, the entire package boils down to a single command,
expand-region
, which incrementally increases the selected region by semantic units. So deciding where to bind this command is an important decision.The Readme suggests C-= and I've seen recurring recommendations for S-SPC, which I used for a while, but neither felt quite right for me. After marking a small region, the most common operation for me is to copy it, but it's very awkward for my fingers to hit S-SPC M-w. With that in mind, in one of my brightest epiphanies, I defined the following keybind.
Not only does M-2 use the same modifier as M-w, but it's right above the latter. I couldn't hope for a better key. Besides, after years of switching tabs in Firefox, my fingers are sniper rifles when it comes to hitting M-2, making this combo extra speedy. The downside is that you forgo using Meta for prefix arguments, but I'm fine with that.
When I select large regions, I'm probably killing instead of copying. While M-2 C-w is not terribly natural, it's also not awkward, so the key is good enough here. Finally, M-2 also fits well with my
multiple-cursors
keybinds, but that's a topic for another post.Tags: meta, keybind, init.el, emacs,
Asynchronous package upgrades with Paradox »
« New on Elpa and in Emacs 25.1: let-alist
Related Posts
A few paredit keys that take over the world in keybind
Fill and unfill paragraphs with a single key in keybind
Disable Mouse only inside Emacs in keybind
Content © 2019, All rights reserved. Icons under CC3.0.