Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local-set-key doesn't work anymore? #12

Open
guoweis-work opened this issue Nov 12, 2020 · 1 comment
Open

local-set-key doesn't work anymore? #12

guoweis-work opened this issue Nov 12, 2020 · 1 comment

Comments

@guoweis-work
Copy link

I use golang so i have some keybinding that i'm really used to. At the same time, I really like what you have here, this gives me a chance to understand how init.el works. But after applying what you have, I realized some of the most important keybinding in golang doesn't work for me anymore.

Even though I put this block back in the init.el, when I type "M-.", I still get "previous command was not evil-repeat: evil-forward-char"

How come the local-set-key doesn't take effect?

(defun my-go-mode-hook ()
; Call Gofmt before saving
(add-hook 'before-save-hook 'gofmt-before-save)
; Godef jump key binding
(local-set-key (kbd "M-.") 'godef-jump)
(local-set-key (kbd "M-*") 'pop-tag-mark)
)
(add-hook 'go-mode-hook 'my-go-mode-hook)

@daviwil
Copy link
Owner

daviwil commented Nov 12, 2020

Hi @guoweis-outreach! Since you're using evil-mode, you'll have to use (evil-local-set-key '(normal insert) (kbd "M-.") 'godef-jump) to bind the key in the local keymaps for the Evil states you want it in ('normal and 'insert in this case). Let me know if that works for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants