Emacs:在 CUA 模式下禁用班次选择

发布于 2024-10-07 23:16:28 字数 274 浏览 3 评论 0原文

我设法通过 (set-variable 'shift-select-mode nil) 禁用内置的shift-selection。我喜欢 CUA 模式的 C-Ret 列选择。但 CUA 会自动启用换档选择(但似乎不是通过变量 shift-select-mode)。

  • 那么,是否可以在 CUA 模式下禁用换档选择?
  • 或者:有没有办法专门使用 CUA 模式的列选择功能,即没有任何其他 CUA 功能?

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

  • So, is there a possibility to disable shift-selection within CUA-mode?
  • Or: Is there a way to use the column-selection-feature of CUA-mode exclusively, i.e. without any other CUA-things?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

黯然 2024-10-14 23:16:28

这不是一个解决方案,但仅供参考...

我注意到 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.

是这样做的:

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

This isn't a solution, but FYI...

I noticed this variable mentioned 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 this:

(setq shift-select-mode nil)
(setq transient-mark-mode (and cua-mode
               (if cua-highlight-region-shift-only
                   (not cua--explicit-region-start)
                 t))))
蓝眼泪 2024-10-14 23:16:28

具体来说,要禁用 cua-mode 的移位选择,请在打开 cua-mode< 之前将以下内容添加到您的初始化文件(例如 .emacs)中/code>:

(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

Specifically, to disable the shift-selection for cua-mode, add the following to your init file (e.g. .emacs) prior to turning on cua-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)

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

节枝 2024-10-14 23:16:28

要仅从 Cua 启用矩形(列)编辑,您可以使用以下命令(来自 emacs-fu)

(setq cua-enable-cua-keys nil) ;;仅适用于矩形
(cua-模式 t)

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文