Emacs: disable shift selection in CUA mode

I managed to disable the built-in shift selection with (set-variable 'shift-select-mode nil). And I like the C-Ret-column-selection CUA-mode. But CUA automatically enables shift-selection (but apparently not through a variable shift-select-mode).

  • So, is it possible to disable shift selection in CUA mode?
  • Or: is there any way to use the CUA mode column select function exclusively, i.e. without any other CUA stuff?
+3
source share
3 answers

This is not a solution, but FYI ...

I noticed this variable listed in the help for cua-mode

cua-highlight-region-shift-only is a variable defined in `cua-base.el'.

*If non-nil, only highlight region if marked with S-<move>.
When this is non-nil, CUA toggles `transient-mark-mode' on when the region
is marked using shifted movement keys, and off when the mark is cleared.
But when the mark was set using M-x cua-set-mark, Transient Mark mode
is not turned on.

cua-mode does the following:

(setq shift-select-mode nil)
(setq transient-mark-mode (and cua-mode
               (if cua-highlight-region-shift-only
                   (not cua--explicit-region-start)
                 t))))
0
source

, cua-mode, cua-mode (,.emacs):

(setq cua-enable-cua-keys nil)
(setq cua-highlight-region-shift-only t) ;; no transient mark mode
(setq cua-toggle-set-mark nil) ;; original set-mark behavior, i.e. no transient-mark-mode

...
(cua-mode)

https://superuser.com/a/77453/223457

0

To enable editing a rectangle (column) from Cua, you can use the following (from emacs-fu )

(setq cua-enable-cua-keys nil) ;; for rectangles only (cua-mode t)

0
source

Source: https://habr.com/ru/post/1780495/


All Articles