summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2014-09-03 11:59:40 +0200
committerrekado <rekado@elephly.net>2014-09-03 11:59:40 +0200
commit91484e3d06a6d5ac252694f77dc653c8920848a8 (patch)
treeb1b304f8e3a600067af0e2d21c4efc9031c7dc1b
parentbce2cdd2c62140e9aea08ea411f95960205b96ed (diff)
replace ff alias with function
-rw-r--r--eshell/alias5
-rw-r--r--init.el12
2 files changed, 14 insertions, 3 deletions
diff --git a/eshell/alias b/eshell/alias
index 29d019b..c1f0c17 100644
--- a/eshell/alias
+++ b/eshell/alias
@@ -1,4 +1,3 @@
-alias b popd
-alias cd pushd . > /dev/null; cd $*
-alias ff find-file $1
alias ll ls -la $*
+alias cd pushd . > /dev/null; cd $*
+alias b popd
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)))))