From 8730f4dda0363c4d418393b3a105309d60d4fbed Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sat, 4 Feb 2023 13:50:11 -0500 Subject: fix balance-windows --- emacs/.config/emacs-kj/init.el | 43 ++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) (limited to 'emacs') diff --git a/emacs/.config/emacs-kj/init.el b/emacs/.config/emacs-kj/init.el index f6db726..37822f5 100644 --- a/emacs/.config/emacs-kj/init.el +++ b/emacs/.config/emacs-kj/init.el @@ -127,15 +127,19 @@ ;; :weight bold :height 2.5 :box (:line-width 10 :color "red"))) ) +(defun kj/balance-main-window () + (balance-windows (window-main-window))) + (defun kj/split-window-below () (interactive) (split-window-below) - (balance-windows) + (kj/balance-main-window) (other-window 1)) (defun kj/split-window-right () (interactive) (split-window-right) + (kj/balance-main-window) (other-window 1)) (global-set-key (kbd "C-x 3") #'kj/split-window-right) @@ -659,21 +663,24 @@ (funcall replace1 (car replacements) alist)) alist))) -(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)) -;; (progn -;; (message "got here") -;; (format "%s|ssh:%s:" default-directory (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 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 @@ -824,14 +831,14 @@ (seq "*WoMan " (* anything) "*") (seq "*man " (* anything) "*") (seq "fig: " (* anything)) + (seq "*eshell*" (* anything)) "*Occur*")) buffer) (with-current-buffer buffer (apply #'derived-mode-p '(magit-mode compilation-mode comint-mode - fig-commit-mode))) - )) + fig-commit-mode))))) (setq transient-display-buffer-action '(display-buffer-in-best-side -- cgit v1.2.3