Skip to main content

A terminal text editor inspired by the ISPF editor from z/OS

Project description

notispf

A terminal text editor for Linux and macOS inspired by the ISPF editor from z/OS mainframes. Runs in your terminal like vim or nano, with the prefix command area that ISPF users know and love.

Installation

Download a binary (no Python required)

Go to the Releases page and download the binary for your platform:

Platform File
Linux notispf-linux
macOS notispf-macos
Windows notispf-windows.exe

Linux / macOS:

chmod +x notispf-linux   # or notispf-macos
./notispf-linux myfile.txt

Optionally move it somewhere on your PATH:

mv notispf-linux ~/.local/bin/notispf

macOS note: macOS will warn that the binary is from an unidentified developer. To clear the warning:

xattr -d com.apple.quarantine ./notispf-macos

Then run it normally.

Via pip

pip install notispf

From source

git clone https://github.com/mrthock/notispf
cd notispf
pip install -e .

Usage

notispf <file>

Screen Layout

 notispf  filename.txt                              Line 1/42
000001|This is the first line of your file
000002|Second line here
000003|Third line
      |~
      |~
Type prefix command, Enter to execute, Esc to cancel
  • Status bar (top) — filename, modified flag [+], current line/total
  • Prefix column (left, 6 chars) — shows line numbers; type commands here
  • Text area (right of |) — edit your file
  • Message/command line (bottom) — status messages and command input

Navigation

Key Action
Arrow keys Move cursor
Page Up / Page Down Scroll
Home / Ctrl+A Beginning of line
End / Ctrl+E End of line

Switching Between Text and Prefix Area

Key Action
Tab text(N) → prefix(N+1)
Tab prefix(N) → text(N)
Shift+Tab text(N) → prefix(N)
Shift+Tab prefix(N) → text(N-1)

Prefix Commands

Type a command into the prefix column, then press Enter to execute. You can stage commands on multiple lines before pressing Enter — they all execute at once.

Single-Line Commands

Command Action
D Delete line
Dn Delete n lines (e.g. D5 deletes 5)
I Insert blank line after
In Insert n blank lines
R Repeat line
Rn Repeat line n times
C Copy line to clipboard
Cn Copy n lines to clipboard
M Move line (cut to clipboard)
Mn Move n lines
A Paste clipboard after this line
B Paste clipboard before this line

Block Commands

Type the command on the first line of the block, then again on the last line.

Command Action
DD Delete block
CC Copy block to clipboard
MM Move block (cut to clipboard)
RR Repeat block (insert a copy below)

Use A or B on a third line to place the clipboard after copying or moving.

Example — move lines 3–6 to after line 10:

  1. Tab to line 3 prefix → type MM
  2. Arrow down to line 6 → type MM
  3. Arrow down to line 10 → type A
  4. Press Enter

Prefix Mode Controls

Key Action
Enter Execute all staged prefix commands
Escape Cancel all staged commands and exit prefix mode
↑ / ↓ Move between lines (keeps staged commands)

Command Line

Press = or F6 to open the command line, then type a command and press Enter.

File Commands

Command Action
SAVE Save file
FILE Save and exit
CANCEL or QUIT Exit without saving

Find and Change

FIND "text"
CHANGE "old" "new"
CHANGE "old" "new" ALL
CHANGE "old" "new" ALL .labelA .labelB
  • FIND — locate next occurrence (case-insensitive by default)
  • CHANGE — replace next occurrence
  • CHANGE ... ALL — replace all occurrences in file
  • CHANGE ... ALL .A .B — replace all occurrences between labeled lines

Labels

Type .A, .B etc. in the prefix column to assign a label to a line. Labels are used to define ranges for CHANGE ... ALL .A .B.

Function Keys

Key Action
F3 Save and exit
F5 Save without exiting
F6 Open command line
F12 Exit without saving

Contributing

notispf is designed to be easy to extend. Adding a new prefix command takes three steps:

  1. Write a handler function in notispf/commands/line_cmds.py:
def cmd_trim(buffer: Buffer, line_idx: int, count: int) -> EditorResult:
    for i in range(line_idx, min(line_idx + count, len(buffer))):
        buffer.replace_line(i, buffer.lines[i].text.rstrip())
    return EditorResult(success=True)
  1. Register it in the same file's register() function:
registry.register_line_cmd(CommandSpec("T", cmd_trim, description="Trim trailing whitespace"))
  1. Add tests in tests/test_line_cmds.py.

That's it — no changes to the prefix state machine, display, or app controller needed.

See ARCHITECTURE.md for a deeper overview of the codebase.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notispf-1.0.0.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notispf-1.0.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file notispf-1.0.0.tar.gz.

File metadata

  • Download URL: notispf-1.0.0.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for notispf-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1c56df1418f89ca54832eb3052feb5cbe0dc78b4f93b2dde83982d6304e2d46f
MD5 c1a9067e43cce2359d9ab7d0adac3aa5
BLAKE2b-256 22b9ad6430677d4b87b972df572e7009a96de1b09615197317aab11c6d02d689

See more details on using hashes here.

File details

Details for the file notispf-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: notispf-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for notispf-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9acef1fc603f212fc6c7a28d75e6819c44bc21ff824340d71bb13b31cfd8f58a
MD5 8b44e4e0be905569f70472a5159e05bf
BLAKE2b-256 84630f1a8c8a09a606e4bb936676efdc6c46df27fb45ebf0a34dd4f4f2da2c39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page