Emacs Redux

Return to the Essence of Text Editing

Instant Access to init.el

| Comments

One of the files Emacs users often edit is init.el(especially if they are having all of their configuration inside of it). It might be sensible then to develop a faster way to access init.el:

1
2
3
4
(defun find-user-init-file ()
  "Edit the `user-init-file', in another window."
  (interactive)
  (find-file-other-window user-init-file))

user-init-file holds the path to your init.el. For mine its value is /Users/bozhidar/.emacs.d/init.el. find-file-other-window will open the file in a window adjacent to the one you’re currently in.

Short and sweet! You might want to bind it to some keycombo:

1
(global-set-key (kbd "C-c I") 'find-user-init-file)

P.S. Thanks to Sebastian Wiesner for bringing this tip to my attention!

Comments