I slightly simplified the keys for backward-paragraph
and forward-paragraph
:
(global-unset-key (kbd "M-{")) ;; originally backward-paragraph
(global-unset-key (kbd "M-}")) ;; originally forward-paragraph
(global-set-key (kbd "M-[") 'backward-paragraph)
(global-set-key (kbd "M-]") 'forward-paragraph)
These work, but I was hoping to get Shift Selection for free. In particular, the official manual says:
If you hold down the shift key while typing a cursor motion command, this sets the mark before moving point, so that the region extends from the original position of point to its new position. This feature is referred to as shift-selection. It is similar to the way text is selected in other editors.
...
Shift-selection only works if the shifted cursor motion key is not already bound to a separate command (see Customization). For example, if you bind S-C-f to another command, typing S-C-f runs that command instead of performing a shift-selected version of C-f (forward-char).
I have shift-select-mode
as its default value, which is t
.
However, if I now press M-{
, I just get M-{ is undefined
in the echo area, instead of shift-selected backward-paragraph
as I was hoping. This seems to contradict the passage from the manual above. Is this a bug or am I doing something wrong?
edit: I also tried the following, taken from a similar question:
(global-set-key (kbd "M-[")
(lambda ()
(interactive "^")
(backward-paragraph)))
And this had the exact same result as my initial method; e.g. M-[
effectively acts as backward-paragraph
, but M-{
just says undefined
(interactive "^")
only works for alphabet keybinding..