From cbbbf0de5cff91eb8e857045ef4f7a9be3176c86 Mon Sep 17 00:00:00 2001 From: Gerry Agbobada <10496163+gagbo@users.noreply.github.com> Date: Mon, 10 May 2021 10:57:06 +0200 Subject: [PATCH] fix(input layout bepo): remap visual-line-mode-map (#5019) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(input layout bepo): remap visual-line-mode-map Fixes #5002 * TO SQUASH: map visual-line-mode-map See comment for rationale. This is the only way to make the remapping work correctly. `j` and `k` aren't remapped because `t` and `s` had no meaning at all on `visual-line-mode-map` in `motion` state. * TO SQUASH: sharpquote and align --- modules/input/layout/+bepo.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/input/layout/+bepo.el b/modules/input/layout/+bepo.el index 855073391..fd582dce9 100644 --- a/modules/input/layout/+bepo.el +++ b/modules/input/layout/+bepo.el @@ -73,6 +73,23 @@ In all cases, 'h' functions go to 'c' and 'l' ones go to 'r' so the navigation k (+layout-bepo-rotate-ts-bare-keymap '(read-expression-map)) (+layout-bepo-rotate-bare-keymap '(evil-window-map) +layout-bepo-cr-rotation-style) (+layout-bepo-rotate-evil-keymap +layout-bepo-cr-rotation-style) + ;; Remap the visual-mode-map bindings if necessary + ;; See https://github.com/emacs-evil/evil/blob/7d00c23496c25a66f90ac7a6a354b1c7f9498162/evil-integration.el#L478-L501 + ;; Using +layout-bepo-rotate-keymaps is impossible because `evil-define-minor-mode-key' doesn't + ;; provide an actual symbol to design the new keymap with, and instead stuff the keymap in + ;; an auxiliary-auxiliary `minor-mode-map-alist'-like variable. + (after! evil-integration + (when evil-respect-visual-line-mode + (map! :map visual-line-mode-map + :m "t" #'evil-next-visual-line + ;; _Not_ remapping gj and gk because they aren't remapped + ;; consistently across all Emacs. + :m "s" #'evil-previous-visual-line + :m "È" #'evil-beginning-of-visual-line + :m "gÈ" #'evil-beginning-of-line + :m "$" #'evil-end-of-visual-line + :m "g$" #'evil-end-of-line + :m "V" #'evil-visual-screen-line))) (map! :i "C-t" #'+default-newline (:when (featurep! :editor multiple-cursors)