⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jove.2

📁 早期freebsd实现
💻 2
📖 第 1 页 / 共 3 页
字号:
.LPThe basic unit of stored data is the file.Each program,each paper,lives usually in its own file.To edit a program or paper,the editor must be told the name of the file that contains it.This is called \fIvisiting\fP a file.To make your changes to the file permanent on disk,you must \fIsave\fP the file..NH 2Visiting Files.XS \n(PN 5n\*(SN Visiting Files.XE.LP.IP "C-X C-V" 15nVisit a file..IP "C-X C-R" 15nSame as C-X C-V..IP "C-X C-S" 15nSave the visited file..IP "ESC ~" 15nTell \s-2JOVE\s0 to forget that the buffer has been changed..LP.LP\fIVisiting\fP a file means copying its contents into \s-2JOVE\s0 where youcan edit them.\s-2JOVE\s0 remembers the name of the file you visited.Unless you use the multiple buffer feature of \s-2JOVE\s0,you can only be visiting one file at a time.The name of the current selected buffer is visible in the mode line..LPThe changes you make with \s-2JOVE\s0 are made in a copy inside \s-2JOVE\s0.The file itself is not changed.The changed text is not permanent until you \fIsave\fP it in a file.The first time you change the text,an asterisk appears at the end of the mode line; this indicates that the textcontains fresh changes which will be lost unless you save them..LPTo visit a file,use the command C-X C-V.Follow the command with the name of the file you wish to visit,terminated by a Return.You can abort the command by typing C-G,or edit the filename with many of the standard \s-2JOVE\s0 commands(e.g., C-A, C-E, C-F, ESC F, ESC Rubout).If the filename you wish to visit is similar to the filename in themode line (the default filename),you can type C-R to insert the default and then edit it.If you do type a Return to finish the command,the new file's text appears on the screen,and its name appears in the mode line.In addition,its name becomes the new default filename..LPIf you wish to save the file and make your changes permanent,type C-X C-S.After the save is finished,C-X C-S prints the filename and thenumber of characters and lines that it wrote to the file.If there are no changes to save (no asterisk at the end of the mode line),the file is not saved;otherwise the changes saved and the asterisk at the end ofthe mode line will disappear..LPWhat if you want to create a file?  Just visit it.\s-2JOVE\s0 prints\fI(New file)\fP but aside from that behaves as if you had visited an existingempty file.If you make any changes and save them,the file is created.If you visit a nonexistent file unintentionally(because you typed the wrong filename),go ahead and visit the file you meant.If you don't save the unwanted file,it is not created..LPIf you alter one file and then visit another in the same buffer,\s-2JOVE\s0 offers to save the old one.If you answer YES,the old file is saved;if you answer NO,all the changes you have made to it since the last save are lost.You should not type ahead after a file visitingcommand,because your type-ahead might answer an unexpected questionin a way that you would regret..LPSometimes you will change a buffer by accident.Even if you undo the effect of the change by editing,\s-2JOVE\s0 still knows that "the buffer has been changed".You can tell \s-2JOVE\s0 to pretend that there have been no changes with theESC \s+2~\s0 command (\fImake-buffer-unmodified\fP).This command simply clears the "modified" flag whichsays that the buffer contains changes which need to be saved.Even ifthe buffer really \fIis\fP changed \s-2JOVE\s0 will still act as if it were not..LPIf \s-2JOVE\s0 is about to save a file and sees that the date of the versionon disk does not match what \s-2JOVE\s0 last read or wrote,\s-2JOVE\s0 notifies you of this fact,and asks what to do, because this probably means that something is wrong.For example,somebody else may have been editing the same file.If this is so,there is a good chance that your workor his work will be lost if you don't take the proper steps.You should first find out exactly what is going on.If you determine that somebody else has modified the file,save your file under a different filename and then DIFF the two filesto merge the two sets of changes.  (The "patch" command is useful forapplying the results of context diffs directly).Also get in touch with the other person so that the files don't divergeany further..NH 2How to Undo Drastic Changes to a File.XS \n(PN 5n\*(SN How to Undo Drastic Changes to a File.XE.LPIf you have made several extensive changes to a file and then changeyour mind about them,and you haven't yet saved them,you can get rid of them by reading in the previous version of the file.You can do this with the C-X C-V command,to visit the unsaved version of the file..NH 2Recovering from system/editor crashes.XS \n(PN 5n\*(SN Recovering from system/editor crashes.XE.LPJOVE does not have \fIAuto Save\fP mode, but it does provide a way torecover your work in the event of a system or editor crash.  JOVE savesinformation about the files you're editing every so many changes to abuffer to make recovery possible.  Since a relatively small amount ofinformation is involved it's hardly even noticeable when JOVE does this.  Thevariable "sync-frequency" says how often to save the necessaryinformation, and the default is every 50 changes.  50 is a veryreasonable number: if you are writing a paper you will not lose more thanthe last 50 characters you typed, which is less than the average lengthof a line..NH 2Miscellaneous File Operations.XS \n(PN 5n\*(SN Miscellaneous File Operations.XE.LP.LPESC X \fIwrite-file\fP <file><return> writes the contents of the bufferinto the file <file>,and then visits that file.It can be thought of as a way of "changing the name" ofthe file you are visiting.Unlike C-X C-S,\fIwrite-file\fP saves even if the buffer has not been changed.C-X C-W is another way of getting this command..LPESC X \fIinsert-file\fP <file><return> inserts the contents of <file> into thebuffer at point,leaving point unchanged before the contents.You can also use C-X C-I to get this command..LPESC X \fIwrite-region\fP <file><return> writes the region (the text betweenpoint and mark) to the specified file.It does not set the visited filename.The buffer is not changed..LPESC X \fIappend-region\fP <file><return> appends the region to <file>.The text is added to the end of <file>..NH 1Using Multiple Buffers.XS \n(PN\*(SN Using Multiple Buffers.XE.LPWhen we speak of "the buffer",which contains the text you are editing,we have given the impression that there is only one.In fact,there may be many of them,each with its own body of text.At any time only one buffer can be \fIselected\fP and available for editing,but it isn't hard to switch to a different one.Each buffer individually remembers which file it is visiting,what modes are in effect,and whether there are any changes that need saving..IP "C-X B" 15nSelect or create a buffer..IP "C-X C-F" 15nVisit a file in its own buffer..IP "C-X C-B" 15nList the existing buffers..IP "C-X K" 15nKill a buffer..LPEach buffer in \s-2JOVE\s0 has a single name,which normally doesn't change.A buffer's name can be any length.The name of the currently selected bufferand the name of the file visited in itare visible in the mode line when you are at top level.A newly started \s-2JOVE\s0 has only one buffer,named \fBMain\fP, unless you specified files to edit in theshell command that started \s-2JOVE\s0..NH 2Creating and Selecting Buffers.XS \n(PN 5n\*(SN Creating and Selecting Buffers.XE.LPTo create a new buffer,you need only think of a name for it (say, FOO)and then do C-X B FOO<return>,which is the command C-X B (\fIselect-buffer\fP) followed by the name.This makes a new,empty buffer (if one by that name didn't previously exist) and selects it for editing.The new buffer is not visiting any file,so if you try to save it you will be asked for the filename to use.Each buffer has its own major mode;the new buffer's major mode is \fIText\fP mode by default..LPTo return to buffer FOO later after having switched to another,the same command C-X B FOO<return> is used,since C-X B can tell whether a buffer named FOO exists already or not.C-X B Main<return> reselects the buffer Main that \s-2JOVE\s0 started out with.Just C-X B<return> reselects the previous buffer.Repeated C-X B<return>'s alternate between the last two buffers selected..LPYou can also read a file into its own newly created buffer,all with one command: C-X C-F (\fIfind-file\fP),followed by the filename.The name of the buffer is the last element of the file's pathname.C-F stands for "Find",because if the specified file already resides in a buffer in your \s-2JOVE\s0,that buffer is reselected.So you need not remember whether you have brought the file in already or not.A buffer created by C-X C-F can be reselected later with C-X B or C-X C-F,whichever you find more convenient.Nonexistent files can be created with C-X C-F just as they can with C-X C-V..NH 2Using Existing Buffers.XS \n(PN 5n\*(SN Using Existing Buffers.XE.LPTo get a list of all the buffers that exist,do C-X C-B (\fIlist-buffers\fP).Each buffer's type,name,and visited filename is printed.An asterisk before the buffer name indicates abuffer which contains changes that have not been saved. The numberthat appears at the beginning of a line in a C-X C-B listing is thatbuffer's \fIbuffer number\fP.You can select a buffer by typing its number in place of its name.If a buffer with that number doesn't already exist,a new buffer is created with that number as its name..LPIf several buffers have modified text in them,you should save some of them with C-X C-M (\fIwrite-modified-files\fP).This finds all the buffers that need saving and then saves them.Saving the buffers this way is mucheasier and more efficient (but more dangerous)than selecting each one and typing C-X C-S.If you give C-X C-M an argument, \s-2JOVE\s0 will ask for confirmationbefore saving each buffer..LPESC X \fIrename-buffer\fP <new name><return> changes the name of the currentlyselected buffer..LPESC X \fIerase-buffer\fP <buffer name><return> erases the contents of the<buffer name> without deleting the buffer entirely..NH 2Killing Buffers.XS \n(PN 5n\*(SN Killing Buffers.XE.LPAfter you use a \s-2JOVE\s0 for a while,it may fill up with buffers which you no longer need.Eventually you can reach a point where trying tocreate any more results in an "out of memory" or "out of lines"error.When this happens you will want to kill some buffers with theC-X K (\fIdelete-buffer\fP) command.You can kill the buffer FOO by doing C-X K FOO<return>.If you type C-X K <return> JOVE will kill the previously selected buffer.If you try to kill a buffer that needs saving \s-2JOVE\s0will ask you to confirm it..LPIf you need to kill several buffers, use the command \fIkill-some-buffers\fP.This prompts you with the name of each buffer and asks for confirmationbefore killing that buffer..NH 1Controlling the Display.XS \n(PN\*(SN Controlling the Display.XE.LPSince only part of a large file will fit on the screen,\s-2JOVE\s0 tries to show the part that is likely to be interesting.The display control commands allow you to see a different part of the file..IP "C-L" 15nReposition point at a specified vertical position,OR clear and redraw the screen with point in the same place..IP "C-V" 15nScroll forwards (a screen or a few lines)..IP "ESC V" 15nScroll backwards..IP "C-Z" 15nScroll forward some lines..IP "ESC Z" 15nScroll backwards some lines..LP.LPThe terminal screen is rarely large enough to display all of yourfile.If the whole buffer doesn't fit on the screen,\s-2JOVE\s0 shows a contiguous portion of it,containing .I point.It continues to show approximately the same portionuntil point moves outside of what is displayed;then \s-2JOVE\s0 chooses a new portion centered around the new .I point.This is \s-2JOVE\s0's guess as to what you are most interested in seeing,but if the guess is wrong,you can use the display control commands to see a different portion.The available screen area through which you can see part ofthe buffer is called \fIthe window\fP,and the choice of where in thebuffer to start displaying is also called \fIthe window\fP.  (When there is only one window, it plus the mode line and the input line takeup the whole screen)..LPFirst we describe how \s-2JOVE\s0 chooses a new window position on its own.The goal is usually to place .I point half way down the window.This is controlled by the variable \fIscroll-step\fP,whose value is the number oflines above the bottom or below the top of the window that the linecontaining point is placed.A value of 0 (the initial value) means center .I pointin the window..LPThe basic display control command is C-L (\fIredraw-display\fP).In its simplest form,with no argument,it tells \s-2JOVE\s0 to choose a new window position,centering point half way from the top as usual..LPC-L with a positive argument chooses a new window so as to put pointthat many lines from the top.An argument of zero puts point on the very top line.Point does not move with respect to the text; rather,the text and point move rigidly on the screen..LPIf point stays on the same line,the window is first cleared and then redrawn.Thus,two C-L's in a row are guaranteed to clear the current window.ESC C-L will clear and redraw the entire screen..LPThe \fIscrolling\fP commands C-V,ESC V,C-Z,and ESC Z,let you move the whole display up or down a few lines.C-V (\fInext-page\fP) with anargument shows you that many more lines at the bottom of the screen,moving the text and point up together as C-L might.C-V with anegative argument shows you more lines at the top of the screen,as does ESC V (\fIprevious-page\fP) with a positive argument..LPTo read the buffer a window at a time,use the C-V command with no argument.It takes the last line at the bottom of the window and putsit at the top,followed by nearly a whole window of lines not visible before.Point is put at the top of the window.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -