在spacemacs中覆盖默认键绑定的最佳方法是什么?

时间:2015-10-21 00:01:44

标签: spacemacs

我正在使用spacemacs:https://github.com/syl20bnr/spacemacs

我已经尝试将两个用户挂钩位置覆盖cmd-k而不是kill-buffer而不是delete-window。但是,当我重新启动时,都不起作用。

(defun dotspacemacs/user-init ()
  "Initialization function for user code.
It is called immediately after `dotspacemacs/init'.  You are free to put any
user code."
  (defun dotspacemacs/user-init ()
    (global-set-key (kbd "s-k") 'kill-buffer)
    )
  )

(defun dotspacemacs/user-config ()
  "Configuration function for user code.
 This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
    (global-set-key (kbd "s-k") 'kill-buffer)
)

调试此问题的最佳方法是什么?

1 个答案:

答案 0 :(得分:0)

我刚注意到您在defun dotspacemacs/user-init内定义了defun dotspacemacs/user-init

而不是那样,我在(global-set-key (kbd "s-k") 'kill-buffer)dotspacemacs/user-init中测试dotspacemacs/user-config并在两个地方都进行测试。

可能是错误,它与您的配置文件有关。

您是否启用了osx层?