Offer a *visual* way to choose a window to switch to
See the codeswitch-window is an Emacs window switch tool, which offer a visual way to choose a window to switch to, delete, split or other operations.

Note: User can install switch-window with El-Get too.
(require 'switch-window)
(global-set-key (kbd "C-x o") 'switch-window)
(global-set-key (kbd "C-x 1") 'switch-window-then-maximize)
(global-set-key (kbd "C-x 2") 'switch-window-then-split-below)
(global-set-key (kbd "C-x 3") 'switch-window-then-split-right)
(global-set-key (kbd "C-x 0") 'switch-window-then-delete)
(global-set-key (kbd "C-x 4 d") 'switch-window-then-dired)
(global-set-key (kbd "C-x 4 f") 'switch-window-then-find-file)
(global-set-key (kbd "C-x 4 m") 'switch-window-then-compose-mail)
(global-set-key (kbd "C-x 4 r") 'switch-window-then-find-file-read-only)
(global-set-key (kbd "C-x 4 C-f") 'switch-window-then-find-file)
(global-set-key (kbd "C-x 4 C-o") 'switch-window-then-display-buffer)
(global-set-key (kbd "C-x 4 0") 'switch-window-then-kill-buffer)
When switch-window is enabled, user can use the below five keys:
| key | command description |
|---|---|
| "i" | Move the border up |
| "k" | Move the border down |
| "j" | Move the border left |
| "l" | Move the border right |
| "b" | Balance windows |
| "SPC" | Resume auto-resize |
If you want to customize this feature, please see variable: `switch-window-extra-map'.
Note: if you use auto-resize window feature, you must know that when you execute above window operate commands, auto-resize feature will be disabled temporarily, you should use above "SPC" key to resume.
(setq switch-window-shortcut-style 'qwerty)
Note: user can arrange qwerty shortcuts by variable `switch-window-qwerty-shortcuts'.
The face of label is switch-window-label, user can change it :height with custiomize-face
(setq switch-window-threshold 2)
(setq switch-window-minibuffer-shortcut ?z)
(setq switch-window-auto-resize-window t)
(setq switch-window-default-window-size 0.8) ;80% of frame size
(switch-window-mouse-mode) ;auto resize when switch window with mouse
Advanced usage:
(setq switch-window-auto-resize-window
(lambda ()
(equal (buffer-name) "*scratch*"))) ;when return t, run auto switch
(setq switch-window-default-window-size '(0.8 . 0.6)) ;80% width and 60% height of frame
By the way, you can use package golden-ratio also.
By default, switch-window get user's input with the help of function `read-event', this approach does not work well with Exwm (Emacs X window manager), user should set the below variable and use minibuffer to get input instead:
(setq switch-window-input-style 'minibuffer)
Note: if you use minibuffer to get input, the feature about `switch-window-minibuffer-shortcut' will not work well.
The only choice is using asciiart, which draw a bigger label with small ascii char.
(setq switch-window-shortcut-appearance 'asciiart)

Prepare your label images, rename them to: 1.png … 9.png, a.png … z.png.
You can use other image types supported by Emacs, please see: `image-types'.
Put all above images to directory: `switch-window-image-directory'.
Set variable: `switch-window-shortcut-appearance'
(setq switch-window-shortcut-appearance 'image)

All you should do is hacking you own label buffer function, for example: my-switch-window-label-buffer-function, and set the below variable:
(setq switch-window-label-buffer-function
'my-switch-window-label-buffer-function)
Converted from switch-window.el by el2org .
Emacs Lisp
100.0%
Offer a *visual* way to choose a window to switch to
See the codeswitch-window is an Emacs window switch tool, which offer a visual way to choose a window to switch to, delete, split or other operations.

Note: User can install switch-window with El-Get too.
(require 'switch-window)
(global-set-key (kbd "C-x o") 'switch-window)
(global-set-key (kbd "C-x 1") 'switch-window-then-maximize)
(global-set-key (kbd "C-x 2") 'switch-window-then-split-below)
(global-set-key (kbd "C-x 3") 'switch-window-then-split-right)
(global-set-key (kbd "C-x 0") 'switch-window-then-delete)
(global-set-key (kbd "C-x 4 d") 'switch-window-then-dired)
(global-set-key (kbd "C-x 4 f") 'switch-window-then-find-file)
(global-set-key (kbd "C-x 4 m") 'switch-window-then-compose-mail)
(global-set-key (kbd "C-x 4 r") 'switch-window-then-find-file-read-only)
(global-set-key (kbd "C-x 4 C-f") 'switch-window-then-find-file)
(global-set-key (kbd "C-x 4 C-o") 'switch-window-then-display-buffer)
(global-set-key (kbd "C-x 4 0") 'switch-window-then-kill-buffer)
When switch-window is enabled, user can use the below five keys:
| key | command description |
|---|---|
| "i" | Move the border up |
| "k" | Move the border down |
| "j" | Move the border left |
| "l" | Move the border right |
| "b" | Balance windows |
| "SPC" | Resume auto-resize |
If you want to customize this feature, please see variable: `switch-window-extra-map'.
Note: if you use auto-resize window feature, you must know that when you execute above window operate commands, auto-resize feature will be disabled temporarily, you should use above "SPC" key to resume.
(setq switch-window-shortcut-style 'qwerty)
Note: user can arrange qwerty shortcuts by variable `switch-window-qwerty-shortcuts'.
The face of label is switch-window-label, user can change it :height with custiomize-face
(setq switch-window-threshold 2)
(setq switch-window-minibuffer-shortcut ?z)
(setq switch-window-auto-resize-window t)
(setq switch-window-default-window-size 0.8) ;80% of frame size
(switch-window-mouse-mode) ;auto resize when switch window with mouse
Advanced usage:
(setq switch-window-auto-resize-window
(lambda ()
(equal (buffer-name) "*scratch*"))) ;when return t, run auto switch
(setq switch-window-default-window-size '(0.8 . 0.6)) ;80% width and 60% height of frame
By the way, you can use package golden-ratio also.
By default, switch-window get user's input with the help of function `read-event', this approach does not work well with Exwm (Emacs X window manager), user should set the below variable and use minibuffer to get input instead:
(setq switch-window-input-style 'minibuffer)
Note: if you use minibuffer to get input, the feature about `switch-window-minibuffer-shortcut' will not work well.
The only choice is using asciiart, which draw a bigger label with small ascii char.
(setq switch-window-shortcut-appearance 'asciiart)

Prepare your label images, rename them to: 1.png … 9.png, a.png … z.png.
You can use other image types supported by Emacs, please see: `image-types'.
Put all above images to directory: `switch-window-image-directory'.
Set variable: `switch-window-shortcut-appearance'
(setq switch-window-shortcut-appearance 'image)

All you should do is hacking you own label buffer function, for example: my-switch-window-label-buffer-function, and set the below variable:
(setq switch-window-label-buffer-function
'my-switch-window-label-buffer-function)
Converted from switch-window.el by el2org .
Emacs Lisp
100.0%