GitHunt
IA

iaseth/alex

Ncurses-based text pager written in C++

Alex

Alex is a simple ncurses-based text pager written in C++.
It allows you to view text files page by page in a terminal,
with support for navigation, text wrapping, and customizable colors.

Features

  • Wraps long lines based on terminal width (configurable)
  • Preserves indentation and empty lines
  • Navigation:
    • Left/Right arrow keys: Previous/Next page
    • Up/Down arrow keys: Jump to Start/End
    • q: Quit
    • b/t: Cycle through background and text colors
  • Centered display with equal margins

Requirements

  • C++17 or later
  • ncurses library
  • CMake (for building)

Installation

Linux/macOS

  1. Install ncurses if not already installed:
    sudo apt install libncurses5-dev   # Debian/Ubuntu
    sudo dnf install ncurses-devel     # Fedora
    brew install ncurses               # macOS (Homebrew)
  2. Clone the repository and build the project:
    git clone https://github.com/iaseth/alex
    cd alex
    mkdir build && cd build
    cmake ..
    make
  3. Run the program:
    ./alex <filename> [max_width]

Usage

./alex example.txt 80
  • This command opens example.txt with a max text width of 80 characters.

License

This project is licensed under the MIT License.

Languages

C++91.3%CMake8.7%

Contributors

MIT License
Created March 21, 2025
Updated March 21, 2025