我正在尝试取消绑定 org-cycle-agenda-files
,默认情况下设置为 C-'
和C-,
。
我选择这样做的武器是use-package package。
在github.com/use-package/bind-key.el 页面上,我发现了以下几行:
;; To unbind a key within a keymap (for example, to stop your favorite major
;; mode from changing a binding that you don't want to override everywhere),
;; use `unbind-key':
;;
;; (unbind-key "c-c x" some-other-mode-map)
这导致我尝试以下变体失败:
(unbind-key "C-'" )
(unbind-key "C-," )
(unbind-key "C-'" (org-cycle-agenda-files))
(unbind-key "C-," (org-cycle-agenda-files))
(bind-keys :map org-mode-map
:unbind "C-'")
(unbind-key "C-'" org-cycle-agenda-files)
失败之后,我尝试了一些“传统”解决方案。
在gnu.org手册中找到的信息以及一些emacs.stackexchange答案导致我产生了以下无用的破坏:
(define-key (org-cycle-agenda-files) key nil)
(define-key (current-global-map) "C-'" nil)
(local-unset-key "C-'")
(global-unset-key "C-'")
(with-eval-after-load org-mode
(unbind-key "C-'" org-mode-map)
(unbind-key "C-," org-mode-map))
(global-set-key (kbd "C-'") 'nil)
是的....这些变化都没有。:D
我很想找到基于使用包的解决方案,因为我已经在使用其中一些很棒的功能。
任何建议都是值得欢迎的。
:config
,而不是放进去:init
,因为键图中:init
可能尚未加载。