From 9eef6a43320aaca4fb6640ef20b1206614312a94 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sat, 4 Feb 2023 14:33:12 -0500 Subject: update --- emacs/.config/emacs-kj/eshell.el | 23 +++++++++++++++++++++++ emacs/.config/emacs-kj/init.el | 37 +++++++++++++++++++------------------ 2 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 emacs/.config/emacs-kj/eshell.el (limited to 'emacs') diff --git a/emacs/.config/emacs-kj/eshell.el b/emacs/.config/emacs-kj/eshell.el new file mode 100644 index 0000000..b475915 --- /dev/null +++ b/emacs/.config/emacs-kj/eshell.el @@ -0,0 +1,23 @@ +;;; -*- lexical-binding: t; -*- +(use-package eshell + :config + (add-hook 'eshell-mode-hook + (lambda () + (setenv "PAGER" "cat")) + (setenv "EDITOR" "emacsclient")) + (setq eshell-prefer-lisp-functions t) + (setq tramp-remote-path '(tramp-own-remote-path)) + + (add-to-list 'eshell-load-hook #'kj/on-eshell-load)) + +(defun kj/on-eshell-load (&args rest) + (add-to-list 'eshell-complex-commands "ssh")) + +(defun eshell/ssh (&rest args) + (if (= 1 (length args)) + (throw 'eshell-replace-command + (eshell/cd + (format "/ssh:%s:" (car args)))) + (throw 'eshell-replace-command + (eshell-parse-command "*ssh" + (eshell-stringify-list (flatten-tree args)))))) diff --git a/emacs/.config/emacs-kj/init.el b/emacs/.config/emacs-kj/init.el index c84cb15..e26409a 100644 --- a/emacs/.config/emacs-kj/init.el +++ b/emacs/.config/emacs-kj/init.el @@ -84,6 +84,10 @@ :hook (after-init . global-emojify-mode)) (setq-default show-trailing-whitespace t) +(dolist (mode '(calendar-mode-hook eshell-mode-hook)) + (add-hook 'calendar-mode-hook + (lambda (&rest args) + (setq show-trailing-whitespace nil)))) (use-package rainbow-delimiters :defer t @@ -537,6 +541,7 @@ (add-to-list 'org-export-backends 'md) (load-file (locate-user-emacs-file "development.el")) +(load-file (locate-user-emacs-file "eshell.el")) (setq math-additional-units '((ZiB "1024 * EiB" "Zebibyte") @@ -665,24 +670,6 @@ alist))) -(use-package eshell - :init - (add-hook 'eshell-mode-hook - (lambda () - (setenv "PAGER" "cat")) - (setenv "EDITOR" "emacsclient")) - (setq eshell-prefer-lisp-functions t) - (setq tramp-remote-path '(tramp-own-remote-path)) - (defun eshell/ssh (&rest args) - (if (= 1 (length args)) - (throw 'eshell-replace-command - (eshell/cd - (format "/ssh:%s:" (car args)))) - (throw 'eshell-replace-command - (eshell-parse-command "*ssh" - (eshell-stringify-list (flatten-tree args)))))) - (add-to-list 'eshell-complex-commands "ssh")) - (use-package idle-highlight-mode :config (setq idle-highlight-idle-time 0.2) @@ -863,3 +850,17 @@ (display-buffer-in-best-side) (slot . 0) )) + +;; Calendar settings. +(setq calendar-week-start-day 1) +;; Show calendar week numbers. +(copy-face font-lock-constant-face 'calendar-iso-week-face) +(set-face-attribute 'calendar-iso-week-face nil + :height 0.7) +(setq calendar-intermonth-text + '(propertize + (format "%2d" + (car + (calendar-iso-from-absolute + (calendar-absolute-from-gregorian (list month day year))))) + 'font-lock-face 'calendar-iso-week-face)) -- cgit v1.2.3