~elais/shaolin-emacs-archive

fbb777f7d787423aa38867e27341562bb1632fc9 — Elais Player 3 years ago 4cc6c90
add edwina window manager

edwina provides dwm style window management inside of emacs relegating all
created buffers to a main window and stack paradigm
4 files changed, 91 insertions(+), 44 deletions(-)

M guix.scm
M init.el
M lisp/shao-ui.el
M lisp/shao-windows.el
M guix.scm => guix.scm +25 -2
@@ 8,6 8,29 @@
 (guix packages)
 (guix profiles))

(define-public emacs-edwina
  (package
    (name "emacs-edwina")
    (version "20200113.1714")
    (source
      (origin
        (method url-fetch)
        (uri (string-append
               "https://melpa.org/packages/edwina-"
               version
               ".tar"))
        (sha256
          (base32
            "164wcldlm18s87cv10dz1cvy9nvd1rs67frj91pshrm0shii3d9d"))))
    (build-system emacs-build-system)
    (home-page "https://github.com/ajgrf/edwina")
    (synopsis "Dynamic window manager")
    (description
      "Edwina is a dynamic window manager for Emacs.  It automatically arranges your
Emacs panes (called \"windows\" in Emacs parlance) into predefined layouts,
dwm-style.")
    (license #f)))
    
(define emacs-envrc
  (package
    (name "emacs-envrc")


@@ 41,7 64,7 @@ desired.")
(packages->manifest
 (list emacs-use-package
       ;; shao-ui
       emacs-tao-theme emacs-golden-ratio emacs-diminish
       emacs-tao-theme emacs-edwina emacs-diminish
       ;; shao-projects
       emacs-envrc emacs-projectile
       ;; shao-snippets


@@ 50,7 73,7 @@ desired.")
       ;; shao-markdown
       emacs-markdown-mode ghc-pandoc
       ;; shao-scheme
       emacs-geiser
       emacs-geiser emacs-guix
       ;; shaolin-movement
       emacs-boon emacs-which-key emacs-ctrlf emacs-selectrum
       emacs-general emacs-magit emacs-company emacs-selectrum-prescient

M init.el => init.el +1 -4
@@ 31,10 31,6 @@
 (require 'use-package))


;; Credentials  
(setq user-full-name "Elais Player"
      user-mail-address "elais@fastmail.com")

;;
;;; Local Packages



@@ 43,6 39,7 @@
(require 'shao-editor)
(require 'shao-ui)
(require 'shao-fingers)
(require 'shao-windows)
(require 'shao-snippets)
(require 'shao-completion)
(require 'shao-projects)

M lisp/shao-ui.el => lisp/shao-ui.el +24 -32
@@ 22,39 22,39 @@


;;; General UX
(setq confirm-nonexistent-file-or-buffer nil)
(setq! confirm-nonexistent-file-or-buffer nil)

;;
;;; Scrolling

(setq hscroll-margin 2
      hscroll-step 1
      ;; Emacs spends too much effort recentering the screen if you scroll the
      ;; cursor more than N lines past window edges (where N is the settings of
      ;; `scroll-conservatively'). This is especially slow in larger files
      ;; during large-scale scrolling commands. If kept over 100, the window is
      ;; never automatically recentered.
      scroll-conservatively 101
      scroll-margin 0
      scroll-preserve-screen-position t
      ;; Reduce cursor lag by a tiny bit by not auto-adjusting `window-vscroll'
      ;; for tall lines.
      auto-window-vscroll nil
      ;; mouse
      mouse-wheel-scroll-amount '(5 ((shift) . 2))
      mouse-wheel-progressive-speed nil)  ; don't accelerate scrolling
(setq! hscroll-margin 2
       hscroll-step 1
       ;; Emacs spends too much effort recentering the screen if you scroll the
       ;; cursor more than N lines past window edges (where N is the settings of
       ;; `scroll-conservatively'). This is especially slow in larger files
       ;; during large-scale scrolling commands. If kept over 100, the window is
       ;; never automatically recentered.
       scroll-conservatively 101
       scroll-margin 0
       scroll-preserve-screen-position t
       ;; Reduce cursor lag by a tiny bit by not auto-adjusting `window-vscroll'
       ;; for tall lines.
       auto-window-vscroll nil
       ;; mouse
       mouse-wheel-scroll-amount '(5 ((shift) . 2))
       mouse-wheel-progressive-speed nil)  ; don't accelerate scrolling

;;
;;; Windows/frames

;; A simple frame title
(setq frame-title-format '("%b – Shaolin")
      icon-title-format frame-title-format)
(setq! frame-title-format '("%b – Shaolin")
       icon-title-format frame-title-format)

;; Don't resize windows & frames in steps; it's prohibitive to prevent the user
;; from resizing it to exact dimensions, and looks weird.
(setq window-resize-pixelwise t
      frame-resize-pixelwise t)
(setq! window-resize-pixelwise t
       frame-resize-pixelwise t)

(unless (assq 'menu-bar-lines default-frame-alist)
  ;; We do this in early-init.el too, but in case the user is on Emacs 26 we do


@@ 68,9 68,9 @@
;; These are disabled directly through their frame parameters, to avoid the
;; extra work their minor modes do, but we have to unset these variables
;; ourselves, otherwise users will have to cycle them twice to re-enable them.
(setq menu-bar-mode nil
      tool-bar-mode nil
      scroll-bar-mode nil)
(setq! menu-bar-mode nil
       tool-bar-mode nil
       scroll-bar-mode nil)

;;; Packages



@@ 82,13 82,5 @@
  :config
  (load-theme 'tao-yin t))

(use-package golden-ratio
  :diminish golden-ratio-mode
  :custom
  (golden-ratio-auto-scale t)
  :config
  (golden-ratio-mode +1))


(provide 'shao-ui)
;;; shao-ui.el ends here

M lisp/shao-windows.el => lisp/shao-windows.el +41 -6
@@ 1,13 1,48 @@
;;; shao-windows.el --- window management -*- lexica-binding: t -*-

;;; shao-windows.el --- window management for shaolin -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2020 Elais Player
;;
;; Author: Elais Player <https://git.sr.ht/elais>
;; Maintainer: Elais Player <elais@fastmail.com>
;; Created: June 15, 2020
;; Modified: June 15, 2020
;; Version: 0.0.1
;; Keywords:
;; Homepage: https://git.sr.ht/elais/shaolin-emacs
;; Package-Requires: ((emacs 28.0.50))
;;
;; This file is not part of GNU Emacs.
;;
;;; Commentary:
;;
;;  
;;
;;; Code:

;; Manual window management sucks, we're adding some automation
;;
;;; Functions

;;; Code:
;;
;;; Packages

(use-package edwina
  :demand t
  :general
  (shaolin-fingers-def
    "w"  '(:ignore t                     :wk "[w]indows")
    "wr" '(edwina-arrange                :wk "a[r]range")
    "ww" '(edwina-clone-window           :wk "new [w]indow")
    "wp" '(edwina-select-previous-window :wk "[p]revious window")
    "wn" '(edwina-select-next-window     :wk "[n]ext window")
    "wP" '(edwina-swap-previous-window   :wk "swap [P]revious window")
    "wN" '(edwina-swap-next-window       :wk "swap [N]ext window")
    "wd" '(edwina-delete-window          :wk "[d]elete window")
    "wm" '(edwina-zoom                   :wk "[m]ove window"))
  :custom
  (display-buffer-base-action '(display-buffer-below-selected))
  (edwina-mfact 0.60)
  :config
  (setq display-buffer-base-action '(display-buffer-below-selected))
  (edwina-setup-dwm-keys)
  (edwina-mode +1))

(provide 'shao-windows)
;;; shao-windows.el ends here