Skip to content

Instantly share code, notes, and snippets.

@nibrahim
Created April 13, 2010 06:49
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 nibrahim/364372 to your computer and use it in GitHub Desktop.
Save nibrahim/364372 to your computer and use it in GitHub Desktop.
Emacs/Zsh snippet to open files an jump to a specific line
(require 'server)
(server-start)
(defun nkv-find-file-and-jump (spec)
(interactive "s")
(let ((f (car (split-string spec ":")))
(l (cadr (split-string spec ":"))))
(find-file f)
(if l (goto-line (string-to-int l)))))
# In your .zshrc
e() {
snippet="(nkv-find-file-and-jump \"$1\")"
emacsclient --no-wait -e $snippet
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment