Created
April 13, 2010 06:49
-
-
Save nibrahim/364372 to your computer and use it in GitHub Desktop.
Emacs/Zsh snippet to open files an jump to a specific line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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