Closed ccqpein closed 5 years ago
You need racer.el to be loaded so that racer-mode-map
exists. You could do that like this:
(require 'racer)
;; Prefer #' for functions, so the byte compiler can spot issues in more circumstances.
(define-key racer-mode-map (kbd "M-.") #'helm-gtags-dwim)
But if you're using use-package
(which is a great package!) the equivalent is:
(use-package racer
:config
(define-key racer-mode-map (kbd "M-.") #'helm-gtags-dwim))
Thanks, it works, looks like I need a separate use-package
block instead load it in rust-mode
block.
I am using
use-package
to loadrust-mode
andracer-mode
, everything looks perfect except myhelm-gtags-mode
already hasM-.
key binding. I'd like replaceracer-mode
'sM-.
tohelm-gtags
one.However, when I try
(define-key racer-mode-map (kbd "M-.") 'helm-gtags-dwim)
, emacs shows meracer-mode-map
is a free variable.Is it a recommend way to make key-replacement happen?
Thanks