doomemacs/modules/input/layout
Henrik Lissner b405225b90
refactor!(vc-gutter): drop git-gutter for diff-hl
BREAKING CHANGE: This removes git-gutter as an implementation for the
`:ui vc-gutter` module, leaving only the diff-hl implementation. There
are no longer any +git-gutter or +diff-hl flags for this module. Users
don't have to do anything to keep the vc gutter, unless they prefer
git-gutter for any reason (in which case they'll need to install and set
it up themselves).

This has been planned for some time, because of a roadmap goal for Doom
to lean into native/built-in functionality where it's equal or better
than the third party alternatives. diff-hl relies on the built-in vc.el
library instead of talking to git directly (thus expanding support to
whatever VCS's vc.el supports, and not git alone), which also means it
can take advantage of its caching and other user configuration for
vc.el. Overall, it is faster and lighter.

What I've also been waiting for was a stage-hunk command, similar to
git-gutter:stage-hunk, which arrived in dgutov/diff-hl@a0560551cd and
dgutov/diff-hl@133538973b, and have evolved since.

Ref: dgutov/diff-hl@a0560551cd
Ref: dgutov/diff-hl@133538973b
Ref: https://github.com/orgs/doomemacs/projects/5/views/1?pane=issue&itemId=58747789
2024-06-22 18:14:04 -04:00
..
autoload fix(layout): Bépo rotation happening before magit 2022-09-16 13:15:46 +02:00
+azerty.el refactor!(vc-gutter): drop git-gutter for diff-hl 2024-06-22 18:14:04 -04:00
+bepo.el refactor!(vc-gutter): drop git-gutter for diff-hl 2024-06-22 18:14:04 -04:00
config.el refactor!: redesign module init/config hooks 2022-09-16 01:14:22 +02:00
README.org docs(*): replace all-the-icons with nerd-icons 2023-09-16 20:19:11 +02:00

:input layout

Description   unfold

This module provides barebones support for using Doom with non-qwerty keyboard layouts.

Module flags

+azerty
Remap keybinds to accommodate the Azerty keyboard layout.
+bepo
Remap keybinds to accommodate the BÉPO keyboard layout (version 1.1, in particular).

Packages

This module doesn't install any packages.

TODO Hacks

󱌣 This module's hacks haven't been documented yet. Document them?

TODO Changelog

This module does not have a changelog yet.

Installation

Enable this module in your doom! block.

This module has no external requirements.

TODO Usage

󱌣 This module's usage documentation is incomplete. Complete it?

Bépo

Support for the bépo layout includes:

  • Setting Avy keys to the correct home row keys
  • Changing navigation keys to c, t, s, and r

    • old t is mapped to j
    • old s is mapped to k (i.e. staging in the magit status buffer is done with k)
    • See Configuration to see where old c and r functions are remapped
  • Bind <> functions to «» keys when possible
  • Bind [] functions to () keys when possible (the "unimpaired-like" bindings)
  • Bind é key to w functions when possible
  • Bind è key to useful functions when possible
  • Bind `~ functions to $# keys when possible

Easymotion

If you use doom-package:evil-easymotion, then all the bindings that were on gs have been moved to .

In short : g s j -> g é t (evilem-motion-next-line). And so on.

Leaving mnemonics alone when possible

Exchanging h/j/k/l to c/t/s/r has the effect of destroying a few mnemonics: the change operator becomes l for example, or the window split becomes SPC é k.

The module tries to limit those changes to the minimum, especially in special buffers. A concrete example is magit.

As the magit: project buffer (obtained with M-x magit-status) does not need left-right navigation, keys c, r, h, and l keep their "expected" bindings, while t, s, j, and k are flipped:

  • checking the log from a magit buffer is still on l
  • staging a file/region has been moved to k

Possible contributions

Avoid g and z to be used too often

A nice addition in the future might be to have all the normal mode bindings that start with g start with , instead to avoid the curl on these common bindings. This is not implemented for the time being.

The same thing could be done to z, potentially using à instead.

Proper minor mode

Also, implementing all those changes as a minor we could flip on and off would help with adoption

Put "word" text objects to é instead of w

"inside word" and "around word" are iw and aw, which use the very poorly rated w key in the bépo layout. Finding a way to use é or even è more for these would be a welcome change

Org-mode

doom-package:evil-org allows to define evil-org-movement-bindings to automatically map movement bindings on non-hjkl keys. It maps automatically keys to C-c and C-r in normal and insert states though, and it's not really user friendly in Emacs to remap those.

Therefore, in org-mode:

  • org-shiftright is bound to C-»
  • org-shiftleft is bound to C-«

TODO Configuration

󱌣 This module's configuration documentation is incomplete. Complete it?

Bépo

+layout-bepo-cr-rotation-style controls whether:

  • qwerty-c functions are mapped on bépo-l key, and qwerty-r functions on bépo-h key ('ergodis), or
  • qwerty-c functions are mapped on bépo-h key, and qwerty-r functions on bépo-l key ('strict)

'strict would be the logical choice but the c functions are used more often than the r ones so Ergodis advises to actually put all the c functions on the key that does not need a curl.

Troubleshooting

Report an issue?

Outstanding issues (contributions welcome)

Bépo

  • In doom-package:eshell, the key c is still bound to evil-collection-eshell-evil-change in normal mode.

How to investigate an issue ?

If a key is misbehaving, use M-x describe-key (C-h k or SPC h k or F1 k) to see the command bound to the key, and more importantly in which keymap it is bound.

You should ignore all evil-collection-*-backup-map keymaps, as they are artifacts from evil-collection-translate-key and those maps are actually not active.

Most likely the solution is to call one of the "key rotation" functions on the relevant keymaps.

How to deactivate the new bindings and go back to the old ones ?

If you are learning a new layout you might want to go back to tho old one to "get work done". Sadly the only way is to comment out the module, run $ doom sync and restart emacs.

Restoring the session SPC q l by default helps to lower the impact of the restart.

Frequently asked questions

This module has no FAQs yet. Ask one?

TODO Appendix

󱌣 This module has no appendix yet. Write one?