From c335ee8ed72db2cb0df9283929107cc892905513 Mon Sep 17 00:00:00 2001 From: "Mike JS. Choi" Date: Sun, 27 May 2018 12:18:12 -0500 Subject: [PATCH] Add key-binding configuration README --- README.md | 5 ++++- key/README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 key/README.md diff --git a/README.md b/README.md index 6211c4e..aac4e5f 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,10 @@ q | Ctrl+c - [q]uit [w,a,s,d,?] >> [INPUT HERE] ``` -> The movement controls have been derived from both the world of gamers (WASD) and VIM users (HJKL). +### ⚙️ Customization + +The above key-bindings can be altered by creating a `.fac.yml` file in your home directory. +Please refer to the [configuration README.md](./key/README.md) for more information. ## ✋ Contributing diff --git a/key/README.md b/key/README.md new file mode 100644 index 0000000..34c5e6e --- /dev/null +++ b/key/README.md @@ -0,0 +1,46 @@ +# ⚙️ Configuration + +## .fac.yml + +Configure fac by adding a `.fac.yml` in your `$HOME` directory. With the file in place, the following paramters can be configued: + +```yml +select_local: a +select_incoming: b +toggle_view: c +show_up: d +show_down: e +scroll_up: f +scroll_down: g +edit: h +next: i +previous: j +quit: k +help: l +``` + +## 📖 Rules + +When parsing `.fac.yml`, fac enforces *three rules.* + +### 1. Invalid key-binding keys +```yml +foobar: f +``` + +> Warning: Invalid key: "fobar" will be ignored + +### 2. Multi-character key-mappings +```yml +select_local: local +``` + +> Warning: Illegal multi-character mapping: "local" will be interpreted as 'l' + +### 3. Duplicate key-mappings +```yml +show_up: u +scroll_up: u +``` + +> Fatal: Duplicate key-mapping: "scroll_up, show_up" are all represented by 'u'