branch: externals/window-commander commit 54ca1baa14ec5420a1be011d6ee7cd587006db44 Author: Daniel Semyonov <cm...@dsemy.com> Commit: Daniel Semyonov <cm...@dsemy.com>
; Restructure README and commentary --- README | 57 +++++++++++++++++++++++++++++++++++---------------------- swsw.el | 22 +++++++++++++++++----- 2 files changed, 52 insertions(+), 27 deletions(-) diff --git a/README b/README index 9ebcae6515..3df48df549 100644 --- a/README +++ b/README @@ -1,42 +1,55 @@ -swsw - simple window switching +swsw - Simple window switching -DESCRIPTION +swsw (simple window switching) is an Emacs package which provides a minor mode +for switching to windows using IDs assigned to them automatically. -swsw is an Emacs package which provides a minor mode for switching windows -similarly to `ace-window' and `switch-window'. +Installation: -USAGE +Currently, only manual installation is available: -When swsw-mode is active: -- A window ID is displayed using a mode line lighter or a display function. -- A single (predefined) character CHAR corresponds to the minibuffer. -- Pressing M-x swsw-select RET ID switches focus to the window which - corresponds to ID, or to the minibuffer if CHAR is entered. +Clone the repository: -INSTALLATION +$ cd ~ -Currently, only manual installation is available: +$ git clone 'https://git.sr.ht/~dsemy/swsw' -1. Clone the repository: +Install the package: -$ cd $your_emacs_directory +M-x package-install-file RET ~/swsw.el RET -$ git clone 'https://git.sr.ht/~dsemy/swsw' +Usage: -2. Load the package and enable the minor mode: +Enable `swsw-mode' and (optionally) bind `swsw-select' to a key: -;; vanilla -(add-to-list 'load-path (locate-user-emacs-file "swsw")) -(require 'swsw) (swsw-mode) +(define-key swsw-mode-map "C-x o" #'swsw-select) + +For use-package users: -;; use-package (use-package swsw - :load-path "swsw/" + :demand ; :bind keyword causes loading to defer. + :bind + (:map swsw-mode-map + ("C-x o" . swsw-select)) :config (swsw-mode)) -COPYRIGHT +When swsw-mode is active: +- A window ID is displayed using a mode line lighter or a display function (see + `swsw-display-function'). +- A single (predefined) character CHAR corresponds to the minibuffer (see + `swsw-minibuffer-id'). +- Window IDs are assigned to all windows on all frames (by default, see + `swsw-scope'). + +C-x o RET ID (if bound) or M-x swsw-select RET ID switches focus to the window +which corresponds to ID. + +You can customize `swsw-mode' using the customize interface: + +M-x customize-group RET swsw RET + +Copyright: Copyright © 2020 Daniel Semyonov <cm...@dsemy.com> Licensed under GPLv3 or later. diff --git a/swsw.el b/swsw.el index a8f98e34f3..f0e71916d9 100644 --- a/swsw.el +++ b/swsw.el @@ -24,7 +24,7 @@ ;;; Commentary: ;; swsw (simple window switching) provides a minor mode for switching -;; windows using IDs assigned to them. +;; to windows using IDs assigned to them automatically. ;; ;; Usage: ;; @@ -33,18 +33,30 @@ ;; (swsw-mode) ;; (define-key swsw-mode-map "C-x o" #'swsw-select) ;; -;; You can customize `swsw-mode' using the customize interface: -;; -;; M-x customize-group RET swsw RET -;; ;; For use-package users: ;; ;; (use-package swsw +;; :demand ; :bind keyword causes loading to defer. ;; :bind ;; (:map swsw-mode-map ;; ("C-x o" . swsw-select)) ;; :config ;; (swsw-mode)) +;; +;; When swsw-mode is active: +;; - A window ID is displayed using a mode line lighter or a display function (see +;; `swsw-display-function'). +;; - A single (predefined) character CHAR corresponds to the minibuffer (see +;; `swsw-minibuffer-id'). +;; - Window IDs are assigned to all windows on all frames (by default, see +;; `swsw-scope'). +;; +;; C-x o RET ID (if bound) or M-x swsw-select RET ID switches focus to the window +;; which corresponds to ID. +;; +;; You can customize `swsw-mode' using the customize interface: +;; +;; M-x customize-group RET swsw RET ;;; Code: