spacemacs/layers/+keyboard-layouts/bepo/README.org

162 lines
5.2 KiB
Org Mode
Raw Normal View History

#+TITLE: Bépo layer
#+CAPTION: logo
[[file:img/bepo.png]]
2016-03-31 02:59:55 +00:00
* Table of Contents :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#install][Install]]
- [[#variables][Variables]]
- [[#customization][Customization]]
- [[#mapping][Mapping]]
- [[#configurations][Configurations]]
- [[#keybindings][Keybindings]]
- [[#contributors][Contributors]]
- [[#sources][Sources]]
* Description
This layer changes the key bindings in spacemacs to be compatible with the [[http://bepo.fr/][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.
[[file:img/keymap.png]]
2015-10-19 22:41:53 +00:00
* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =bepo= to the existing =dotspacemacs-configuration-layers= list in this
file.
2015-10-19 22:41:53 +00:00
2016-01-04 07:00:18 +00:00
It is possible to customize the layer via some variables.
2015-10-19 22:41:53 +00:00
** 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.
#+begin_src emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(bepo :variables bepo-set-disabled-configurations '(org magit))))
#+end_src
** Customization
2016-01-09 20:43:06 +00:00
It is possible to override or add bindings by defining in your own layer (or in
the =user-init=) some functions named =bepo/pre-config-<NAME>= and
2015-10-19 22:41:53 +00:00
=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 [[Configurations]].
2016-01-09 20:43:06 +00:00
Note: If you define some of these functions in your own layer, be sure that the
=bepo= layer is placed after it in the =dotspacemacs-configuration-layers= list.
* Mapping
2016-01-09 20:43:06 +00:00
The mapping correction is the one proposed for vim on the official bepo [[http://bepo.fr/wiki/Vim#Principe][wiki]].
2015-10-19 22:41:53 +00:00
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~
2015-10-19 22:41:53 +00:00
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
2016-01-09 20:43:06 +00:00
on the =en-us= keyboard layout. They are used as aliases 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
2015-10-19 22:41:53 +00:00
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.
2015-10-19 22:41:53 +00:00
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.
#+begin_verse
2015-10-19 22:41:53 +00:00
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".
2016-01-09 20:43:06 +00:00
As it is not useful to move left on =magit= because operations are done line by
line the ~c~ is not remapped.
#+end_verse
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.
2015-10-19 22:41:53 +00:00
* Configurations
The available configurations are:
- ace-window
- avy
2015-10-19 22:41:53 +00:00
- buffer-move
2016-01-09 20:43:06 +00:00
- comint-mode
- company
2016-01-09 20:43:06 +00:00
- elfeed
- evil
- evil-escape
- evil-surround
2015-10-19 22:41:53 +00:00
- evil-evilified-state
- evil-window
2015-10-19 22:41:53 +00:00
- eyebrowse
- flycheck-error-list
- helm
2015-10-19 22:41:53 +00:00
- helm-buffers
- helm-files
- helm-locate
2016-01-09 20:43:06 +00:00
- ivy
- magit
- neotree
- org
- ranger
- spacemacs
2015-10-19 22:41:53 +00:00
* 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.
2015-10-19 22:41:53 +00:00
- You chose to use a different keyboard layout.
- You chose to use the dark side by using evil (because they have :cookie: 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 [[http://bepo.fr/][bepo]] official website. They are
licensed under the [[http://creativecommons.org/licenses/by-sa/3.0/deed.en][CC-BY-SA]].