Skip to content

Instantly share code, notes, and snippets.

@jonEbird
Created April 2, 2015 15:46
Show Gist options
  • Save jonEbird/c8be8560c5bd4490f4de to your computer and use it in GitHub Desktop.
Save jonEbird/c8be8560c5bd4490f4de to your computer and use it in GitHub Desktop.
Quickly split window and pull up your favorite projects file/buffer via keychord "PP"
;; Quickly split window and get to my projects File
(require 'key-chord)
(defvar my-projects-file "~/org/projects.org"
"My favorite projects file")
(defun switch-to-projects-other-window ()
"Quickly open my favorite projects buffer in other window"
(interactive)
(let* ((project-filename (expand-file-name my-projects-file))
(project-buffer (file-name-nondirectory project-filename)))
(if (get-buffer project-buffer)
(switch-to-buffer-other-window project-buffer)
(find-file-other-window project-filename))))
(key-chord-define-global "PP" 'switch-to-projects-other-window)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment