Add key binding to visit init file and index.org

Inspired by http://emacsredux.com/blog/2013/05/18/instant-access-to-init-dot-el/
This commit is contained in:
Gergely Polonkai 2016-11-15 00:47:14 +01:00
parent e0e2fd262e
commit ef42a03d3a
2 changed files with 14 additions and 1 deletions

View File

@ -956,7 +956,9 @@
("m" . hidden-mode-line-mode) ("m" . hidden-mode-line-mode)
("C-i e" . "gergely@polonkai.eu") ("C-i e" . "gergely@polonkai.eu")
("C-i w" . "http://gergely.polonkai.eu/") ("C-i w" . "http://gergely.polonkai.eu/")
("C-p" . package-list-packages)) ("C-p" . package-list-packages)
("o i" . gpolonkai/visit-init-file)
("o o" . gpolonkai/visit-org-index))
;; Kudos goes to ;; Kudos goes to
;; http://endlessparentheses.com/leave-the-cursor-at-start-of-match-after-isearch.html ;; http://endlessparentheses.com/leave-the-cursor-at-start-of-match-after-isearch.html

View File

@ -11,3 +11,14 @@ buffer is not visiting a file, prompt for a file name."
(if buffer-file-name (if buffer-file-name
(find-alternate-file tramp-path) (find-alternate-file tramp-path)
(find-file tramp-path)))) (find-file tramp-path))))
(defun gpolonkai/visit-init-file ()
"Open the init file."
(interactive)
(find-file-other-window user-init-file))
(defun gpolonkai/visit-org-index ()
"Visit the root of Org-mode notes."
(interactive)
(find-file-other-window (concat (file-name-as-directory org-directory)
"index.org")))