summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2023-02-04 13:50:11 -0500
committerKjetil Orbekk <kj@orbekk.com>2023-02-04 13:50:11 -0500
commit8730f4dda0363c4d418393b3a105309d60d4fbed (patch)
tree0c8e7c22440abd1c8d9580712f02012212156837
parentd7d3b4ee6740beb755f1a07be42fc904e6bfcd57 (diff)
fix balance-windows
-rw-r--r--emacs/.config/emacs-kj/init.el43
1 files changed, 25 insertions, 18 deletions
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