mfontanini / presenterm

A markdown terminal slideshow tool
https://mfontanini.github.io/presenterm/
BSD 2-Clause "Simplified" License
1.33k stars 32 forks source link

Allow defining custom keybindings in config file #132

Closed mfontanini closed 10 months ago

mfontanini commented 10 months ago

This allows defining custom keybindings in the config file under ~/.config/presenterm/config.yaml. I will document this along with the next release but you can do things like:

bindings:
  next_slide: ["l", "<right>"]
  previous_slide: ["h", "<left>"]
  first_slide: ["1"]
  go_to_slide: [":<number><cr>"]

By default all mappings are the same as before, but they can be overridden one by one.

This for now performs only some checks on conflicting keybindings but it won't detect things like "potato" vs "ta" in its current form.

mfontanini commented 10 months ago

cc @pwnwriter

pwnwriter commented 10 months ago

Looks really neat. But just curious, most of the rust related tools follow toml config. It'd have been more Fabolous if presenterm support that syntax.

mfontanini commented 10 months ago

presenterm already uses yaml for things like the front matter and themes. I don't want to introduce another dependency/format unless it adds value, which I don't think toml would given the limited config we currently have. If at some point yaml becomes a problem, this can be changed.