📄 joe.1.in
字号:
arrow keys (or if they don't work for some reason), use \fB^F\fR to moveforwards (right), \fB^B\fR to move backwards (left), \fB^P\fR to move to theprevious line (up), and \fB^N\fR to move to the next line (down). The rightand left arrow keys simply move forwards or backwards one character at atime through the text: if you're at the beginning of a line andyou press left-arrow, you will end up at the end of the previous line. Theup and down arrow keys move forwards and backwards by enough characters sothat the cursor appears in the same column that it was in on the originalline.If you want to indent the text you enter, you can use the \fBTAB\fR key. This inserts a special control character which makes the characters whichfollow it begin at the next TAB STOP. TAB STOPS normally occur every 8columns, but this can be changed with the \fB^T D\fR command. PASCAL and Cprogrammers often set TAB STOPS on every 4 columns.If for some reason your terminal screen gets messed up (for example, ifyou receive a mail notice from biff), you can have the editor refresh thescreen by hitting \fB^R\fR.There are many other keys for deleting text and moving around the file. For example, hit \fB^D\fR to delete the character the cursor is on instead of deleting backwards like \fBBackspace\fR. \fB^D\fR will also delete a line-break if the cursor is at the end of a line. Type \fB^Y\fR to delete the entire line the cursor is on or \fB^J\fR to delete just from the cursor to the end of the line. Hit \fB^A\fR to move the cursor to the beginning of the line it's on. Hit \fB^E\fR to move the cursor to the end of the line. Hit \fB^U\fR or \fB^V\fR for scrolling the cursor up or down 1/2 a screen's worth. "Scrolling" means that the text on the screen moves, but the cursor stays at the same place relative to the screen. Hit \fB^K U\fR or \fB^K V\fR to move the cursor to the beginning or the end of the file. Look at the help screens in the editor to find even more delete and movement commands. If you make a mistake, you can hit \fB^_\fR to "undo" it. On most keyboardsyou hit just \fB^-\fR to get \fB^_\fR, but on some you might have to holdboth the \fBShift\fR and \fBControl\fR keys down at the same time to get it.If you "undo" too much, you can "redo" the changes back into existence byhitting \fB^^\fR (type this with just \fB^6\fR on most keyboards).If you were editing in one place within the file, and you then temporarily had to look or edit some other place within the file, you can get back to the original place by hitting \fB^K -\fR. This command actually returns you to the last place you made a change in the file. You can step through a history of places with \fB^K -\fR and \fB^K =\fR, in the same way you can step through the history of changes with the "undo" and "redo" commands. When you are done editing the file, hit \fB^K X\fR to exit the editor. Youwill be prompted for a file name if you hadn't already named the file youwere editing.When you edit a file, you actually edit only a copy of the file. So if youdecide that you don't want the changes you made to a file during aparticular edit session, you can hit \fB^C\fR to exit the editor withoutsaving them.If you edit a file and save the changes, a "backup" copy of that file is created in the current directory, with a ~ appended to the name, which contains the original version of the file. .SS Word wrap and formattingIf you type past the right edge of the screen in a C language or PASCAL file, the screen will scroll to the right to follow the cursor. If you type past the right edge of the screen in a normal file (one whose name doesn't end in .c, .h or .p), JOE will automatically wrap the last word onto the next line so that you don't have to hit \fBReturn\fR. This is called word-wrap mode. Word-wrap can be turned on or off with the \fB^T W\fR command. JOE's initialization file is usually set up so that this mode is automatically turned on for all non-program files. See the section below on the \fBjoerc\fR file to change this and other defaults. Aside for Word-wrap mode, JOE does not automatically keep paragraphs formatted like some word-processors. Instead, if you need a paragraph to be reformatted, hit \fB^K J\fR. This command "fills in" the paragraph that the cursor is in, fitting as many words in a line as is possible. A paragraph, in this case, is a block of text separated above and below by a blank line. The margins which JOE uses for paragraph formatting and word-wrap can be setwith the \fB^T L\fR and \fB^T R\fR commands. If the left margin is set toa value other than 1, then when you start typing at the beginning of a line,the cursor will immediately jump to the left margin.If you want to center a line within the margins, use the \fB^K A\fR command..SS Over-type modeSometimes it's tiresome to have to delete old text before or after you insert new text. This happens, for example, when you are changing a table and you want to maintain the column position of the right side of the table. When this occurs, you can put the editor in over-type mode with \fB^T T\fR. When the editor is in this mode, the characters you type in replace existing characters, in the way an idealized typewriter would. Also, \fBBackspace\fR simply moves left instead of deleting the character to the left, when it's not at the end or beginning of a line. Over-type mode is not the natural way of dealing with text electronically, so you should go back to insert-mode as soon as possible by typing \fB^T T\fR again. If you need to insert while you're in over-type mode, hit \fB^@\fR. Thisinserts a single SPACE into the text..SS Control and Meta charactersEach character is represented by a number. For example, the number for 'A'is 65 and the number for '1' is 49. All of the characters which younormally see have numbers in the range of 32 - 126 (this particulararbitrary assignment between characters and numbers is called the ASCIIcharacter set). The numbers outside of this range, from 0 to 255, aren'tusually displayed, but sometimes have other special meanings. The number10, for example, is used for the line-breaks. You can enter these special,non-displayed \fBcontrol characters\fR by first hitting \fB`\fR and thenhitting a character in the range \fB@ A B C ... X Y Z [ ^ ] \e _\fR to getthe number 0 - 31, and ? to get 127. For example, if you hit \fB` J\fR,you'll insert a line-break character, or if you hit \fB` I\fR, you'll inserta TAB character (which does the same thing the TAB key does). A usefulcontrol character to enter is 12 (\fB` L\fR), which causes most printers toadvance to the top of the page. You'll notice that JOE displays thischaracter as an underlined L. You can enter the characters above 127, the\fBmeta characters\fR, by first hitting \fB^\e\fR. This adds 128to the next (possibly control) character entered. JOE displays charactersabove 128 in inverse-video. Some foreign languages, which have more lettersthan English, use the meta characters for the rest of their alphabet. Youhave to put the editor in \fBASIS\fR mode (described later) to have thesepassed untranslated to the terminal..SS PromptsIf you hit \fBTAB\fR at any file name prompt, joe will attempt to completethe name you entered as much as possible. If it couldn't complete theentire name, because there are more than one possible completions, joebeeps. If you hit \fBTAB\fR again, joe list the completions. You can usethe arrow keys to move around this directory menu and press RETURN or SPACEto select an item. If you press the first letter of one of the directoryentries, it will be selected, or if more than one entry has the same firstletter, the cursor will jump between those entries. If you select asubdirectory or .., the directory name is appended to the prompt and the newdirectory is loaded into the menu. You can hit Backspace to go back to theprevious directory.Most prompts record a history of the responses you give them. You can hitup and down arrow to step through these histories.Prompts are actually single line windows with no status line, so you can useany editing command that you normally use on text within the prompts. Theprompt history is actually just other lines of the same "prompt file". Thusyou can can search backwards though the prompt history with the normal \fB^KF\fR command if you want.Since prompts are windows, you can also switch out of them with \fB^K P\fRand \fB^K N\fR..SS Where am I?Hit \fB^K SPACE\fR to have JOE report the line number, column number, andbyte number on the last line of the screen. The number associated with thecharacter the cursor is on (its ASCII code) is also shown. You can have theline number and/or column number always displayed on the status line bysetting placing the appropriate escape sequences in the status line setupstrings. Edit the joerc file for details..SS File operationsYou can hit \fB^K D\fR to save the current file (possibly under a differentname from what the file was called originally). After the file is saved,you can hit \fB^K E\fR to edit a different file.If you want to save only a selected section of the file, see the section on\fBBlocks\fR below.If you want to include another file in the file you're editing, use \fB^KR\fR to insert it..SS Temporarily suspending the editorIf you need to temporarily stop the editor and go back to the shell, hit \fB^K Z\fR. You might want to do this to stop whatever you're editing and answer an e-mail message or read this man page, for example. You have to type \fBfg\fR or \fBexit\fR (you'll be told which when you hit \fB^K Z\fR) to return to the editor. .SS Searching for textHit \fB^K F\fR to have the editor search forwards or backwards for a text fragment (\fBstring\fR) for you. You will be prompted for the text to search for. After you hit \fBReturn\fR, you are prompted to enter options. You can just hit \fBReturn\fR again to have the editor immediately search forwards for the text, or you can enter one or more of these options: .IP \fBbSearch backwards instead of forwards..IP \fBiTreat uppercase and lower case letters as the same when searching. Normallyuppercase and lowercase letters are considered to be different..IP \fBnnn(where \fBnnn\fR is a number) If you enter a number, JOE searches for the Nth occurrence of the text. This is useful for going to specific places in files structured in some regular manner. .IP \fBrReplace text. If you enter the \fBr\fR option, then you will be furtherprompted for replacement text. Each time the editor finds the search text,you will be prompted as to whether you want to replace the found search textwith the replacement text. You hit: \fBy\fR to replace the text and thenfind the next occurrence, \fBn\fR to not replace this text, but to then findthe next occurrence, \fBr\fR to replace all of the remaining occurrences ofthe search text in the remainder of the file without asking for confirmation(subject to the \fBnnn\fR option above), or \fB^C\fR to stop searching andreplacing..PPYou can hit \fB^L\fR to repeat the previous search. .SS Regular ExpressionsA number of special character sequences may be entered as search text:.IP \fB\e*This finds zero or more characters. For example, if you give \fBA\e*B\fR asthe search text, JOE will try to find an A followed by any number of charactersand then a B..IP \fB\e?This finds exactly one character. For example, if you give \fBA\e?B\fR asthe search text, JOE will find AXB, but not AB or AXXB..IP \fB\e^\ \e$These match the beginning and end of a line. For example, if you give\fB\e^test\e$\fR, then JOE with find \fBtest\fR on a line by itself..IP \fB\e<\ \e>These match the beginning and end of a word. For example, if you give\fB\e<\e*is\e*\e>\fR, then joe will find whole words which have thesub-string \fBis\fR within them..IP \fB\e[...]This matches any single character which appears within the brackets. Forexample, if \fB\e[Tt]his\fR is entered as the search string, then JOE findsboth \fBThis\fR and \fBthis\fR. Ranges of characters can be entered withinthe brackets. For example, \fB\e[A-Z]\fR finds any uppercase letter. Ifthe first character given in the brackets is \fB^\fR, then JOE tries to findany character not given in the the brackets..IP \fB\ecThis works like \fB\e*\fR, but matches a balanced C-language expression. For example, if you search for \fBmalloc(\ec)\fR, then JOE will find allfunction calls to \fBmalloc\fR, even if there was a \fB)\fR within theparenthesis..IP \fB\e+This finds zero or more of the character which immediately follows the\fB\e+\fR. For example, if you give \fB\e[ ]\e+\e[ ]\fR, where thecharacters within the brackets are both SPACE and TAB, then JOE will findwhitespace..IP \fB\e\eMatches a single \e..IP \fB\enThis finds the special end-of-line or line-break character..PPA number of special character sequences may also be given in the replacementstring:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -