diff options
| author | jao <jao@gnu.org> | 2026-10-24 17:45:10 +0100 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-10-24 17:45:10 +0100 |
| commit | d4167b62750b002dc0e1af219460375160a0e9d0 (patch) | |
| tree | 2d8ed5c07ca0badea90766675e30623ccbd696be /init.el | |
| parent | 1331c107a9edb1c7c4b4b902b83689d958a1b5ca (diff) | |
| download | elibs-d4167b62750b002dc0e1af219460375160a0e9d0.tar.gz elibs-d4167b62750b002dc0e1af219460375160a0e9d0.tar.bz2 | |
shell/term
Diffstat (limited to 'init.el')
| -rw-r--r-- | init.el | 56 |
1 files changed, 8 insertions, 48 deletions
@@ -364,7 +364,7 @@ :demand t :init (setq jao-themes-default-family (jao-d-l "Menlo" "Hack") ;; "RobotoMono Nerd Font" - jao-themes-default-size (jao-d-l 10 9) + jao-themes-default-size (jao-d-l 10 10) jao-themes-default-variable-pitch-family (jao-d-l "Helvetica" "Iosevka Etoile") jao-themes-default-variable-pitch-size (jao-d-l 12 9))) @@ -422,7 +422,8 @@ jao-minibuffer-inactive-buffer-line-color (jao-d-l "#dfdfdf" "grey65"))) (setq jao-minibuffer-adaptive-alignment nil - jao-minibuffer-info-face-alt 'jao-themes-dimm) + ; jao-minibuffer-info-face-alt 'jao-themes-dimm + jao-minibuffer-info-face-alt 'default) :commands (jao-minibuffer-add-variable jao-minibuffer-refresh jao-minibuffer-mode @@ -1309,14 +1310,8 @@ ;;;; shell modes (setq sh-basic-offset 2) ;; translates ANSI colors into text-properties, for eshell -(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t) -(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) -(defvar jao-use-vterm nil) -(defvar jao-use-eat nil) - (add-to-list 'display-buffer-alist '("\\*Async Shell Command\\*" (display-buffer-no-window))) - ;;;; eat (use-package eat :ensure t @@ -1327,41 +1322,6 @@ ;; (eshell-mode . eat-eshell-visual-command-mode)) :diminish ((eat-eshell-mode . ""))) -;;;; term -(defvar-local jao-term--cmd nil) - -(defun jao-term--find (cmd) - (seq-find (lambda (b) - (with-current-buffer b - (and (derived-mode-p 'eat-mode 'term-mode 'vterm-mode) - (string= (or jao-term--cmd "") cmd)))) - (buffer-list))) - -(defun jao-exec-in-term (cmd &optional name) - (interactive "SCommand") - (require 'eat nil t) - (cond ((and jao-use-vterm (fboundp 'jao-exec-in-vterm)) - (jao-exec-in-vterm cmd name)) - (jao-use-eat (let ((eat-term-name "xterm-256color")) - (with-current-buffer (eat cmd t) - (setq-local jao-term--cmd cmd)))) - (t (ansi-term "bash" name) - (set-process-sentinel (get-buffer-process (current-buffer)) - (lambda (process event) - (when (string= event "finished\n") - (kill-buffer (process-buffer process))))) - (setq-local jao-term--cmd cmd) - (term-send-string nil (concat cmd " ; exit\n"))))) - -(defmacro jao-def-exec-in-term (name cmd &rest prelude) - `(defun ,(intern (format "jao-term-%s" name)) (&optional term) - (interactive "P") - ,@prelude - (let ((jao-use-vterm (if term (not jao-use-vterm) jao-use-vterm))) - (if-let* ((b (jao-term--find ,cmd))) - (pop-to-buffer b) - (jao-exec-in-term ,cmd ,(format "*%s*" name)))))) - ;;;; eshell ;;;;; basic custom (use-package eshell @@ -1382,6 +1342,8 @@ (autoload 'ansi-color-apply "ansi-color") ;; (add-hook 'eshell-preoutput-filter-functions 'ansi-color-filter-apply) (add-hook 'eshell-preoutput-filter-functions 'ansi-color-apply) +(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t) +(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) (use-package eshell-syntax-highlighting :after esh-mode @@ -2108,15 +2070,13 @@ ("k" (lambda () (concat "keyboard" (when (jao-x11-kb-toggled-p) "*"))) jao-x11-kb-toggle :if jao-x11-p)]])) -(global-set-key (kbd "s-w") #'jao-transient-utils) - -(global-set-key (kbd "<f4>") - (if (display-graphic-p) #'delete-frame #'jao-transient-utils)) - ;;; Global key bindings (defun jao-global-keybindings () (interactive) (global-set-key (kbd "<f2>") #'magit-status) + (global-set-key (kbd "<f4>") #'jao-transient-utils) + (global-set-key (kbd "<f5>") #'jao-weather) + (global-set-key (kbd "s-w") #'jao-transient-utils) (global-set-key (kbd "C-x p") #'jao-prev-window) (global-set-key (kbd "C-x o") 'other-window) (global-set-key "\C-cj" #'join-line) |
