wbolster / emacs-evil-colemak-basics

Emacs package with basic key rebindings for evil-mode with the Colemak keyboard layout
86 stars 23 forks source link

Moving between windows using HNEI #14

Open timacs opened 3 years ago

timacs commented 3 years ago

The only hjkl-like commands left uncovered by this package is the window commands. I'd love to add support for them, but here my Emacs Lisp is not enough as they are inside evil-window-map. :confused:

My workaround is the following lines in init.el (that's all that should be redefined when the t-f-j rotation is turned off):

  (define-key evil-window-map "n" 'evil-window-down)
  (define-key evil-window-map "N" 'evil-window-move-very-bottom)
  (define-key evil-window-map (kbd "C-S-n") 'evil-window-move-very-bottom)
  (define-key evil-window-map "e" 'evil-window-up)
  (define-key evil-window-map "E" 'evil-window-move-very-top)
  (define-key evil-window-map (kbd "C-S-e") 'evil-window-move-very-top)
  (define-key evil-window-map "i" 'evil-window-right)
  (define-key evil-window-map "I" 'evil-window-move-far-right)
  (define-key evil-window-map (kbd "C-S-i") 'evil-window-move-far-right)
  ;; Kreate new window
  (define-key evil-window-map "k" 'evil-window-new)
  (define-key evil-window-map "\C-k" 'evil-window-new)

Could you please add support for them or give me some hints on how to do that?

timacs commented 3 years ago

Oh, just in case you didn't know, an example of the window commands is "C-w j" moving the cursor to the window below the current one. Not only can you move between windows, but also manipulate them in various ways.

timacs commented 3 years ago

that's all that should be redefined when the t-f-j rotation is turned off

My old rebindings—before I met this Emacs package—are similar to your package w/o the t-f-j rotation, so I turned it off. But I plan to go thru the Vim bindings related to it and bring the missing ones here. So, you can skip that part of work.

wbolster commented 3 years ago

yeah i use similar bindings in my init.el.

i do not know how this can be achieved with the minor mode approach that this package currently uses.

destructive operations like writing into evil-window-map doesn't translate well to a minor mode on/off toggling (though i personally never disable it except in a few weird modes like magit-status)