0

I would like to set a projectile find file function to the hotkey C-e, and a elpy-goto-definition function to the hotkey F12, but I'm not sure why spacemacs is not recognizing the config that I'm trying to set. Here's my config:

(defun dotspacemacs/user-config ()
  "Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."
  (global-set-key "f12" 'elpy-goto-definition)
  (global-set-key (kbd "C-e") 'projectile-find-file))

I've tried various combinations of these. I've read that global keys have low priority, maybe this is why, but I feel a leader key is not the correct option.

0

The reason that the global set key was not working for f12 was because I needed the line to look like

(global-set-key [f12] 'elpy-goto-definition)

and the other line, configuring projectile's find-file function was not working because I simply had to manually enable projectile on startup by running projectile-mode

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.