gleitz / howdoi

instant coding answers via the command line
http://blog.gleitzman.com/post/43330157197/howdoi-instant-coding-answers-via-the-command-line
MIT License
10.56k stars 867 forks source link

Add flag to enable paging / choose pager #463

Closed Zane- closed 2 years ago

Zane- commented 2 years ago

Description

Add a --use_pager (or something similar) flag to open the output from howdoi in a pager, maybe something defined in an environment variable.

This would be nice for viewing longer answers in less or bat or something.

I realize you can just pipe the output of howdoi into whatever you want directly, but it'd be nice for it to be an officially-supported feature.

gleitz commented 2 years ago

Thanks for the suggestion. It's been a design decision to specifically not support features that can be achieved by other tools. For a pager, I could imagine some folks might want to page with less, but others might want something curses-based, and also have very fine grained control over exactly how and when the paging occurs. These will all be features howdoi would have to support.

Are there reasons why you want something built in, rather than using other utilities? Is it just ease of use or is it technologically difficult for what you're trying to achieve?

Zane- commented 2 years ago

So I originally requested this in hopes of getting around limitations with Neovim's :termopen command as it can't pipe commands (only runs a singular command with some flags), but I've since then discovered that I can get around it by using bash -c and then provide howdoi piped to a pager as the command argument

gleitz commented 2 years ago

Excellent! Thanks again for supporting howdoi