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

Moving between windows using HNEI #14

Open
timacs opened this issue Oct 23, 2021 · 3 comments
Open

Moving between windows using HNEI #14

timacs opened this issue Oct 23, 2021 · 3 comments

Comments

@timacs
Copy link
Collaborator

timacs commented Oct 23, 2021

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. 😕

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
Copy link
Collaborator Author

timacs commented Oct 23, 2021

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
Copy link
Collaborator Author

timacs commented Oct 23, 2021

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
Copy link
Owner

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants