Titor8115 / mandown

man-page inspired Markdown viewer
GNU General Public License v3.0
246 stars 13 forks source link

Key mapping/binding customization #33

Open mnacamura opened 3 years ago

mnacamura commented 3 years ago

It would be nice if mandown implements navigation key binds like man has. For example, g to go to top, G to go to bottom, etc.

Titor8115 commented 3 years ago

Sorry for the late reply (been busy recently) I'll try to implement them in next update or the one after. I'm still deciding whether I should implement user custom key assignments or not. Do you think that would be nice to have or should I stick to the existing navigation key

mnacamura commented 3 years ago

I think it would be nice to have the option. Some people may want vi key binds, while others emacs or the like. Personally I like to keep consistent key binds with the other pager (in my case, less). Having the option would help a lot.

Second thought: it could be another viable strategy to let $PAGER control all navigation and mdn focuses only on rendering.

Titor8115 commented 3 years ago

I think it would be nice to have the option. Some people may want vi key binds, while others emacs or the like. Personally I like to keep consistent key binds with the other pager (in my case, less). Having the option would help a lot.

Second thought: it could be another viable strategy to let $PAGER control all navigation and mdn focuses only on rendering.

@mnacamura I just recently pushed the new version with config file support (only has indent in config file so far). Currently working on transferring raw coded configurations to be handled by libconfig. I'll add default key binding to the list of config file support(something like key_map = less; or key_map = man;).

About letting $PAGER to decide navigation, I feel like it would change significant portions of main.c and rendering parts of view.c in order to achieve that. So I don't think it would be a feature in near future, unfortunately.