No description
Find a file
2019-09-13 23:33:35 -05:00
demo Simple method for paging long strings 2019-09-06 19:37:34 -05:00
src Make key customization available from public API 2019-09-13 23:33:35 -05:00
.gitignore Simple method for paging long strings 2019-09-06 19:37:34 -05:00
LICENSE Simple method for paging long strings 2019-09-06 19:37:34 -05:00
pager.nimble Simple method for paging long strings 2019-09-06 19:37:34 -05:00
README.md Allow customizing the navigation keys 2019-09-11 18:56:36 -05:00

nim-pager

A simple command line pager, written in Nim.

Usage

This project can be compiled into a binary using nimble. However, its primary use is as a library. In your project, use it as follows:

import pager

# assign some long string to longString
page(longString)

This will split the value of longString onto lines that can be stepped through with the following keys:

  • j: down
  • k: up
  • g: go to top
  • G: go to bottom
  • Ctrl-U: go up one-half of the screen
  • Ctrl-D: go down one-half of the screen
  • q: quit

These keys can be customized by passing optional arguments to page. See the function signature of page for details.

Project Goals

pager was written for roman, and currently only has the flexibility and features required for that task. However, any patches or requests for extension would be welcome!

Contributing

Contributions are welcome! Please send patches, questions, requests, etc. to my public inbox.