Skip to content

Instantly share code, notes, and snippets.

@ybiquitous
Last active June 6, 2026 07:12
Show Gist options
  • Select an option

  • Save ybiquitous/ffd3fc35a3afe5a70558547c1284ad18 to your computer and use it in GitHub Desktop.

Select an option

Save ybiquitous/ffd3fc35a3afe5a70558547c1284ad18 to your computer and use it in GitHub Desktop.
How to make `ri` more rich via `bat` in Markdown
export RI='--format=markdown'
export RI_PAGER='bat --language=markdown'
ri
@ybiquitous

Copy link
Copy Markdown
Author

Example - ri Object

Screenshot 2026-06-06 at 16 02 50

@ybiquitous

ybiquitous commented Jun 6, 2026

Copy link
Copy Markdown
Author

References

@ybiquitous

ybiquitous commented Jun 6, 2026

Copy link
Copy Markdown
Author

This technique is also applied to show_doc in irb.

E.g.,

$ irb
irb(main):001> show_doc Object

@ybiquitous

Copy link
Copy Markdown
Author

Comparison with default settings

Run:

RI= RI_PAGER= ri Object
Screenshot 2026-06-06 at 16 08 26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment