selected for brilliant emacs selections

Table of Contents

I just discovered1 selected.el2 and am impressed: it is a perfect example of a simple idea that is enormously powerful. This is the kind of idea that leaves you wondering, “why haven’t I thought of that before?” Part of the simplicity is that you define all your own keys for your own usage. Below is my invocation so far, for things I use often. I’m also trying out the move-text3 script, though it isn’t part of my workflow yet.

(use-package selected
  :commands selected-minor-mode
  :init
  (setq selected-org-mode-map (make-sparse-keymap))
  :bind (:map selected-keymap
              ("<down>" . move-text-down)
              ("<up>" . move-text-up)
              ("/" . undo-in-region)
              ("c" . capitalize-region)       
              ("d" . downcase-region)
              ("D" . delete-duplicate-lines)            
              ("m" . apply-macro-to-region-lines)
              ("n" . move-text-down)
              ("p" . move-text-up)
              ("q" . selected-off)
              ("s" . sort-lines)
              ("u" . upcase-region)
              ("w" . count-words-region)

              :map selected-org-mode-map
              ("t" . org-table-convert-region)
              ("-" . org-ctrl-c-minus))
  :config (selected-global-mode))

Footnotes

1 Discovered from the excellent weekly “tips and tricks” thread. I have to store the good ones, though, because it’s hard to find them again in future weeks. https://www.reddit.com/r/emacs/comments/mg98ki/weekly_tipstricketc_thread/gstteeo?utm_source=share&utm_medium=web2x&context=3

2 Selected repo on github is here: https://github.com/Kungsgeten/selected.el

3 In straight, move-text is a one-liner: (use-package move-text). It provides several (hopefully) useful commands I’m still getting used to.

Tory Anderson avatar
Tory Anderson
Full-time Web App Engineer, Digital Humanist, Researcher, Computer Psychologist