Skip to content

doc22940/pad

 
 

Repository files navigation

Pad

Overview

Pad is a programmer's text editor written in Node.js. It's meant to be used in a terminal, such as iTerm2 for the Mac. It does not have a GUI. The key bindings are currently (mostly) vi-compatible.

See the NOTES file for various architecture notes, to-do list, and design ideas.

Status

The editor can show text files. Very basic vi movement and edit keys are supported. All work on the code is done with pad, so it's at least self-hosting. The editor is incredibly inefficient (e.g., it lays out all the text and redraws the whole screen with every keystroke), but this is still fast enough to not be noticed on the author's computer.

Usage

The script requires Node.js. It has been tested on Node version 0.10.22. To install, download this repo and run the "pad" script, specifying an existing file to edit:

% pad foo.js

To quit, type:

:q()

The command line is evaluated as JavaScript, so you need to add the parentheses to call the quit (q) function. To save the file, type:

:w()

Incompatibilities with vim

Differences between pad and vim:

  • The cursor can go one spot past the end of the line. This is consistent with the behavior on an empty line.
  • After escaping out of insert mode, the cursor does not back up. With vim if you insert "123" then immediately insert "abc", you get "12abc3". With pad you get "123abc".
  • ^J and ^K move the current line down and up one line.

About

Programmer's editor written in Node.js.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%