emacs smartscan 更改键绑定
emacs smartscan change key bindings
我在 emacs 24 中安装了 smartscan,但默认键绑定接管了 M-n 和 M-p 键,我在使用 emacs 时需要这些键 shell 转到命令历史记录中的上一个下一个项目。
;;使用 M-n、M-p 键向 emacs 添加 VIM 类似超级明星 * 的搜索类型
(全局智能扫描模式 t);;全局开启云安全扫描
如何使用 configure smartscan 来使用不同的键绑定并保持 M-n、M-p 绑定不变?
您正在寻找 smartscan-map
。
(with-eval-after-load "smartscan"
(define-key smartscan-map (kbd "C-c s M-n") 'smartscan-symbol-go-forward)
(define-key smartscan-map (kbd "C-c s M-p") 'smartscan-symbol-go-backward)
(define-key smartscan-map (kbd "C-c s M-'") 'smartscan-symbol-replace))
或者,您只能在 prog-mode
中启用 smartscan-mode
(这可能是它唯一有用的模式)。这就是我所做的。它似乎不会影响 eshell
或 shell
,但我只是做了一个快速测试,因为我通常不使用它们。
(add-hook 'prog-mode-hook 'smartscan-mode)
我在 emacs 24 中安装了 smartscan,但默认键绑定接管了 M-n 和 M-p 键,我在使用 emacs 时需要这些键 shell 转到命令历史记录中的上一个下一个项目。
;;使用 M-n、M-p 键向 emacs 添加 VIM 类似超级明星 * 的搜索类型 (全局智能扫描模式 t);;全局开启云安全扫描
如何使用 configure smartscan 来使用不同的键绑定并保持 M-n、M-p 绑定不变?
您正在寻找 smartscan-map
。
(with-eval-after-load "smartscan"
(define-key smartscan-map (kbd "C-c s M-n") 'smartscan-symbol-go-forward)
(define-key smartscan-map (kbd "C-c s M-p") 'smartscan-symbol-go-backward)
(define-key smartscan-map (kbd "C-c s M-'") 'smartscan-symbol-replace))
或者,您只能在 prog-mode
中启用 smartscan-mode
(这可能是它唯一有用的模式)。这就是我所做的。它似乎不会影响 eshell
或 shell
,但我只是做了一个快速测试,因为我通常不使用它们。
(add-hook 'prog-mode-hook 'smartscan-mode)