summaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/init.el b/init.el
index 269f053..8c222c5 100644
--- a/init.el
+++ b/init.el
@@ -285,3 +285,15 @@
(load "email.el")
(require 'rekado-mode)
(rekado-mode 1)
+
+;; author: KaiGrossjohann on EmacsWiki
+(defun eshell/ff (&rest args)
+ "Invoke `find-file' on the file.
+ \"ff +42 foo\" also goes to line 42 in the buffer."
+ (while args
+ (if (string-match "\\`\\+\\([0-9]+\\)\\'" (car args))
+ (let* ((line (string-to-number (match-string 1 (pop args))))
+ (file (pop args)))
+ (find-file file)
+ (goto-line line))
+ (find-file (pop args)))))