abo-abo / ace-window

Quickly switch windows in Emacs
977 stars 87 forks source link

A hydra to switch or kill a window #122

Closed To1ne closed 6 years ago

To1ne commented 6 years ago

I've been tinkering with hydra, but I failed to figure out.

What I am trying do: Have one keybinding activate a hydra. At this point show the chars in aw-keys are displayed in each window, just as ace-window does. Now I want to be able to press one of the chars displayed in the window, to jump to that one (that's just basic ace-window functionality).

But when I press another letter, e.g. d and 1 afterwards that would delete that window.

Other things could be done to, e.g. swapping two windows by pressing s 1 2.

abo-abo commented 6 years ago

What you describe looks to be basic ace-window functionality:

(defvar aw-dispatch-alist
  '((?x aw-delete-window "Delete Window")
    (?m aw-swap-window "Swap Windows")
    (?M aw-move-window "Move Window")
    (?j aw-switch-buffer-in-window "Select Buffer")
    (?n aw-flip-window)
    (?u aw-switch-buffer-other-window "Switch Buffer Other Window")
    (?c aw-split-window-fair "Split Fair Window")
    (?v aw-split-window-vert "Split Vert Window")
    (?b aw-split-window-horz "Split Horz Window")
    (?o delete-other-windows "Delete Other Windows")
    (?? aw-show-dispatch-help))
  "List of actions for `aw-dispatch-default'.
Each action is a list of either:
  (char function description) where function takes a single window argument
or
  (char function) where function takes no argument and the description is omitted.")

So to delete window 1 with ace-window, press x1. To swap - m1.

To1ne commented 6 years ago

Awesome! Big thanks for the reply.