programming (and other) musings
12 May 2020

ace window

As i've mentioned in a previous post, i organise my emacs sessions in workspaces, a.k.a. frames, a.k.a. a thematic tiling of windows. It is therefore important to have quick ways of jumping from a window to another. Until very recently, i used a home-cooked collection of shortcuts (C-c 1, C-c 2C-c n) that would move my point to the nth window in the workspace (i trained myself to count them quick enough, i suppose), and used that together with the stock C-x o and with C-x p bound to (other-window -1), for something similar to "previous window", to move around. But i've discovered a better way.

It's called ace-window, and it's so easy to use that i'll just give you my configuration below:

(use-package ace-window
  :ensure t
  :init (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
              aw-char-position 'left
              aw-ignore-current nil
              aw-leading-char-style 'char
              aw-scope 'frame)
  :bind (("M-o" . ace-window)
         ("M-O" . ace-swap-window)))

With exwm, i also bind s-o and s-O, so i can jump when focus is on an X buffer. My only complain is that the character overlay is not visible for X buffers, but i use so few of them that it's nothing to worry about.

Tags: emacs
Creative Commons License by jao is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.