gpt4 book ai didi

emacs - Spacemacs 键绑定(bind)未注册

转载 作者:行者123 更新时间:2023-12-04 12:49:27 31 4
gpt4 key购买 nike

我的 .spacemacs 文件包含一个如下所示的部分:

(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."

;; Keybindings
(global-unset-key [(control z)]) ;; unbind sleep button
(global-unset-key [(control x)(control z)]) ;; unbind sleep button
(global-unset-key [(control e)])
(global-unset-key [(control k)]) ;; unbind kill line
(global-set-key [(control z)] 'undo) ;; set Windows-style undo
(global-set-key [(control e)] 'View-scroll-half-page-backward) ;; remap page up

;; Setting and showing the 80-character column width
(set-fill-column 80)
(auto-fill-mode t)
(toggle-fill-column-indicator)

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(paradox-github-token t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

)

我遵循了这篇文章中的语法:https://github.com/andrewfwang/dotfiles/blob/ee84ddd304d1dad7ece206062debd3e3c86e927f/.emacs.d/init.el

然而,每次我重新启动 spacemacs 时,我的更改都没有注册。但是,如果我在同一个文件中启用或禁用包,这些更改就会注册。这些键绑定(bind)调整不应该在 user-config 下吗?

最佳答案

设置 CTRL+Z 有点棘手,因为 spacemacs 代码包含一个函数,可以在切换到 emacs 模式并再次返回时重新绑定(bind)它。它通过引用默认为 CTRL+Z 的 evil-toggle-key 来实现。如果您将 evil-toggle-key 更改为其他内容,则可以使用 CTRL+Z 进行撤消。

建议:在.spacemacs文件中

在自定义设置变量部分添加这一行

'( evil-toggle-key "C-`")

和 dotspacemacs/user-config 部分中的这一行

(global-set-key (kbd "C-z") 'undo) 

上述配置我在 Windows 和 Linux 下的 spacemacs 版本 0.200.7,emacs 版本 25.1.1 上工作

关于emacs - Spacemacs 键绑定(bind)未注册,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40983562/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com