2015-10-21 32 views
3

我使用spacemacs:https://github.com/syl20bnr/spacemacs重寫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) 
) 

什麼是最好的調試方法?

+0

重新啓動Emacs後,綁定到「s-k」的命令是什麼?也許keybindings被其他層或次要模式覆蓋 – zilongshanren

+0

我懷疑這是mac os綁定。 – justingordon

回答

0

我剛剛注意到你在defun dotspacemacs/user-init裏面定義了defun dotspacemacs/user-init

而不是那個,我測試(global-set-key (kbd "s-k") 'kill-buffer)dotspacemacs/user-initdotspacemacs/user-config並工作在兩個地方。

也許這個錯誤與你的配置文件有關。

您是否啓用了osx圖層?

+1

我可能已經啓用了osx圖層。這是我的設置:https://github.com/justin808/justin808-dotfiles/tree/master/jg-spacemacs – justingordon

相關問題