summaryrefslogtreecommitdiffstats
path: root/lisp/bandali-eshell.el
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2020-09-27 12:06:44 -0400
committerAmin Bandali <bandali@gnu.org>2020-09-27 12:07:10 -0400
commitc84be134273e6baa0633d194c9524658e221ee7f (patch)
treef4875124e79efae46b2f275a8c7e4d6629abe6b8 /lisp/bandali-eshell.el
parentc49fa11a90f9b17159062e3ab2f4a960f1048ffd (diff)
downloadconfigs-c84be134273e6baa0633d194c9524658e221ee7f.tar.gz
configs-c84be134273e6baa0633d194c9524658e221ee7f.tar.xz
configs-c84be134273e6baa0633d194c9524658e221ee7f.zip
Drop use-package
along with some unused stuff
Diffstat (limited to '')
-rw-r--r--lisp/bandali-eshell.el65
1 files changed, 32 insertions, 33 deletions
diff --git a/lisp/bandali-eshell.el b/lisp/bandali-eshell.el
index 099cbb3..5a83c6d 100644
--- a/lisp/bandali-eshell.el
+++ b/lisp/bandali-eshell.el
@@ -24,10 +24,23 @@
;;; Code:
-(use-package eshell
- :commands eshell
- :bind ("C-c a s e" . eshell)
- :config
+(with-eval-after-load 'eshell
+ (csetq
+ eshell-hist-ignoredups t
+ eshell-input-filter #'eshell-input-filter-initial-space
+ eshell-prompt-regexp "\\(.*\n\\)*[$#] "
+ eshell-prompt-function
+ (lambda ()
+ (concat
+ (propertize (format "%s@%s:" (user-login-name) (system-name))
+ 'face 'default)
+ (propertize (abbreviate-file-name default-directory)
+ 'face 'font-lock-comment-face)
+ (propertize "\n" 'face 'default)
+ (if (= (user-uid) 0)
+ (propertize "#" 'face 'red)
+ (propertize "$" 'face 'default))
+ (propertize " " 'face 'default))))
(eval-when-compile
(defvar eshell-prompt-regexp)
(declare-function eshell-life-is-too-much "esh-mode")
@@ -38,13 +51,11 @@
(if (and (eolp) (looking-back eshell-prompt-regexp nil))
(eshell-life-is-too-much)
(delete-char arg)))
-
(defun b/eshell-clear ()
(interactive)
(let ((inhibit-read-only t))
(erase-buffer))
(eshell-send-input))
-
(defun b/eshell-setup ()
(make-local-variable 'company-idle-delay)
(defvar company-idle-delay)
@@ -52,33 +63,21 @@
(defvar eshell-mode-map)
(defvar eshell-hist-mode-map))
(setq company-idle-delay nil)
- (bind-keys :map eshell-mode-map
- ("C-d" . b/eshell-quit-or-delete-char)
- ("C-S-l" . b/eshell-clear)
- ("M-r" . counsel-esh-history)
- ;; ([tab] . company-complete)
- :map eshell-hist-mode-map
- ("M-r" . counsel-esh-history)))
-
- (setq
- eshell-prompt-regexp "\\(.*\n\\)*[$#] "
- eshell-prompt-function
- (lambda ()
- (concat
- (propertize (format "%s@%s:" (user-login-name) (system-name))
- 'face 'default)
- (propertize (abbreviate-file-name default-directory)
- 'face 'font-lock-comment-face)
- (propertize "\n" 'face 'default)
- (if (= (user-uid) 0)
- (propertize "#" 'face 'red)
- (propertize "$" 'face 'default))
- (propertize " " 'face 'default))))
-
- :hook (eshell-mode . b/eshell-setup)
- :custom
- (eshell-hist-ignoredups t)
- (eshell-input-filter 'eshell-input-filter-initial-space))
+ ;; local key bindings
+ (define-key eshell-mode-map (kbd "C-d")
+ #'b/eshell-quit-or-delete-char)
+ (define-key eshell-mode-map (kbd "C-S-l")
+ #'b/eshell-clear)
+ (define-key eshell-mode-map (kbd "M-r")
+ #'counsel-esh-history)
+ ;; (define-key eshell-mode-map [tab]
+ ;; #'company-complete)
+ (define-key eshell-hist-mode-map (kbd "M-r")
+ #'counsel-esh-history)))
+;; global key bindings
+(global-set-key (kbd "C-c a s e") #'eshell)
+;; hooks
+(add-hook 'eshell-mode-hook #'b/eshell-setup)
(provide 'bandali-eshell)
;;; bandali-eshell.el ends here