gnebbia / kb

A minimalist command line knowledge base manager
GNU General Public License v3.0
3.17k stars 104 forks source link

[request] use bat instead of cat #80

Closed pfr-dev closed 3 years ago

pfr-dev commented 3 years ago

Is it possible to configure kb to use bat instead of cat when viewing notes and cheatsheets? for large files this will allow for easy scrolling.

xscode-auto-reply[bot] commented 3 years ago

Thanks for opening a new issue. The team has been notified and will review it as soon as possible. For urgent issues and priority support, visit https://xscode.com/gnebbia/kb

gnebbia commented 3 years ago

Actually kb does not use cat, it just prints the artifacts line by line without calling an external program.

gnebbia commented 3 years ago

anyway you could try to setup a function in your .bashrc or .profile file, such as:

function kbvbat(){ kbv "$1" | bat; }

Of course rename the function as you wish.

pfr-dev commented 3 years ago

function kbvbat(){ kbv "$1" | bat; }

This does pipe the output through bat, however it exits out to a prompt meaning that you still cannot use the keyboard to scroll up/down.

gnebbia commented 3 years ago

Sorry I don't understand the issue, I tried and I am scrolling just fine, did you try it? The program does not enforce the use of cat or any other pager. Try the above solution and let me know.

pfr-dev commented 3 years ago

Nevermind, I got it working. Thanks