rastapasta / mapscii

🗺 MapSCII is a Braille & ASCII world map renderer for your console - enter => telnet mapscii.me <= on Mac (brew install telnet) and Linux, connect with PuTTY on Windows
MIT License
7.93k stars 256 forks source link

vim keybinds #80

Open GideonWolfe opened 4 years ago

GideonWolfe commented 4 years ago

The problem

When I open this program my hands instinctively try to adjust the map using the vim keys. This is the natural mode of navigation for countless TUI programs.

Proposed solution

h,j,k, and l are the classic left, down, up, right controls. You could keep zooming as a and z, but I would love to use J and K.

Additional context

I don't believe these keybinds would interfere with any preexisting options, and non vim users could easily stick to the arrow keys.

This also provides a framework for more keybinds. For example if you implement a search feature, the / key is already most peoples go-to and it makes the program easy to learn.

GideonWolfe commented 4 years ago

I'm not sure how much work would need to be done but I just took a quick look at the source and it seems like someone already had a similar idea?

nahanil commented 4 years ago

HA! hjkl was my first reaction when I found this as well - looks they were added in https://github.com/rastapasta/mapscii/commit/fccacad3a24c5fc995eae2917f1d2cca91ecbb8d and work if running with npx but not in the wild :(