4

I'm going to set key binding to open and edit my init.el. Hotkey will call this function.

(defun my-edit-configuration () "Open the init file." (interactive) (find-file user-init-file))

I wouldn't want to rewrite another standard key binding. What kind of a key binding usually utilized in Emacs for this purpose?

3 Answers 3

5

I don't think there is a standard key binding to open the init file. There isn't really a standard keybinding for any function that isn't part of Emacs to begin with.

In general, the keybindings C-c [a-z] are reserved for users. That's control-c followed by an unmodified letter. C-c C-[a-z] may be used by major modes.

5

Tyler's answer is right but there is a more specific way of remembering and accessing places in emacs and I recommend to use it instead of wasting your scarce reserved keybindings: bookmarks.

Use:

  • C-x r m to bookmark a file.
  • C-x r b to access a bookmark.
  • C-x r l to list and edit bookmarks.

Now you know how to bookmark your init.el. Using C-x r b with, for example, ido-mode is a really fast way of accessing files and places.

-1

Before bind any key just check if it already bound: do C-h k <and press hot key combination>. It will describe hotkey if it signed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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