#+title Linas’ Emacs Configuration
(use-package term
:commands term
:custom
(term-buffer-maximum-size 3000)
:config
(setq explicit-shell-file-name "bash")
(setq explicit-zsh-args '()))
(use-package eterm-256color
:hook (term-mode . eterm-256color-mode))
(defun linas/configure-eshell ()
;; Save command history when commands are entered
(add-hook 'eshell-pre-command-hook 'eshell-save-some-history)
;; Truncate buffer for performance
(add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer)
;; Bind some useful keys for evil-mode
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "C-r") 'counsel-esh-history)
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "<home>") 'eshell-bol)
(evil-normalize-keymaps)
(setq eshell-history-size 2000 ;;Default 10000
eshell-buffer-maximum-lines 2000 ;;Default 10000
eshell-hist-ignoredups t
eshell-scroll-to-bottom-on-input t))
(use-package eshell
:hook (eshell-first-time-mode . linas/configure-eshell)
:config
(with-eval-after-load 'esh-opt
(setq eshell-destroy-buffer-when-process-dies t)
(setq eshell-visual-commands '("htop" "zsh" "vim" "nvim" "nano")))
(eshell-git-prompt-use-theme 'powerline))
(use-package eshell-info-banner
:after eshell
:straight (:build t)
:hook (eshell-banner-load . eshell-info-banner-update-banner))
;; Powerline makes it look cooler
(use-package eshell-git-prompt
:after eshell)
(use-package vterm
:commands vterm
:config
(setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *")
(setq vterm-shell "bash")
(setq vterm-max-scrollback 1000)) ;; Default 10000, set to 1000 in case of lag
(setq comint-output-filter-functions
(remove 'ansi-color-process-output comint-output-filter-functions))
(add-hook 'shell-mode-hook
(lambda ()
;; Disable font-locking in this buffer to improve performance
(font-lock-mode -1)
;; Prevent font-locking from being re-enabled in this buffer
(make-local-variable 'font-lock-function)
(setq font-lock-function (lambda (_) nil))
(add-hook 'comint-preoutput-filter-functions 'xterm-color-filter nil t)))
Pop up a shell for quick shell access
https://github.com/kyagi/shell-pop-el
(use-package shell-pop
;; :bind ("C-c s" . shell-pop)
:custom
(shell-pop-default-directory nil) ; cd to the current directory
(shell-pop-shell-type (quote ("ansi-term" "*ansi-term*" (lambda nil (ansi-term shell-pop-term-shell)))))
(shell-pop-term-shell "zsh")
(shell-pop-universal-key "C-c s")
(shell-pop-window-size 25)
(shell-pop-full-span t)
(shell-pop-window-positioning "bottom")
(shell-pop-autocd-to-working-dir t)
(shell-pop-restore-window-configuration t)
(shell-pop-cleanup-buffer-at-process-exit t))