Ver código fonte

Added eshell setup

George Jones 6 anos atrás
pai
commit
242f1dc18b
3 arquivos alterados com 30 adições e 0 exclusões
  1. 27 0
      eshell-setup.el
  2. 2 0
      testing/eshellrc.eshell
  3. 1 0
      testing/ls.eshell

+ 27 - 0
eshell-setup.el

@@ -0,0 +1,27 @@
+; http://www.howardism.org/Technical/Emacs/eshell-fun.html
+
+(defun eshell-here ()
+  "Opens up a new shell in the directory associated with the
+current buffer's file. The eshell is renamed to match that
+directory to make multiple eshell windows easier."
+  (interactive)
+  (let* ((parent (if (buffer-file-name)
+                     (file-name-directory (buffer-file-name))
+                   default-directory))
+         (height (/ (window-total-height) 3))
+         (name   (car (last (split-string parent "/" t)))))
+    (split-window-vertically (- height))
+    (other-window 1)
+    (eshell "new")
+    (rename-buffer (concat "*eshell: " name "*"))
+
+    (insert (concat "ls"))
+    (eshell-send-input)))
+
+(global-set-key (kbd "C-!") 'eshell-here)
+
+(defun eshell/x ()
+  (insert "exit")
+  (eshell-send-input)
+  (delete-window))
+

+ 2 - 0
testing/eshellrc.eshell

@@ -0,0 +1,2 @@
+alias ph eshell-display-predicate-help
+alias mh eshell-display-modifier-help

+ 1 - 0
testing/ls.eshell

@@ -0,0 +1 @@
+for i in *.org *el {echo $i}