Limpet (LIne ManiPulator and Editor of Text) 1.03.1 by Grekim Jennings Limpet is a text editor that can work in the command terminal or TTY interface so that the x-windows or other GUI based system is not needed. It has been particularly designed for data entry since you are able to lock to a constant position and repeatedly alter a data value. IMPORTANT 1: This program is not intended for processing text documents such as literature or papers which typically lack many new-line characters. For example, a new-line character is typically found only at the end of a paragraph. When these documents are loaded, data beyond the default of 255 characters per line will be broken up into 255 character line blocks. Such breaks (new lines) may occur in the middle of a word or sentence. IMPORTANT 2: This program is not well untested on documents created outside of Linux or BSD. Features: --------- X11 windows system is optional. Compatibility with any terminal or tty interface. A self-contained program with no dependencies except the C library only. User defined key mapping of over 30 functions. Saves in plain text. Code is under 1500 lines and easily maintained. A fast running binary that is under 40 kB. Low resource use, using approximately 10 MB of RAM. Has most standard editing features (see below). A command can be launced directly from the interface. Limitations: ------------ No mouse support. No automatic word wrapping. Edits are not typed directly into the buffer. Undo is limited to the last operation only. No copying or pasting multiple lines at once. No copying data between files. No printing directly from the program. No font or style setting. The file size limit 32,767 lines (by default). The line limit is 255 characters (by default). No syntax highlighting. General Operation: ------------------ At the top of the display it might say Editing 3:1, for example. This means that the text that you type will be entered at this position, which in this case is line 3, character position 1. The text that is entered will replace the text that is there. The insert-text function will shift existing text to make room for any new text. The active line will be shown with brackets around it, such as [7]. The display will shift to from left to right to display the active character position. When the program starts it will look for a file called .limpet_rc in the local directory. If it is not found, one will be created. This file contains the keymap for all the commands. When it is created, it will be filled with the default key assignments as described below. To change the mapping, you simply edit this file with Limpet or another editor and restart Limpet. The help menu will verify how the keymap has been read into the program. An existing filename can be loaded as command argument. For example, Limpet document1.txt It will also load the filename into the save name buffer so that you can quickly save to this file. 'S' will save without checking if the file already exists. But, 's' will prompt you for a new filename if the file already exists. Commands are just one letter entries and there are no control or alt keys used. If you need to enter one letter such as to fix a spelling error and the letter is also a command letter, you need to preceed the letter with the exclamation point. Such as !c. By default, the command to quit is 'q', but you will need to enter 'q' again to really quit. Setting Memory: -------------- Beginning in version 1.03.1, the user is able to define how much memory the program uses and how it will be allocated. This is very important for solving the problem of long lines being split as the program loads in a file. Also, the program will run slightly faster with smaller numbers of characters per line. And of course, less memory will be used if your reduce the number of lines. Memory is only changeable in the limpet_rc file and is fixed while the program is running. The memory for useable characters per line is set to 255 by default. This can be changed in the .limpet_rc file. An extra character is always automatically reserved for the new line character. By setting the parameter called 'max_char' in the .limpet_rc file you can set the characters per line. It is a good idea to set max_char to a power of 2 and then subtract 1. Examples are 63, 127, 255, 511, 1023, 2047, 4095, 8191, etc The number of lines is 32,767 by default, but can be adjusted in the limpet_rc file with the parameter called 'max_lines'. Launching Commands: ------------------ Beginning in version 1.02 you can launch an application or other system command from within Limpet. First, you need to set the command. This can be done while the program is running by entering "+" or by editing the .limpet_rc file before running Limpet (see below). Once the command has been set, entering the "=" key will run the command. The buffer in memory is automatically saved before the command is executed so that any application that is launched will read the updated text file. If you have not set the Limpet file name, you will be prompted to do so before the actual command can launch. Commands: --------- To see this list while the program is running enter 'h' Navigation: ',' to move up a line '.' to move down a line '<' to move back a page. Moves active line up by page length setting. '>' to move forward a page. Moves active line down by page length setting. 'p' to set page length. Sets the amount of lines to display per page. 'g' to go to a line number 'G' to go a position in a line 'L' to lock/unlock line switching 'b' to move back a space 'n' to move forward a space 'l' to move to the beginning of a line 'e' to move to the end of a line 'a' to move to an anchored character position 'A' to set the anchored position Editing: 'd' to clear a line. Data is erased in the active line. No lines are moved. 'D' to delete a line. The line is removed and later lines are moved up. 't' to trim end of line. Data is removed from the current position to the end of the line. 'T' to trim and send extra to next line. Data after the current position is sent to the start of the next line. 'w' to wedge (insert) a line. A blank line is added and later lines are moved down. 'j' to jump to a string in the line. 'J' to jump to the string on current or later lines 'i' to insert text. Text at a later position in the line is shifted downstream. 'x' to cut text. The entered number of characters is removed and data sifted upstream. 'c' to copy text. The entered number of characters is copied to memory for 'v' and 'shift-v' use. 'C' to copy a line. A whole line is copied. You are asked for a destination. 'v' to paste copied text by overwriting 'V' to paste copied text by inserting it 'm' to move a line. You are asked for a destination. The source line is cleared. 'z' to undo an edit File: File names can be entered as the 1st run argument 'O' to open a file. The current buffer in memory will be deleted. 's' to save a file with a new name prompt 'S' to save a file using the existing name Other: '!' followed by a command letter enters the letter and not the command. This is necessary when doing a single letter edit that is also one of the commands. '#' to toggle line numbers on/off 'h' to view help menu '=' to launch a command '+' to enter the command to be launched 'q' to quit Setting Parameters in RC File: ----------------------------- Beginning in version 1.02 you can set several other parameters other than the keymap in the .limpet_rc file. You can add the following lines to an existing rc file or they will be added when a new rc is created. anchor_position=0 lines_per_page=8 show_numbers=on launch_command= show_numbers can be set to the values of on or off. The launch command can be left blank until needed.