.\" Copyright (c) 1987, 1988 by Software Research Associates, Inc. .\" $Header: fep.1,v 4.8 89/01/09 11:15:41 utashiro Exp $ .\"---------------------------------------- .TH FEP 1L "5 Aug 1988" "SRA Distribution" .SH NAME fep \(em general purpose front end processor .SH SYNOPSIS \fBfep\fR [\|-\fBemacs\fR\||\|-\fBvi\fR\|] \fI\s-1UNIX\s0-command\fR .SH DESCRIPTION .I Fep is a general purpose front end processor applicable to most UNIX commands that features \fIvi\fP\|(1)- or \fIemacs\fR\|(1)-like line editing and a command history mechanism like that of \fIcsh\fR\|(1). .PP Choice of editing style is made by selecting either the emacs mode or the vi mode (named for the editors they emulate), specified either by command line option or by setting a variable interactively or in the start-up file or environment EDITMODE (see editmode variable). .PP The default key bindings are shown below for both edit modes. These can be customized using the fep-bind command. .PP .B Emacs Bindings .PP Here follow the default key bindings for the emacs mode. Each function name should be self-explanatory. The function names are defined as similarly to Gosling's emacs as possible. .sp .RS .nf .ta 1.5i ^@ mark ^A beginning-of-line ^B backward-character ^D delete-next-character ^E end-of-line ^F forward-character ^I insert-tab ^J new-line ^K kill-to-end-of-line ^L clear-screen ^M new-line ^N next-history ^P previous-history ^T previous-history ^Y yank-from-kill-buffer ^^ toggle-transparency ^X-^B show-bindings ^X-^H show-history ^X-^C terminate ^X-^D send-eof ^X-^L repaint ^X-^V view-buffer ^X-( start-script ^X-) end-script esc-b backward-word esc-B backward-word esc-d delete-next-word esc-D delete-next-word esc-f forward-word esc-F forward-word esc-h delete-previous-word esc-H delete-previous-word esc-l list-file-name esc-L list-file-name esc-esc expand-file-name esc-? help esc-_ invoke-shell esc-< search-reverse esc-> search-forward esc-p insert-previous-history esc-n insert-next-history esc-. insert-current-history .if t .sp .3v /* Bindings inherited from the tty driver */ .if t .sp .3v erase delete-previous-character kill delete-line rprnt reprint werase delete-previous-word lnext literal-next .fi .RE .sp .B Vi bindings .PP The vi mode has two sub-modes, the command mode and the text insert mode. The commands of vi are emulated as correctly as possible. Here is a list of the default key bindings of the vi mode that differ from normal vi commands. The tty driver control characters are also inherited in this mode. .sp .RS .nf n search-reverse N search-forward ^A expand-file-name ^L list-file-name ^N next-history ^P previous-history ^R reprint ^^ toggle-transparency ^X-^B show-bindings ^X-^C terminate ^X-^D send-eof ^X-^H show-history ^X-^L repaint ^X-^X expand-file-name ^X-^V view-buffer ^X-l list-file-name ^X-L list-file-name ^X-? help ^X-( start-script ^X-) end-script .fi .RE .sp .B Built-in commands .PP .I Fep has some built-in commands that are not passed to the child process but understood and processed by fep itself. These commands can be issued from the terminal or from the start-up file. .RS 3n .IP "\fBfep-bind \fIfunction-name key-binding\fR" Change key bindings. For example, to bind the function .I list-file-name to the string "^X-^X", type the following: .if t .sp 0.3v .if n .sp 1 \h'\w'MMMMM'u'fep-bind list-file-name "\\^X\\^X" .if t .sp 0.3v .if n .sp 1 .PP .nf \fBfep-alias\fP \fBfep-alias\fP \fIname\fP \fBfep-alias\fP \fIname string\fP .fi .RS The first form prints all aliases. The second form prints the alias for \fIname\fP. The last form set the alias for \fIname\fP to \fIstring\fP. .PP You can refer arguments in command line by !^, !$, !*; they stand for first, last, all arguments correspondingly. .PP To specify multiple commands in one alias, command should be separated by semicolon (;) character. For example, next description will allow you to execute \fIfep-cd\fP then pass cd command to shell when input ``cd'' command. .if t .sp .3v .if n .sp 1 \h'\w'MMMMM'u'fep-alias\ cd\ 'fep-cd !$;cd !$' .if t .sp .3v .if n .sp 1 Note: \fIFep\fP built-in functions must be defined before normal commands. .PP If you use .I fep without \fIauto-tty-fix\fP, following alias could be usefull. .if t .sp .3v .if n .sp 1 .nf \h'\w'MMMMM'u'if\ $command\ ==\ sh \h'\w'MMMMMMMMMM'u'fep-alias\ more\ "fep-command\ more" \h'\w'MMMMMMMMMM'u'fep-alias\ vi\ "fep-command\ vi" \h'\w'MMMMM'u'endif .fi .if t .sp .3v .if n .sp 1 .RE .IP "\fBfep-unalias\fP \fIlist\fP" Remove alias for each name in \fIlist\fP. .IP "\fBfep-set\fP \fIvariable = value\fR" Set a variable of \fIfep\fP to some value. .IP "\fBfep-unset\fP \fIvariable\fR" Unset a variable. .PP \fBfep-cd\fP [ \fIdirectory\fR ] .br \fBfep-chdir\fP [ \fIdirectory\fR ] .RS Change directory. It sometimes happens that a child process has changed directory, but .I fep is still in the old directory. In such a case, neither \fIlist-file-name\fR nor \fIexpand-file-name\fR will function as expected. This command allows you to change .IR fep 's current working directory (default = home directory). .RE .IP "\fBfep-pwd\fP" Print .IR fep 's current working directory. .IP "\fBfep-history\fP [ \fInumber of line\fR ]" Show the history of commands under .IR fep . .IP "\fBfep-echo\fP \fIarguments\fR" Only print the arguments. Variable names can be used prefixed by the "$" character. .IP "\fBfep-source\fP \fIfile\fR" Read the specified file and execute it. The contents of the file are not sent to sub-processes. .IP "\fBfep-save-history\fP [ \fInumber of lines to save\fR ] \fIfile\fR" Save the current history buffer in the specified file. .IP "\fBfep-read-history\fP [ \fIfile\fR ]" Read in the command history from the specified file. The default file is the value of the \fIhistory-file\fP variable. This file name is understood as a path relative to the home directory. If you want to specify the name relative to the current directory instead, prefix the path by "./". .PP .nf \fBfep-command\fP \fIcommand\fP \fBfep-!\fP \fIcommand\fP .fi .RS Execute \fIcommand\fP. .RE .IP "\fBquit-fep\fP" Kill the sub-process and exit. .PP .IP \fBfep-suspend\fP Suspend \fIfep\fP itself. In the unlikely possibility that \fIfep\fP falls into a dead-lock in which the sub-processes have stopped but \fIfep\fP is still running, use this command to escape from the situation. .PP .nf \fBfep-read-from-file\fP \fIfile\fP \fBfep-<\fP \fIfile\fP .fi .RS Read data from specified file and send them to sub-process. The sub-process will read the data from the file as if they are typed at the keyboard. .RE .PP .nf \fBfep-read-from-command\fP \fIcommand\fP \fBfep-