Skip to content

A small, ncurses-based pager written in C, designed to be easy to read, modify, and experiment with.

License

Notifications You must be signed in to change notification settings

terra2o/hackable-pager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hackable-pager

hackable-pager is a small pager written in C using ncurses.


What is this?

This project is a minimal text/code viewer that:

  • reads a file line by line into memory
  • renders it manually using ncurses
  • allows scrolling
  • applies very basic C syntax highlighting

Why does this exist?

I just wanted to make a pager in C... However, the possible uses I think this has are:

  • A kernel for an advanced pager OR text/code editor
  • Learning ncurses
  • Messing around

Features

  • Full-screen ncurses rendering
  • Vertical scrolling
    • j / k
    • arrow keys
  • Fixed-width line number gutter
  • Very basic C syntax highlighting:
    • keywords
    • string literals
    • // line comments
  • Straightforward codebase

Building

You’ll need ncurses installed.

gcc pager.c -lncurses -o pager

Usage

./pager [path/to/.c/file

Controls:

  • j / ↓ — scroll down
  • k / ↑ — scroll up
  • q — quit

About

A small, ncurses-based pager written in C, designed to be easy to read, modify, and experiment with.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages