abo-abo / ace-window

Quickly switch windows in Emacs
992 stars 87 forks source link

[suggestion] when only 1 window left make ace-window switch between 2 latest buffers? #82

Closed zeltak closed 7 years ago

zeltak commented 7 years ago

Hi

i saw a cool lisp code today that gave me an idea. If there is only one window displayed, it would be cool if ace-window could swap it with previous buffer. This would add additional functionality to ace-window when working with 1 window :)

thoughts?

best

Z

abo-abo commented 7 years ago

It's best left to user config. It's very easy to implement a custom command that does that.

zeltak commented 7 years ago

thx, you mean ontop of ace-window or a complete separate elisp? i cant really code so an example starting point would be great if you have time :)

thx!

Z

abo-abo commented 7 years ago
(defun my-ace-window (arg)
  (interactive "p")
  (if (= 1 (length (window-list)))
      (next-buffer)
    (ace-window arg)))

(global-set-key (kbd "M-p") 'my-ace-window)
zeltak commented 7 years ago

perfect!

thx alot!

Z