about summary refs log tree commit diff
path: root/tools/emacs/config/bindings.el
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-15T17·09+0000
committerVincent Ambo <tazjin@google.com>2019-12-15T17·13+0000
commit00c9060c2f0ec581db8841aa34fd92c0e9953693 (patch)
tree17bb2998297f9f6c359abe16a610fc30fc2bd1bd /tools/emacs/config/bindings.el
parent895deabb3aee036dbe3a96fa5caea46bfeef2012 (diff)
feat(emacs.d): Introduce custom mc/mark-dwim cursor marker r/155
Adds a "do what I mean" multiple-cursor selection with the logic that
I find most useful:

* If there is no active region, mark the next line (or lines, based on
  prefix argument)
* If there is an active region that spans multiple lines, call
  `mc/edit-lines`
* If there is an active region on a single line, trigger a custom
  selection hydra with functionality equivalent to
  `mc/mark-more-like-this-extended` but a slightly improved user
  experience

Hopefully this will make it easier to get into the habit of actually
using multiple-cursors without calling the mc commands via M-x
Diffstat (limited to 'tools/emacs/config/bindings.el')
-rw-r--r--tools/emacs/config/bindings.el1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/emacs/config/bindings.el b/tools/emacs/config/bindings.el
index 626bdcea8eb2..502750aa9df6 100644
--- a/tools/emacs/config/bindings.el
+++ b/tools/emacs/config/bindings.el
@@ -24,6 +24,7 @@
 ;; Miscellaneous editing commands
 (global-set-key (kbd "C-c w") 'whitespace-cleanup)
 (global-set-key (kbd "C-c a") 'align-regexp)
+(global-set-key (kbd "C-c m") 'mc/mark-dwim)
 
 ;; Browse URLs (very useful for Gitlab's SSH output!)
 (global-set-key (kbd "C-c b p") 'browse-url-at-point)