.\"{{{ Notes .\" This file will be included by origami.ms and is not for seperate use .\"}}} .NH 1 All Origami functions .LP This chapter lists all Origami functions with their keybind names. If you want to create a new keybinding, regard the files \fB???.keys\fP in the \fBbindings\fP directory of your Origami distribution. .\"{{{ moving around .NH 2 Moving around .sI \fBbackward-character\fP .sI \fBforward-character\fP .sI \fBprevious-line\fP .sI \fBnext-line\fP .sI \fBbeginning-of-line\fP .sI \fBend-of-line\fP .sI \fBprevious-page\fP .sI \fBnext-page\fP .\"{{{ beginning-of-fold .bI "\fBbeginning-of-fold\fP" Moves to the beginning of the entered fold. .eI .\"}}} .\"{{{ end-of-fold .bI "\fBend-of-fold\fP" Moves to the end of the entered fold. .eI .\"}}} .\"{{{ goto-line .bI "\fBgoto-line\fP" Prompts for a line number and moves cursor to this line. If needed, Origami opens closed folds to reach this line. .lC .eI .\"}}} .\"}}} .\"{{{ folding .NH 2 Folding .\"{{{ open-fold .bI "\fBopen-fold\fP" Open fold and show the contents in the context of the current level. .wA unlike TDS, you can not open file folds, just entering them is allowed. .eI .\"}}} .\"{{{ close-fold .bI "\fBclose-fold\fP" If the cursor is located within an opened fold, close this fold. .eI .\"}}} .\"{{{ enter-fold .bI "\fBenter-fold\fP" Enter the fold at the current line. Entering a filed fold saves the current file and switches to the new one. The old file and the line are stored internally. .eF "\fBenter-fold\fP" .LP Unlike TDS, using this function on normal text lines is allowed. Origami uses the string between the cursor position and the next single quote, double quote or whitespace as filename. If Origami cannot open the file, it will prompt for a filename (empty filename uses current file!). The file will be entered as if there was a filed fold for it. .fP .nB this command should be renamed `push-file', but we decided to keep the old name for historical reaons. .eI .\"}}} .\"{{{ exit-fold .bI "\fBexit-fold\fP" Exit fold. Exiting a filed fold saves it. .LP Using this function, without entering a fold, will use a list off all commandline files and edited files as surrounding fold! This fold will be handled as a directory. The cursor is moved to the line, containing the entry for the current file. .eI .\"}}} .\"{{{ unfold-fold .bI "\fBunfold-fold\fP" Remove fold at the current line \(em deletes the fold structure and inserts the contents of the fold instead. .eI .\"}}} .\"{{{ create-fold .bI "\fBcreate-fold\fP" Create fold. Use twice \(em first to indicate the top of a new fold, then to indicate its bottom. Lines to be included within the fold must not be indented less than the fold itself. Tabs are not allowed at the beginning of the folded lines if they appear before the intended indentation of the fold. Several other keys are disabled while create-fold is active. .eI .\"}}} .\"{{{ auto-header .bI "\fBauto-header\fP" When the cursor is on a closed fold this key will copy the first line enclosed by that fold to the fold line. .eI .\"}}} .\"{{{ toggle-file-fold .bI "\fBtoggle-file-fold\fP" File (create a new file) or unfile a fold. Creating a file writes the contents of the fold into a new file named by the fold comment (up to the first whitespace). Unlike TDS Origami does not create a new filename, if the chosen one is already used. It doesn't matter if you change the fold comment after filing a fold, because the filename is stored internally. Unfiling a filed fold replaces the file link with the contents of the file itself. Unlike TDS Origami doesn't remove the original file included this way. .eI .\"}}} .\"{{{ attach-file-to-fold .bI "\fBattach-file-to-fold\fP" Attach a file to a fold. This function links an existing file rather than creating a new one (and thus differs from toggle-create-file-fold). The filename is taken from the comment of the empty fold the cursor is placed on. The filename starts behind the foldmark and ends at the first whitespace. The rest of the line is ignored. After attaching files you can change the fold header because the file information is stored internally. .LP Unlike TDS, this function cannot be used to \fBdetach\fP a filed fold. .eI .\"}}} .\"}}} .\"{{{ editing .NH 2 Editing .\"{{{ delete-to-end-of-line .bI "\fBdelete-to-end-of-line\fP" Delete to end of line. There is no `undo' for this operation. .eI .\"}}} .\"{{{ delete-line .bI "\fBdelete-line\fP" Transfers the current line to the delete buffer, overwriting its old contents. .eI .\"}}} .\"{{{ undo-delete-line .bI "\fBundo-delete-line\fP" Inserts the line currently stored in the delete buffer as previous line. This can be done for exactly one line. .eI .\"}}} .\"{{{ delete-character .bI "\fBdelete-character\fP" Delete character under the cursor. If the cursor was at end of line, the next line will be appended to this line. .eI .\"}}} .\"{{{ delete-previous-character .bI "\fBdelete-previous-character\fP" Deletes the character to the left of the cursor. If the cursor was at the left margin, this line will be appended to the previous line. .eI .\"}}} .\"{{{ undo-delete-character .bI "\fBundo-delete-character\fP" Undeletes the last deleted character. This stored character is only changed by the \fBdelete-character\fP or \fBdelete-previous-character\fP commands. .eI .\"}}} .\"{{{ transpose-characters .bI "\fBtranspose-characters\fP" Transposes the character left of the cursor with the character under the cursor and moves the cursor right one character. .eI .\"}}} .\"{{{ toggle-case .bI "\fBcase-character-toggle\fP" Changes the case of the character under the cursor. .eI .\"}}} .\"{{{ newline-and-indent .bI "\fBnewline-and-indent\fP" Opens the line at cursor position and indents the right part like the left part. For fold comments, this only works at end of line. .eI .\"}}} .\"{{{ kill-line .bI "\fBkill-line\fP" Removes a line from the file and adds it to the end of the kill buffer. Note that the `kill buffer' is lost when exiting Origami, unlike TDS. .eI .\"}}} .\"{{{ copy-to-kill-buffer .bI "\fBcopy-to-kill-buffer\fP" Copies a line to the end of the kill buffer without deleting it from the file. Note that the kill buffer is lost when exiting Origami, unlike TDS. Lines containing filed folds cannot be copied to the kill buffer. .eI .\"}}} .\"{{{ insert-folded-kill-buffer .bI "\fBinsert-folded-kill-buffer\fP" Places the kill buffer before the current line as a fold with no comment. .eI .\"}}} .\"{{{ move-line .bI "\fBmove-line\fP" If the move buffer is empty, the current line is moved to the move buffer. Otherwise the move buffer is inserted before the current line. Note that the move buffer is lost when exiting Origami, unlike TDS. .eI .\"}}} .\"{{{ double-line .bI "\fBdouble-line\fP" Duplicates the current line in the file. Lines containing filed folds cannot be duplicated. .eI .\"}}} .\"}}} .\"{{{ search & replace .NH 2 Search and replace .\"{{{ search-forward .bI "\fBsearch-forward\fP" Prompts for a search string and displays its next occurence. An empty search string repeats the last search. The pattern is searched in the currently entered fold. .eI .\"}}} .\"{{{ search-reverse .bI "\fBsearch-reverse\fP" Same as \fBsearch-forward\fP, but searches backward. .eI .\"}}} .\"{{{ replace-string .bI "\fBreplace-string\fP" Asks for a search and a replace string and replaces all occurences. The replace will be done in the currently entered fold. .eI .\"}}} .\"{{{ quere-replace-string .bI "\fBquery-replace-string\fP" Same as \fBreplace-string\fP, but asks before replacing. .eI .\"}}} .\"{{{ incremental-search-forward .bI "\fBincremental-search-forward\fP" Searches the text for a string. String can be entered incrementally. \fBdelete-character-backward\fP jumps to the position where the character was added to the search string. Adding a character tries to find the new string. Aborting this command jumps to the calling position. \fBnewline-and-indent\fP ends the search. \fBprevious-line\fP, \fBprevious-character\fP, \fBincremental-search-reverse\fP and \fBsearch-reverse\fP switch the search direction to backwards and search the string. \fBnext-line\fP, \fBforward-character\fP, \fBincremental-search\fP and \fBsearch-forward\fP switch the search direction to forward and search the string. The pattern is searched in the currently entered fold. .LP Using \fBprevious-character\fP, \fBincremental-search-reverse\fP, \fBsearch-reverse\fP, \fBnext-line\fP, \fBforward-character\fP, \fBincremental-search\fP, \fBsearch-forward\fP or \fBdelete-character-backward\fP as first input inside the incremental search initialises the search pattern with the last used pattern. Using \fBincremental-search-forward\fP uses \fBgoto-line\fP to move to the old position if lines are different, so that opened folds are not closed automatically! .eI .\"}}} .\"{{{ incremental-search-backward .bI "\fBincremental-search-reverse\fP" Same as \fBincremental-search\fP, but starts with search direction backwards. .eI .\"}}} .\"}}} .\"{{{ files .NH 2 Files .\"{{{ read-file .bI "\fBread-file\fP" Reads another file for editing, saving the current one if required. If no filename is given, the current file is reread. .eF \fBread-file\fP .fP \fBread-file\fP .eI .\"}}} .\"{{{ next-file .bI "\fBnext-file\fP" Read next file given in the command line or edited before, saving the current file if required. If there is no next file, the list of commandline/edited files is used instead. .eI .\"}}} .\"{{{ previous-file .bI "\fBprevious-file\fP" Like \fBnext-file\fP, but reverse. .eI .\"}}} .\"{{{ save-file .bI "\fBsave-file\fP" Saves the current file with the current name and language. This command will only succeed if you haven't entered a fold. .nB if Origami is in view mode, the file will not be saved, even if it was changed. .eI .\"}}} .\"{{{ write-file .bI "\fBwrite-file\fP" Prompts for a filename and listing-mode. If no filename is given, the current filename will be used. Origami writes the text to a new file using the current language. If listing-mode is set, the generated file will be modified in the following way: .DS no heading \fIcomment\fP \fB{\&{\&{}\&}\&}\fP \fIcomment\fP line no \fB{\&{\&{\fP in fold headers no \fIcomment\fP \fB}\&}\&}\fP \fIcomment\fP lines .DE If listing-mode is set, the fold structure in the written file is lost. While using the language \fBInmos\fP it is impossible to set listing-mode, because the the generated files have an incompatible structure. .fP "\fBwrite-file\fP" .eI .\"}}} .\"{{{ insert-file .bI "\fBinsert-file\fP" Insert File. Prompts for a filename and imports this file into the edited file at the current position. If no filename is given, the current filename is used. .fP \fBinsert-file\fP .eI .\"}}} .\"{{{ filter-buffer .bI "\fBfilter-buffer\fP" Filters the current text. Origami prompts for the name of a filter. The current text is saved and piped through this filter. Origami tries to move the cursor back to the line on which the cursor was placed before executing this command. .sY \fBfilter-buffer\fP .eI .\"}}} .\"{{{ pipe-from-command .bI "\fBpipe-from-command\fP" Prompts for a command. The command is executed and its standard output inserted in the text at current position. .sY \fBpipe-from-command\fP .eI .\"}}} .\"{{{ pipe-to-command .bI "\fBpipe-to-command\fP" Prompts for a command. The current file will be piped to this command as standard input. .sY \fBpipe-to-command\fP .eI .\"}}} .\"}}} .\"{{{ macros .NH 2 Macros .\"{{{ define-macro .bI "\fBdefine-macro\fP" Records all keys into the keyboard macro buffer until define-macro is pressed again. Calling fix-macros is allowed during define-macro. This function cannot be executed while Origami prompts for information for another function (like \fBread-file\fP). .eI .\"}}} .\"{{{ execute-macro .bI "\fBexecute-macro\fP" Call keyboard macro. .eI .\"}}} .\"{{{ save-keyboard-macro .bI "\fBsave-keyboard-macro\fP" Asks for the number of a fix macro buffer. The contents of the keyboard macro buffer is copied to this fix macro buffer. Using \fB(deffun \&.. )\fP in keybind makes it impossible to overwrite the fix buffer. Using \fB\&(defusermacros\fP \fIx\fP\fB)\fP in your OCL source places \fIx\fP free macro buffers at places 1..\fIx\fP. .eI .\"}}} .\"{{{ execute-number-macro n .bI "\fBexecute-number-macro\fP \fIn\fP, (\fIn\fP=1,2,..)" Execute fix-macro number \fIn\fP. This command should be used to call macros defined by \fBsave-keyboard-macro\fP. All other macro buffers are used by \fB(deffun\fP \fIfoo\fP \fB(...) )\fP and \fB(keybind\fP \fIfoo\fP \fB(...) )\fP in keybind, so that using these operations has the same effect as calling the macro keysequence by their name! .eI .\"}}} .\"}}} .\"{{{ shell commands .NH 2 Shell commands .\"{{{ shell .bI "\fBshell\fP" Creates a shell according to the environment variable \fB\*(sH\fP. Exiting from this shell will return to Origami. .sY \fBshell\fP .eI .\"}}} .\"{{{ shell-command .bI "\fBshell-command\fP" Prompts for a command and starts a shell which executes it. .sY \fBshell-command\fP .eI .\"}}} .\"{{{ suspend-origami .bI "\fBsuspend-origami\fP" If your system has job control, Origami will be stopped and the calling shell is reactivated. .eI .\"}}} .\"}}} .\"{{{ arguments .KS .NH 2 Arguments .LP Like in Emacs, you can repeat each command by using an numerical argument. The first digit is given by \fBset-argument-\fP\fIdigit\fP. These functions read more digits of the argument until you type a non digit. This non digit may be a key sequence bound to a command or just a single character. It will be repeated argument times. Pressing the abort key will abort the repeated execution. \fBset-argument \fP\fIx\fP stops the definition or execution of a keyboard macro! .LP \fBset-argument-0\fP ... \fBset-argument-9\fP .LP If the argument is set to 0, the command will be executed once. .KE .\"}}} .\"{{{ special functions .NH 2 Special functions .\"{{{ quote-character .bI "\fBquote-character\fP" The next character typed in will be inserted in your text, even if it is bound to a command. .eI .\"}}} .\"{{{ redraw-display .bI "\fBredraw-display\fP" Refresh the screen. This is especially useful if the screen was messed up by messages... .eI .\"}}} .\"{{{ center-and-redraw-display .bI "\fBcenter-and-redraw-display\fP" Refresh and center screen. Like \fBredraw-display\fP, but also resets the window size. If you are working with a window environment which does not send a window changed signal, you may use this command after resizing a window. .eI .\"}}} .\"{{{ help .bI "\fBhelp\fP" Displays the helpfile $\*(hO/.origamihelp. Since there is no default file for this function, you can create your own helpfile. It may be useful for new and very complicated macros or other things you always forget. If there is no file $\*(hO/.origamihelp, Origami tries to get the referencedata from rc file. .eI .\"}}} .\"{{{ describe-bindings .bI "\fBdescribe-bindings\fP" Displays the binding information stored in $\*(hO/.origamirc. All currently recognized keyboard inputs will be printed. .eI .\"}}} .\"{{{ set-language .bI "\fBset-language\fP" Allows you to select the language for which the code is to be saved \(em ie the format in which folds are to be saved. This can be done by entering the first character of the language or by using \fBforward-character\fP, \fBbackward-character\fP. The currently used language is displayed inverse. If you choose \fBUser\fP, Origami prompts for the begin comment and end comment strings used for hiding the fold comments. Each string can be up to three characters in length. .nB if the current language is \fBInmos\fP, Origami prompts for permission, to prevent destruction of internal Inmos information. .eI .\"}}} .\"{{{ describe-fold .bI "\fBdescribe-fold\fP" Displays information on current cursorposition in file, number of entered folds in current file, indentation of currently entered fold and maybe information about the closed foldline under the cursor. The fold information is a pair of numbers. The first number describes the fold type and the second the fold contents (range 0..255). These codings have specific meanings in TDS. The OCL-variable \fB\*(oA\fP is set to: .nI .TS tab(|); l l. 256*type+contents|if type<128 -(256*(type mod 128)+contents)|otherwise .TE .eI .lC .eI .\"}}} .\"{{{ modes .\"{{{ set-file-unchanged .bI "\fBset-file-unchanged\fP" Marks the file as unchanged. .eI .\"}}} .\"{{{ edit/view .bI "\fBadd-mode-view\fP" Sets view only mode. .eI .bI "\fBdelete-mode-view\fP" Sets edit mode. .eI .\"}}} .\"{{{ insert/overwrite .bI "\fBadd-mode-overwrite\fP" Sets overwrite mode. Text input will overwrite other text. .eI .bI "\fBdelete-mode-overwrite\fP" Sets insert mode. Text input will be inserted. .eI .\"}}} .\"{{{ echo on/off .bI "\fBadd-mode-echo\fP" Incomplete keysequences are displayed under the status line. .eI .bI "\fBdelete-mode-echo\fP" Do not show unfinished keysequences. .eI .\"}}} .\"{{{ auto-save on/off .bI "\fBadd-mode-auto-save\fP" Prompts for the auto save interval. Origami will save your files periodically in auto save mode. Default time is 8 minutes. Minimum is 2 minutes and maximum is 60 minutes. .eI .bI "\fBdelete-mode-auto-save\fP" auto save is switched off. The OCL-variable \fB\*(oA\fP is set to the auto save intervall, or 0, if auto save is already switched off. .eI .\"}}} .\"{{{ status-line-off .bI "\fBstatus-line-off\fP" Displaying the status line is disabled. .eI .\"}}} .\"{{{ status-line-on .bI "\fBstatus-line-on\fP" Displaying the status line is enabled. .eI .\"}}} .\"{{{ numeric-keypad .bI "\fBnumeric-keypad\fP" Switches your keypad to numeric mode, if your terminal supports it. .eI .\"}}} .\"{{{ application-keypad .bI "\fBapplication-keypad\fP" Switches your keypad to application mode, if your terminal supports it. .eI .\"}}} .\"}}} .\"{{{ pipe-kbd-from-command .bI "\fBpipe-kbd-from-command\fP" Prompts for a command. This command will be executed and its standard output will be read as keyboard input for Origami. Using this, while another \fBpipe-kbd-from-command\fP is active will close all pipes! The general abort key stops the reading from a pipe. .sY \fBpipe-kbd-from-command\fP .eI .\"}}} .\"{{{ no-operation .bI "\fBno-operation\fP" No operation. This command can be used to explicitly disable keyboard inputs. .eI .\"}}} .\"{{{ bell .bI "\fBbell\fP" Activates the bell of your terminal. .eI .\"}}} .\"{{{ visible-bell .bI "\fBvisible-bell\fP" Activates the `visible bell' of your terminal. .eI .\"}}} .\"{{{ abort .bI "\fBabort\fP" Aborts any operation. There are several commands which can be aborted by this key. This operation can only be bound to a single key. This key will even stop a running macro, which may be useful to interrupt an endless loop. If you are anxious Origami might be doing something wrong, this key returns you to a safe state. \fBabort\fP can abort the reading of ASCII files (by simulating a \fBeof\fP) for the following commands: .\"{{{ table of commands .nI .TS tab(|); l l. Command:|condition: \fBenter-fold\fP|a filed fold \fBexit-fold\fP|a filed fold \fBfile-fold\fP|unfiling a filed fold \fBinsert-file\fP \fBfilter-buffer\fP \fBpipe-from-command\fP reading startup file|edit-file and stdin-pipe .TE .eI .\"}}} .LP For technical reasons, this doesn't work for reading files in \fBTDS\fP\-format. .eI .\"}}} .\"}}} .\"{{{ how to get out .NH 2 How to get out .\"{{{ save-and-exit-origami .bI "\fBsave-and-exit-origami\fP" Exits entered folds as needed, saves the file and exits from Origami. .nB if Origami is in view mode, the file will not be saved. .eI .\"}}} .\"{{{ exit-origami .bI "\fBexit-origami\fP" If there are unsaved changes to your file, Origami asks you if you want to leave anyway. .eI .\"}}} .\"}}}