walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
587 stars 17 forks source link

Converts HYPHEN in HYPHEN-MINUS #142

Closed ghost closed 11 months ago

ghost commented 11 months ago

When I run for example man gpg, and I search for "-e" by typing "/-e", it finds nothing.

This is because my keyboard types "-", which is U+002D HYPHEN-MINUS, while the man page uses "‐", which is U+2010 HYPHEN.

How can I convert the HYPHEN of the manpage into the HYPHEN-MINUS that my keyboard types?

MaximumWoahverdrive commented 11 months ago

This behavior is expected/correct

Assuming you are currently running man gpg | moar you could pipe through a sed before piping into moar and replace the characters there man gpg | sed $'s/\u2010/\u002d/g' | moar

ghost commented 11 months ago

Ok I've made a wrapper script for that.

Thanks.

ghost commented 11 months ago

For future reference, here is how the wrapper script would look like:

sed $'s/\u2010/\u002d/g' "$@" | moar