I'm using the python-layer and am trying to set M-r to run replace-string
while editing Python files. I've tried all of the options below from inside the function dotspacemacs/user-config
. Help?
;; NONE OF THESE WORK!
(define-key evil-insert-state-map (kbd "M-r") 'replace-string)
(define-key evil-insert-state-map "\M-r" 'replace-string)
(spacemacs/set-leader-keys "M-r" 'replace-string)
(spacemacs/set-leader-keys-for-major-mode 'python-mode "M-r" 'replace-string)
(spacemacs/set-leader-keys-for-major-mode 'anaconda-mode "M-r" 'replace-string)
(defun my-python-mode-config ()
"For use in `mode-hooks'."
(local-set-key (kbd "M-r") `replace-string)
)
(add-hook 'python-mode-hook 'my-python-mode-config)
(add-hook 'anaconda-mode-hook 'my-python-mode-config)
(global-set-key "\M-r" 'replace-string)