(defun my-jump-window () (interactive) (let ((keys (string-to-list "fjdksla;")) wins overlays choices) (dolist (window (window-list)) (unless (or (eq window (selected-window)) (string= (buffer-name (window-buffer window)) "*compilation*")) (push window wins))) (setq wins (nreverse wins)) (cond ((null wins)) ((null (cdr wins)) (select-window (car wins))) (t (unwind-protect (progn (while (and wins keys) (let* ((window (pop wins)) (key (pop keys)) (position (window-start window)) (overlay (make-overlay position position (window-buffer window)))) (overlay-put overlay 'before-string (propertize (format " %c " key) 'face '(:background "#ff87d7" :foreground "#1c1c1c" :weight bold :box (:line-width 3 :color "#ff87d7")))) (overlay-put overlay 'window window) (push overlay overlays) (push (cons key window) choices))) (redisplay t) (let ((window (cdr (assq (read-char-exclusive "Window: ") choices)))) (when window (select-window window)))) (mapc #'delete-overlay overlays)))))) (keymap-global-set "C-x o" #'my-jump-window) (provide 'my-jump-window)