Skip to content
maelswarmPublic

About

A stripped down cli text editor that features a directory navigator for quicker traversal.

Topics

Resources

Stars

30 stars

Watchers

1 watching

Forks

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

pixt

A stripped-down command-line text editor with a built-in directory browser. Find a file, preview it, and edit it without leaving the terminal.

Features

  • Directory browser: move through folders with the arrow keys.
  • File preview: see a file's contents next to the listing before you open it.
  • Editor: soft-wrapped lines, paging, and simple C syntax highlighting (types, control flow, return, numbers and function calls).
  • Small: a single C file with no dependencies. It runs on Linux and macOS.

Building

You need a C compiler and make.

git clone https://github.com/maelswarm/pixt.git
cd pixt
make

To put pixt on your PATH:

sudo make install                    # installs to /usr/local/bin
make install PREFIX="$HOME/.local"   # or installs into your home directory

make uninstall removes it and make clean deletes the build.

Usage

Run pixt from the folder you want to start in:

cd ~/projects
pixt

pixt opens in browser mode. Highlight a file with the arrow keys and press → to preview it. Then press Enter to edit it.

Key bindings

Browser mode

Key Action
↑ / ↓ Move the selection. Long folders are split into pages and the selection moves between them.
→ Open the selected folder, or preview the selected file
← Go to the parent folder
Enter Edit the file being previewed
Ctrl+N Start a new, empty file (you name it when you save)
Esc, then Enter Quit

Editor mode

Key Action
Arrow keys Move the cursor
Ctrl+Y / Ctrl+V Page up / page down
Tab Insert four spaces
Ctrl+O Save (asks for a file name)
Ctrl+X Close the editor without saving and go back to the browser
Esc, then Enter Quit pixt without saving

Saving

Ctrl+O shows a prompt at the bottom of the screen:

  • Type a file name and press Enter. A plain name is saved in the current folder. Absolute paths also work.
  • Press Enter without typing anything to save over the file you opened (its name is shown in parentheses).
  • Press Ctrl+C to cancel and go back to the editor.

After a successful save, pixt returns to the browser. If the file can't be written, the prompt says so and asks again.

Good to know

  • pixt never asks before quitting or closing the editor, so save first.
  • Tabs are shown as four spaces. On save, every run of four spaces is written as a tab, including spaces you typed.
  • Trailing spaces at the end of each line are removed when a file is opened.
  • pixt is meant for plain ASCII text. Multibyte UTF-8 characters can put the cursor out of line with the text, and binary files aren't supported.

Feature requests

To ask for a new feature, open an issue on this repository.

About

A stripped down cli text editor that features a directory navigator for quicker traversal.

Topics

Resources

Stars

30 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages