diff options
author | Tom Willemse | 2015-07-08 12:38:23 +0200 |
---|---|---|
committer | Tom Willemse | 2015-07-08 12:38:23 +0200 |
commit | f54d8a59305b6c628456c8ba8eb2459213c517d5 (patch) | |
tree | 8575ceef85204c53331d3c4db1b3fd6e9e55b37c /emacs/.emacs.d/init.el | |
parent | e390a5dae43ed9472da8a66ce3d780fafdf57434 (diff) | |
download | dotfiles-f54d8a59305b6c628456c8ba8eb2459213c517d5.tar.gz dotfiles-f54d8a59305b6c628456c8ba8eb2459213c517d5.zip |
Move my eshell prompt to separate module
To help with autoloading, also update the Makefile to create a
`site-lisp/site-autoloads.el' file which is loaded by emacs.
Diffstat (limited to 'emacs/.emacs.d/init.el')
-rw-r--r-- | emacs/.emacs.d/init.el | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index b61bbf4..3a22c60 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -251,12 +251,6 @@ But only if it is a maildir inbox." 'action (lambda (button) (browse-url (button-label button))))))) -(defun oni:eshell-prompt () - "Show a pretty shell prompt." - (concat (if (not (looking-back "\n" nil)) "\n") - (oni:shorten-dir (abbreviate-file-name (eshell/pwd))) - " > ")) - (defun oni:go-mode-func () "Function for `go-mode-hook'." (setq indent-tabs-mode nil)) @@ -710,12 +704,6 @@ For `python-mode' I prefer `python-imenu-create-flat-index'." (insert "`" command "':\n")) (shell-command command output-buffer)) -(defun oni:shorten-dir (dir) - "Shorten a directory, (almost) like fish does it." - (while (string-match "\\(\\.?[^./]\\)[^/]+/" dir) - (setq dir (replace-match "\\1/" nil nil dir))) - dir) - (defun oni:show-buffer-position () "Show the position in the current buffer." (interactive) @@ -1011,9 +999,7 @@ from myaethon2.core.decorators import ( (setq eltuki-blog-dir "~/documents/blog")) (stante-after em-prompt - (setq eshell-highlight-prompt nil) - (setq eshell-prompt-function 'oni:eshell-prompt) - (setq eshell-prompt-regexp "^[~/].* > ")) + (setq eshell-highlight-prompt nil)) (stante-after em-term (add-to-list 'eshell-visual-commands "unison")) @@ -1287,6 +1273,7 @@ from myaethon2.core.decorators import ( ;;;; Hooks +(add-hook 'eshell-first-time-mode-hook 'oni-eshell-set-prompt) (add-hook 'after-save-hook 'oni:after-save-func t) (add-hook 'before-save-hook 'oni:before-save-func) (add-hook 'css-mode-hook #'rainbow-mode) @@ -1504,6 +1491,7 @@ from myaethon2.core.decorators import ( (windmove-default-keybindings) (load (system-name) :noerror) +(load "site-autoloads") ;;; Test |