newcsh(1)
NAME
newcsh − command line edit csh
SYNTAX
/usr/new/csh
DESCRIPTION
The /usr/new/csh command is a modified version of the command completion, filename recognition csh with new command line edit capability. /usr/new/csh has all of the functionality of the previous /usr/new/csh plus these new features. The new history modifier :v will pull a command from the history list and make it available for editing. (Example: !cp:v ). Pressing the escape key as the first character on a command line will equate to !!:v. That is, it will put you in edit mode on the prior command.
Two edit environments are supported: a vi interface and an emacs interface. The vi interface is "modal" and supports a sub-set of vi commands. The emacs interface is "mode-less" and supports a sub-set of emacs commands.
To set the editing environment that you prefer, define the shell environment variable CSHEDIT to be either "vi" or "emacs". If you do not have CSHEDIT defined, then /usr/new/csh will attempt to look up your EDITOR environment variable; and if it is set to any of: "vi", "ex", "edit", or "ed", then you will get the "vi" command interface; otherwise you will get the "emacs" command interface. If you do not have either CSHEDIT or EDITOR environment variables defined, then you get the vi command interface.
Another useful feature is scrolling through the history list. After you enter edit mode (!something:v or ESC), you may use the up-arrow and down-arrow keys to scroll up and down through the history list. You can start editing on any history list command that you choose.
Any control characters occuring in the command line are displayed as a space character while in edit mode. Additional control characters cannot be inserted. Existing control characters are preserved.
Note
If you have never used /usr/new/csh, you may wish to add "unset autologout" to your .cshrc file. Otherwise an inactive terminal will automatically be logged out after 15 minutes.
Available vi commands are:
h move left 1 char (r)
l move right 1 char (r)
0 move to start of line
$ move to end of line
w move forward 1 word (r)
b move back 1 word (r)
e move to end of word (r)
fx move forward onto char (r)
Fx move back onto char (r)
tx move forward upto char (r)
Tx move back upto char (r)
% move to matching bracket ({[]})
i insert text before cursor
I insert text at beginning of line
a append text after cursor
A append text at end of line
c change text (o)
C change to eol (c$)
<esc> end insertion
x delete char under cursor (r)
X delete char before cursor (r)
r replace a char (r)
~ change case of curr char (r)
d delete text (o)
D delete to eol (d$)
u undo last change
U undo ALL changes
. repeat last text change command (r)
p put text from prev del after cursor (r)
P put text from prev del before cursor (r)
^L,^R redraw Command line
/word search back through the history list
for a command containing the specified
"word". "word" must be delineated by
white space in the history list to be found.
Typing ESCAPE or ^C will abort this command.
n repeat last history search
<RETURN> end edit & execute cmd
^C quit; no cmd executed
(r)a repeat count is accepted
(o)works with a cursor motion object
Available emacs commands are:
^@ set mark (keyboard null)
^A move to beginning of line
^B,<- move backward a char
^C exit command line edit (do not do command)
^D delete next char (to kill buffer)
^E move to end of line
^F,-> move forward a char
^G cancel partial command
^H,DEL delete prev char (to kill buffer)
^K kill (delete) to eol (to kill buffer)
^L redraw line display
^R Search reverse for a SINGLE char
^S Search forward for a SINGLE char
^T transpose 2 chars before cursor
^Un repeat count before command (default n is 4)
^W delete between cursor & mark (to kill buffer)
^Y yank from kill buffer
CR,NL end edit & execute cmd
ESC-^C end edit & execute cmd
ESC-B move backward a word
ESC-D delete next word
ESC-F move forward a word
ESC-H delete prev word
ESC-DEL delete prev word
ESC-n repeat count before command
^X^C end edit & execute cmd
^Xu undo last change
^XU undo all changes
^X~ change case of next char
^X^Sword search back through the history list
for a command containing the specified
"word". "word" must be delineated by
white space in the history list to be found.
Typing ESCAPE or ^C will abort this command.
^X^S repeat last history search command (you must
still be in "search mode")