【问题标题】:Emacs: Disable shift-selection in CUA-modeEmacs:在 CUA 模式下禁用移位选择
【发布时间】:2010-12-15 17:40:45
【问题描述】:

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

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

【问题讨论】:

    标签: emacs cua-mode


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      具体来说,要禁用 cua-mode 的移位选择,请在打开 cua-mode 之前将以下内容添加到您的 init 文件(例如 .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

      【讨论】:

        【解决方案3】:

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

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

        【讨论】:

          猜你喜欢
          • 2012-06-25
          • 2015-01-04
          • 1970-01-01
          • 2017-06-08
          • 2012-03-28
          • 2020-08-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多