Transcription of tcsh Command Editor Commands - Kitebird
1 Tcsh Command Editor CommandsPaul May 1995 This document started out as part of one of the appendices to the O Reilly & Associates handbookUsingcsh & tcsh,but it quickly got too long, so it exists for the Command Editor may befound in that handbook (Chapter 7,The tcsh Command Editor ), and in theEditingsection of thetcshman-ual document provides information about the following: The names of thetcshcommand line editing Commands and what theydo. Theseare the commandsthat can be bound to keyswithbindkey. The default key Editor provides twosets of Command set is patterned after theemacsedi-tor,the other is patterned after sites, the Command Editor uses theemacsbindings bydefault, but you can select one set or the other explicitly using one of the following Commands in your /.
2 Cshrc(or /.tcshrc)file:bindkey -eSelectemacsbindingsbindkey -vSelectvibindingsSome Commands are available only in one mode or the description of a Command is marked emacsonly or vionly , it means the Command is available only in the givenediting slikely available in both (although I haven tverified this for every unmarked Command ).The default key bindings are listed at the end of this also usebindkeyto give you onlinehelp: Tofind out what bindings are actually in effect:%bindkey Toget a concise online listing of Command names:%bindkey -lComments on or corrections to this document are them to the address listed following terms are used in the Command descriptions in the next section: Thecurrent wordis the word in which the cursor is affect only the part ofthe current word immediately to the left of the cursor.
3 (That is, if the cursor is in the middle of a word,such Commands affect only that part of the current word.)Note that if the character to the left of the cursor is a space, the current word is empty. Filenamepatterncharacters are*,?,[],and{}. Thecut bufferis used by several Commands that delete text (such asdelete-word). Thetext can be putback from the cut buffer into the Command at the cursor position with theyankcommand. 1 Themarkis a position in the Command line that can be set (withset-mark- Command ). Thenwhen youmove the cursor,the area between the mark and the cursor is referred to as aregion,which can becopied or deleted withcopy-region-as-killorkill-region.
4 Theend of fileindicator causes the current shell to terminate if theignoreeofshell variable is not current shell is the login shell, this logs you Editor Command NamesThis section lists the names of the Command Editor Commands and describes what theydo. Whenyou see acommand that you think you dliketouse, you can find out what keysit sbound to by looking in the sec-tion Command Editor Default Bindings later in this the Command name doesn tappearthere, you can usebindkeyto set up your own binding for the the cursor left one the character to the left of the from the beginning of the current word to the text is savedinthe cut from the beginning of the line to the text is savedinthe cut the cursor to the beginning of the current word, or to the beginning of the previous word if thecursor is already at beginning of the current word.
5 , words aredelimited by space or punctuation; see , move the cursor to the beginning of the , move the cursor to the firstnon-whitespace character; see the character under the cursor to uppercase and move the cursor to the end of the (vionly)Change the case of the character under the cursor and move the cursor right one (vionly)Change text from the cursor position to the end of the line, replacing it with newcharacters the screen, redrawing the current prompt and Command line at the top of the is muchquicker than using theclearshell completion on the current word.
6 Usesprogrammed completions, if anyare 2 Likecomplete-word-fwd,but displays the possible completions in reverse current word is treated as a completion succes-sively replace the current word with each of the possible the list of completions isexhausted, the shell beeps and replaces the current word with the original usecomplete-word-fwdandcomplete-word-bac kto move back and forth in the list of programmedcompletions, if anyare ,but ignores programmed previous word to the cursor position, including anywhitespace between the word and the area between the mark and the cursor to the cut the character under the the character under the cursor or indicate end of file if the current line is the character under the cursor or list completions if the cursor is at the end of the the character under the cursor,list completions if the cursor is at the end of the line, or indicateend of file if the current line is the characters from the cursor to the end of the current word.
7 Deletedtext is savedinthe a repeat count is currently being collected, add the digit to the end of , enter the digitinto the Command collecting repeat count for the following are added to therepeat the next history line into the edit repeated, continues down through the history list,stopping at the end of the characters from the cursor to the end of the current word to lowercase. end of file to the the cursor to the end of the 3 Exchange the cursor (point) and mark is useful if you ve forgotten where the mark returns the cursor to its original the filename pattern to the left of the cursor,replacing it with the matching history references in the current word.
8 Historyreferences beginning with!#are not all history references in a Command line, including references beginning with!#.See variable references in the current the cursor right one characterforward-wordMove the cursor forward to the end of the current word, or to the end of the next word if the cursor isalready at the end of the current word. the twocharacters the the left of the cursor (likeGoslingemacs). backward through the history list using the current contents of the edit buffer up to the cursor asasearch string (which may be a filename pattern).
9 The Command retrievesthe previous commandbeginning with that string.(If the Command buffer is empty,all Commands match andhistory-search-backwardsimply retrievesthe previous Command likeup-history.) Ifthe first Command retrievedisnotthe one you wanted, repeathistory-search-backwarduntil you find the right you go too far,his-tory-search-fwdsearches in the other matches are not wrap around when the beginning of the history list is ,but searches forward through the history not wrap around when the end of the history list is the final word of the previous Command at the cursor anemacs-style incremental.
10 As a prompt and waits for you to type asearch you type successive characters, the Command Editor searches back through your his-tory list for Commands matching the current search string and successively copies them into the up through the Commands retrieved, or if you makeatyping mistake, delete the lastcharacter from the search string and the shell returns the previously retrievedcommand into the terminate the search and leave the current line in the edit the Command retrieved, the cursor is positioned at the end of the matching string within the com-mand.