walles / moar

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

Converts HYPHEN in HYPHEN-MINUS #142

Closed ghost closed 1 year ago

ghost commented 1 year 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 1 year 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 1 year ago

Ok I've made a wrapper script for that.

Thanks.

ghost commented 1 year ago

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

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