Skip to content

Instantly share code, notes, and snippets.

@etscrivner
Created August 13, 2012 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etscrivner/3337235 to your computer and use it in GitHub Desktop.
Save etscrivner/3337235 to your computer and use it in GitHub Desktop.
Jump to a file in a new buffer
(defun jump-to-file (file)
"""Opens the given file in the current window if it exists."""
(when (file-exists-p file)
(find-file file)))
(defun jump-to-file-other-window (file)
"""Opens the given file in the window next to the current window"""
(when (file-exists-p file)
(find-file-other-window file)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment