This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+keyboard-layouts/bepo
2016-01-05 01:05:50 +01:00
..
img [contrib] Add a bepo contributed layer 2015-10-10 23:43:05 -04:00
config.el Bepo layout improved 2015-12-15 00:25:44 +01:00
funcs.el Use spacemacs/set-leader-keys in the bepo layer 2016-01-03 20:41:25 +01:00
keybindings.el Remove bepo hack and use evil-magit state 2016-01-05 01:05:50 +01:00
README.org Fix some links in README.org files 2016-01-04 02:00:18 -05:00

Bepo layer

/TakeV/spacemacs/media/commit/3c1982ddb843feefcaa60e98783532245e1998a7/layers/+keyboard-layouts/bepo/img/bepo.png

logo

Description

This layer changes the key bindings in spacemacs to be compatible with the bepo keyboard layout. bepo is a keyboard layout optimized for the French language. This package first switch traditional hjkl movement keys with ctsr, and then try to correct the bugs introduced by these changes in other modes/packages.

/TakeV/spacemacs/media/commit/3c1982ddb843feefcaa60e98783532245e1998a7/layers/+keyboard-layouts/bepo/img/keymap.png

Install

To use this contribution add it to your ~/.spacemacs

  (setq-default dotspacemacs-configuration-layers '(bepo))

It is possible to customize the layer via some variables.

Variables

This layer can be customized with two variables:

  • bepo-set-enabled-configurations
  • bepo-set-disabled-configurations

The first one is used to set the list of configurations to activate, and the second one to prevent loading certain configurations. If the bepo-set-enabled-configurations is nil, all configurations are loaded. Otherwise, only the listed configurations are loaded. Any configuration listed in bepo-set-disabled-configurations will never be loaded, whether it is in the enabled list or not.

  (setq-default dotspacemacs-configuration-layers '(
    (bepo :variables bepo-set-disabled-configurations '(org magit))))

Customization

It is possible to override the bindings or add new ones by defining in your own layer, or in the user-init, some functions named bepo/pre-config-<NAME> and bepo/post-config-<NAME>. They are respectively called just before and after the actual configuration of keybindings. <NAME> is the name of the configuration you want to customize, they are listed under /TakeV/spacemacs/src/commit/3c1982ddb843feefcaa60e98783532245e1998a7/layers/+keyboard-layouts/bepo/Configurations.

Mapping

The mapping correction is the one proposed for vim on the bepo's official wiki. This layer tries to do the following changes when the following letters are used for doing a movement:

  • Map the movements keys under the right hand's fingers:

    • c → h
    • t → j
    • s → k
    • r → l
  • Map lost functionalities back to some keys:

    • h → r
    • j → t
    • k → s
    • l → c

The equivalent remapping is also valid for uppercase letters, or CTRL+KEY when they are used to represent a movement, or to keep the mnemonic between the lower/upper-case consistent.

Some bepo keys are not used in traditional mapping, mainly because they are not present on the en-us keyboard layout. They can be used as an alias for other shortcuts:

  • Map unused é key as an alias of w, more useful in vim mode:

    • é → w
    • É → W
  • Map indentation on direct-access keys:

    • » → >
    • « → <

Some default configurations are also not optimal for vim, so the following defaults are changed:

  • Change evil-escape escape combination to something faster to type, while being nearly nonexistent in French or English words:

    • fd → gq
  • In avy, the key used to select words/lines are remapped to the 8 characters under the fingers:

    • a u i e t s r n
  • Add « and » as operators for evil-surround, surrounding text with the specified symbols.

In some cases the key remapping will not follow these conventions, mainly because there are better alternatives, or because some moves don't make sense.

Example: In the magit status buffer, the c is used for commit by default, but if we want to follow the conventions, it should be remapped to "move left". As it is not useful to move left on magit, because operations are done on lines, the c is not remapped.

Note: One difference exists with the wiki version: the w is not remapped to C-w to avoid having to change its meaning in other modes. Spacemacs provides already a SPC w key binding for working with windows.

Configurations

The available configurations are:

  • ace-window
  • avy
  • buffer-move
  • company
  • evil
  • evil-escape
  • evil-surround
  • evil-evilified-state
  • evil-window
  • eyebrowse
  • flycheck-error-list
  • helm
  • helm-buffers
  • helm-files
  • helm-locate
  • magit
  • neotree
  • org
  • ranger
  • spacemacs

Keybindings

This layer is using functions that automatically remap keybindings in a lot of modes, so it's difficult to list all the keybindings changes.

  • You chose to use a different keyboard layout.
  • You chose to use the dark side by using evil (because they have 🍪 obviously).
  • You chose to use a layer trying to solve the induced mess.
  • The price you have to pay is the absence of a keybindings list.

Contributors

  • Fabien Dubosson

Sources

The bepo logo and the keymap image come from the bepo official website. They are licensed under the CC-BY-SA.