我设法通过(set-variable 'shift-select-mode nil)
. 我喜欢C-Ret
CUA模式的-column-selection。但是 CUA 会自动启用移位选择(但似乎不是通过变量shift-select-mode
)。
- 那么,是否有可能在 CUA 模式下禁用换档选择?
- 或者:有没有办法专门使用 CUA 模式的列选择功能,即没有任何其他 CUA 事物?
具体来说,要禁用 的移位选择,请在打开之前将cua-mode
以下内容添加到您的 init 文件(例如 .emacscua-mode
)中:
(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)
要仅从 Cua 启用矩形(列)编辑,您可以使用以下内容(来自emacs-fu)
(setq cua-enable-cua-keys nil) ;; 仅适用于矩形(cua-mode t)
这不是一个解决方案,但仅供参考......
我注意到帮助中提到的这个变量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
做这个:
(setq shift-select-mode nil)
(setq transient-mark-mode (and cua-mode
(if cua-highlight-region-shift-only
(not cua--explicit-region-start)
t))))