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

📄 jove.2

📁 早期freebsd实现
💻 2
📖 第 1 页 / 共 3 页
字号:
Thus, each C-V shows the "next page of text",except for one line of overlap to provide context.To move backward,use ESC V without an argument,which moves a whole window backwards (again with a line of overlap)..LPC-Z and ESC Z scroll one line forward and one line backward,respectively.These are convenient for moving in units of lineswithout having to type a numeric argument..NH 2Multiple Windows.XS \n(PN 5n\*(SN Multiple Windows.XE.LP\s-2JOVE\s0 allows you to split the screen into two or more \fIwindows\fP anduse them to display parts of different files,or different parts of the same file..IP "C-X 2" 15nDivide the current window into two smaller ones..IP "C-X 1" 15nDelete all windows but the current one..IP "C-X D" 15nDelete current window..IP "C-X N" 15nSwitch to the next window..IP "C-X P" 15nSwitch to the previous window..IP "C-X O" 15nSame as C-X P..IP "C-X ^" 15nMake this window bigger..IP "ESC C-V" 15nScroll the other window..LP.LPWhen using \fImultiple window\fP mode,the text portion of the screenis divided into separate parts called \fIwindows\fP,which can display different pieces of text.Each window can display different files,or parts of the same file.Only one of the windows is .I active; that isthe window which the cursor is in.Editing normally takes place in that window alone.To edit in another window,you would give a command to move the cursor to the other window,and then edit there..LPEach window displays a mode line for the buffer it's displaying.This is useful to keep track of which window corresponds with whichfile.  In addition, the mode line serves as a separator between windows.By setting the variable \fImode-line-should-standout\fP to "on" you canhave \s-2JOVE\s0 display the mode-line in reverse video (assuming yourparticular terminal has the reverse video capability)..LPThe command C-X 2 (\fIsplit-current-window\fP) enters multiple window mode.A new mode line appears across the middle of the screen,dividing the text display area into two halves.Both windows contain the same buffer and display the same position in it,namely where point was at the time you issued the command.The cursor moves to the second window..LPTo return to viewing only one window,use the command C-X 1 (\fIdelete-other-windows\fP).The current window expands to fill the whole screen,and the other windows disappear until the next C-X 2.(The buffers and their contents are unaffected by any of thewindow operations)..LPWhile there is more than one window,you can use C-X N (\fInext-window\fP) to switch to the next window,and C-X P (\fIprevious-window\fP) to switch to the previous one.If you are in the bottom window and you type C-X N,you will be placed in the top window,and the same kind of thing happens when you type C-X P in the top window,namely you will be placed in the bottom window.C-X O is the same as C-X P.It stands for "other window" because when there are only two windows,repeated use of this command will switch between the two windows..LPOften you will be editing one window while using the other just for reference.Then,the command ESC C-V (\fIpage-next-window\fP) is very useful.It scrolls the next window,as if you switched to the next window,typed C-V,and switched back,without your having to do all that.With a negative argument,ESC C-V will do an ESC V in the next window..LPWhen a window splits,both halves are approximately the same size.You can redistribute the screen space between the windows withthe C-X ^ (\fIgrow-window\fP) command.It makes the currently selected window grow one line bigger,or as many lines as is specified with a numeric argument.Use ESC X \fIshrink-window\fP to make the current window smaller..NH 2Multiple Windows and Multiple Buffers.XS \n(PN 5n\*(SN Multiple Windows and Multiple Buffers.XE.LPBuffers can be selected independently in each window.The C-X B command selects a new buffer in whichever window containsthe cursor.Other windows' buffers do not change..LPYou can view the same buffer in more than one window.Although the same buffer appears in both windows,they have different values of point,so you can move around in one window while the other windowcontinues to show the same text.Then,having found one place you wish to refer to, you can go back into theother window with C-X O or C-X P to make your changes..LPIf you have the same buffer in both windows,you must beware of trying to visit a different file in one ofthe windows with C-X C-V,because if you bring a new file into this buffer,it will replaced the old file in \fIboth\fP windows.To view different files in different windows,you must switch buffers in one of the windows first(with C-X B or C-X C-F, perhaps)..LPA convenient "combination" command for viewing something in anotherwindow is C-X 4 (\fIwindow-find\fP).With this command you can ask to see any specified buffer,file or tag in the other window.Follow the C-X 4 with either B and a buffer name,F and a filename,or T and a tag name.This switches to the other window and finds there what you specified.If you were previously in one-window mode,multiple-window mode is entered.C-X 4 B is similar to C-X 2 C-X B.C-X 4 F is similar to C-X 2 C-X C-F.C-X 4 T is similar to C-X 2 C-XT.The difference is one of efficiency,and also that C-X 4 works equally well if you are already using two windows..NH 1Processes Under \s-2JOVE\s0.XS \n(PN\*(SN Processes Under \s-2JOVE\s0.XE.LPAnother feature in \s-2JOVE\s0 is its ability to interact with.UXin a useful way.You can run other.UXcommands from \s-2JOVE\s0 and catch their output in \s-2JOVE\s0 buffers.In this chapter we will discuss the differentways to run and interact with.UXcommands..NH 2Non-interactive.UXcommands.XS \n(PN 5n\*(SN Non-interactive.XE.LPTo run a.UXcommand from \s-2JOVE\s0 just type "C-X !" followed by the nameof the command terminated with Return.For example,to get a list of all the users on the system,you do:.DS IC-X ! who<return>.DEThen \s-2JOVE\s0 picks a reasonable buffer in which the output from thecommand will be placed.E.g.,"who" uses a buffer called \fBwho\fP;"ps alx" uses \fBps\fP;and "fgrep -n foo *.c" uses \fBfgrep\fP.If \s-2JOVE\s0wants to use a buffer that already exists it first erases the old contents.If the buffer it selects holds a file,not output from a previous shell command,you must first delete that buffer with C-X K..LPOnce \s-2JOVE\s0 has picked a buffer it puts that buffer in a window so youcan see the command's output as it is running.If there is only one window \s-2JOVE\s0 will automatically make another one.Otherwise,\s-2JOVE\s0tries to pick the most convenient window which isn't the current one..LPIt's not a good idea to type anything while the command is running.There are two reasons for this:.IP (i)\s-2JOVE\s0 won't see the characters (thus won't execute them) until thecommand finishes,so you may forget what you've typed..IP (ii)Although \s-2JOVE\s0 won't know what you've typed,it .I willknow that you've typed something,and then it will try to be "smart" and not update thedisplay until it's interpreted what you've typed.But,of course,\s-2JOVE\s0 won't interpret what you type until the.UXcommand completes,so you're left with the uneasy feeling you get when youdon't know what the hell the computer is doing*..FS*This is a bug and should be fixed,but probably won't be for a while..FE.LPIf you want to interrupt the command for some reason (perhaps youmistyped it, or you changed your mind) you can type C-].Typing thisinside \s-2JOVE\s0 while a process is running is the same as typing C-C whenyou are outside \s-2JOVE\s0,namely the process stops in a hurry..LPWhen the command finishes, \s-2JOVE\s0 puts you back in the window in which you started.Then it prints a message indicating whether or not the commandcompleted successfully in its (the command's) opinion.That is,if the command had what it considers an error(or you interrupt it with C-])\s-2JOVE\s0 will print an appropriate message..NH 2Limitations of Non-Interactive Processes.XS \n(PN 5n\*(SN Limitations of Non-Interactive Processes.XE.LPThe reason these are called non-interactive processes is that youcan't type any input to them; you can't interact with them; they can'task you questions because there is no way for you to answer.For example,you can't run a command interpreter (a shell), or .I mailor .I cryptwith C-X ! because there is no way to provide it with input.Remember that \s-2JOVE\s0 (not the process in the window)is listening to your keyboard,and \s-2JOVE\s0 waits until the process dies before it looks atwhat you type..LPC-X ! is useful for running commands that do some output and then exit.For example,it's very useful to use with the C compiler tocatch compilation error messages (see Compiling C Programs),or with the \fIgrep\fP commands..NH 2Interactive Processes \(em Run a Shell in a Window.XS \n(PN 5n\*(SN Interactive Processes \(em Run a Shell in a Window.XE.LPSome versions of \s-2JOVE\s0\(dg.FS\(dg For example, the version provided with 4.3BSD..FEhave the capability of running interactiveprocesses.This is more useful than non-interactive processes forcertain types of jobs:.IP (i)You can go off and do some editing while the command is running.This is useful for commands that do sporadic output and run for fairly longperiods of time..IP (ii)Unlike non-interactive processes,you can type input to these.In addition,you can edit what you type with the power of all the \s-2JOVE\s0commands \fIbefore\fP you send the input to the process.This is a really important feature,and is especially useful for running a shell in a window..IP (iii)Because you can continue with normal editing while one of theprocesses is running,you can create a bunch of contexts and manage them(select them, delete them, or temporarily put them aside)with \s-2JOVE\s0's window and buffer mechanisms..LPAlthough we may have given an image of processes being attached to .I windows,in fact they are attached to .I buffers.Therefore,once an \fIi-process\fP is running you can select another buffer into that window,or if you wish you can delete the window altogether.If you reselect that buffer later it will be up to date.That is,even though thebuffer wasn't visible it was still receiving output from the process.You don't have to worry about missing anything when the buffer isn't visible..NH 2Advantages of Running Processes in \s-2JOVE\s0 Windows..XS \n(PN 5n\*(SN Advantages of Running Processes in \s-2JOVE\s0 Windows..XE.LPThere are several advantages to running a shell in a window.What you type isn't seen immediately by the process;instead \s-2JOVE\s0 waits untilyou type an entire line before passing it on to the process to read.This means that before you type <return>all of \s-2JOVE\s0's editingcapabilities are available for fixing errors on your input line.If you discover an error at the beginning of the line,rather than erasing the whole line and starting over,you can simply move to the error,correct it,move back and continue typing..LPAnother feature is that you have the entire history of your session ina \s-2JOVE\s0 buffer.You don't have to worry about output from a commandmoving past the top of the screen.If you missed some output you canmove back through it with ESC V and other commands.In addition,you can save yourself retyping a command (or a similar one) by sendingedited versions of previous commands, or edit the output of one commandto become a list of commands to be executed ("immediate shell scripts")..NH 2Differences between Normal and I-process Buffers.XS \n(PN 5n\*(SN Differences between Normal and I-process Buffers.XE.LP\s-2JOVE\s0 behaves differently in several ways when you are in an \fIi-process\fPbuffer.Most obviously, <return> does different thingsdepending on both your position in the buffer and on the state of the process.In the normal case,when point is at the end of the buffer,Return does what you'd expect: it inserts a line-separator and thensends the line to the process.If you are somewhere else in the buffer,possibly positioned at a previous command that you want to edit,Return will place a copy of that line(with the prompt discarded if there is one)at the end of the buffer and move you there.Then you can edit the line and type Return as in the normal case.If the process has died for some reason,Return does nothing.It doesn't even insert itself.If that happens unexpectedly,you should type ESC X \fIlist-processes\fP<return>to get a list of each process and its state.If your process died abnormally,\fIlist-processes\fP may help you figure out why..NH 2How to Run a Shell in a Window.XS \n(PN 5n\*(SN How to Run a Shell in a Window.XE.LPType ESC X \fIi-shell\fP<return> to start up a shell.As with C-X !,\s-2JOVE\s0 willcreate a buffer,called \fBshell\-1\fP,and select a window for this new buffer.But unlike C-X ! you will be left in the new window.Now,the shell process is said to be attached to \fBshell\-1\fP,and it is considered an \fIi-process\fP buffer.

⌨️ 快捷键说明

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