/windswap

Like Emacs's "windmove.el", but swaps buffers while moving

Primary LanguageEmacs Lisp

Melpa Status Melpa Stable Status Build Status Support me

Swap Emacs windows with their neighbours

If you enjoy using windmove, this package is an add-on for you: it has variants of the windmove commands which swap the buffers as you move, so that you get the effect of "dragging" windows around directionally with the arrow keys.

Update: as of Emacs 27.1, there are windmove-swap-* commands that are mostly identical to this package, with the exception that they will happily swap the contents of dedicated windows, while windswap refuses to do so: this seems like a better behaviour to me.

Installation

You can install windswap from the MELPA repository. The version of windswap there will always be up-to-date.

Add global key bindings for windswap's commands manually, or use the convenient windswap-default-keybindings function.

(windmove-default-keybindings 'control)
(windswap-default-keybindings 'control 'shift)

About

Author: Steve Purcell

Homepage: https://github.com/purcell/windswap

This little library was extracted from the author's full Emacs configuration, which readers might find of interest.


💝 Support this project and my other Open Source work

💼 LinkedIn profile

✍ sanityinc.com