Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dvorak ijkl key setup #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions win-switch.el
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,34 @@ should be a list of keys that will be bound globally to
(apply 'win-switch-setup-keys-ijkl dispatch-keys)
(win-switch-remove-split-and-delete-keys))

;;;###autoload
(defun win-switch-setup-keys-ijkl-dvorak (&rest dispatch-keys)
"Restore default key commands and bind global dispatch keys.
Under this setup, keyboard keys i, j, k, and l (c, h, t, and n in
Dvorak) will switch windows, respectively, up, left, down, and
right, with other functionality bound to nearby keys. The arguments
DISPATCH-KEYS, if non-nil, should be a list of keys that will be
bound globally to `win-switch-dispatch'."
(interactive)
(win-switch-set-keys '("c") 'up)
(win-switch-set-keys '("t") 'down)
(win-switch-set-keys '("h") 'left)
(win-switch-set-keys '("n") 'right)
(win-switch-set-keys '("r") 'next-window)
(win-switch-set-keys '("l") 'previous-window)
(win-switch-set-keys '("C") 'enlarge-vertically)
(win-switch-set-keys '("T") 'shrink-vertically)
(win-switch-set-keys '("H") 'shrink-horizontally)
(win-switch-set-keys '("N") 'enlarge-horizontally)
(win-switch-set-keys '(" ") 'other-frame)
(win-switch-set-keys '("g" [return]) 'exit)
(win-switch-set-keys '("s") 'split-horizontally)
(win-switch-set-keys '("d") 'split-vertically) ; visual not letter mnemonic
(win-switch-set-keys '("0") 'delete-window)
(win-switch-set-keys '("\M-\C-g") 'emergency-exit)
(dolist (key dispatch-keys)
(global-set-key key 'win-switch-dispatch)))

;;;###autoload
(defalias 'win-switch-setup-keys-default 'win-switch-setup-keys-ijkl)

Expand Down