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

📄 jove.3

📁 早期freebsd实现
💻 3
字号:
.NH 1Directory Handling.XS \n(PN\*(SN Directory Handling.XE.LPTo save having to use absolute pathnames when you want to edit a nearby file\s-2JOVE\s0 allows you to move around the.UXfilesystem just as the c-shell does.These commands are:.IP "cd dir" 15nChange to the specified directory..IP "pushd [dir]"Like \fIcd\fP, but save the old directory on the directory stack.With no directory argument, simply exchange the top two directorieson the stack and \fIcd\fP to the new top..IP "popd"Take the current directory off the stack and \fIcd\fP to the directory nowat the top..IP "dirs"Display the contents of the directory stack..LPThe names and behavior of these commands were chosen to mimic those in the c-shell..NH 1Editing C Programs.XS \n(PN\*(SN Editing C Programs.XE.LPThis section details the support provided by \s-2JOVE\s0for working on C programs..NH 2Indentation Commands.XS \n(PN 5n\*(SN Indentation Commands.XE.LPTo save having to lay out C programs "by hand", \s-2JOVE\s0has an idea of the correct indentation of a line,based on the surrounding context.When you are in C Mode, \s-2JOVE\s0 treats tabs specially \(emtyping a tab at the beginning of a new line means "indent tothe right place".Closing braces are also handled specially, and are indentedto match the corresponding open brace..NH 2Parenthesis and Brace Matching.XS \n(PN 5n\*(SN Parenthesis and Brace Matching.XE.LPTo check that parentheses and braces match the way you think they do,turn on \fIShow Match\fP mode (ESC X show-match-mode).  Then, wheneveryou type a close brace or parenthesis, the cursor moves momentarily tothe matching opener, if it's currently visible.  If it's not visible,\s-2JOVE\s0 displays the line containing the matching opener on the messageline..NH 2C Tags.XS \n(PN 5n\*(SN C Tags.XE.LPOften when you are editing a C program,especially someone else's code,you see a function call and wonder what that function does.You then search for the function within the current file and if you'relucky findthe definition, finally returning to the original spot when you are done.However, if are unlucky, the function turns out to be external(defined in another file) andyou have to suspend the edit,\fIgrep\fP for the function name in every .c that might contain it,and finally visit the appropriate file..LPTo avoid this diversion or the need to remember whichfunction is defined in which file,Berkeley .UXhas a program called \fIctags(1)\fP, whichtakes a set of source files and looks for functiondefinitions, producing a file called \fItags\fP as its output..LP\s-2JOVE\s0 has a command called C-X T (\fIfind-tag\fP)that prompts you for the name of a function (a \fItag\fP), looks upthe tag reference in the previously constructed tags file, then visits the file containing that tag in a new buffer,with point positioned at the definition of the function.There is another version of this command, namely \fIfind-tag-at-point\fP,that uses the identifier at .I point..LPSo, when you've added new functions to a module, or moved some oldones around, run the \fIctags\fP program to regenerate the \fItags\fP file.\s-2JOVE\s0 looks in the file specified in the \fItag-file\fP variable.  Thedefault is "./tags", that is, the tag file in the current directory.  If youwish to use an alternate tag file, you use C-U\ C-X\ T, and \s-2JOVE\s0 willprompt for a file name.  If you find yourself specifying the same file againand again, you can set \fItag-file\fP to that file, and run\fIfind-tag\fP with no numeric argument..LPTo begin an editing session looking for a particular tag, usethe \fI\-t tag\fP command line option to \s-2JOVE\s0.For example, say you wanted to look at the file containing the tag\fISkipChar\fP, you would invoke \s-2JOVE\s0 as:.DS I.I% jove \-t SkipChar.R.DE.NH 2Compiling Your Program.XS \n(PN 5n\*(SN Compiling Your Program.XE.LPYou've typed in a program or altered an existing one and now youwant to run it through the compiler to check for errors.To save having to suspend the edit,run the compiler,scribble down error messages, and then resume the edit,\s-2JOVE\s0 allows you to compile your code while in the editor.This is done with the C-X C-E (\fIcompile-it\fP) command.If you run \fIcompile-it\fP with no argumentit runs the.UX\fImake\fPprogram into a buffer;If you need a special command or want to pass arguments to \fImake\fP,run \fIcompile-it\fP with any argument (C-U is good enough) and youwill be prompted for the command to execute..LPIf any error messages are produced, they are treated specially by \s-2JOVE\s0.That treatment is the subject of the next section..NH 2Error Message Parsing and Spelling Checking.XS \n(PN\*(SN Error Message Parsing\*(SN Spelling Checking.XE.LP\s-2JOVE\s0 knows how to interpret the error messages from many.UXcommands;In particular,the messages from \fIcc\fP,\fIgrep\fP and \fIlint\fP can be understood.After running the \fIcompile-it\fP command,the \fIparse-errors\fP command is automatically executed,and any errors found are displayed in a new buffer.The files whose names are found in parsing the error messages are eachbrought into \s-2JOVE\s0 buffers and the point is positioned at the first errorin the first file.The commands \fIcurrent-error\fP, C-X C-N (\fInext-error\fP), andC-X C-P (\fIprevious-error\fP)can be used to traverse the list of errors..LPIf you already have a file called\fIerrs\fP containing, say, c compiler messages then you can get \s-2JOVE\s0 to interpret the messages byinvoking it as:.DS I.I% jove \-p errs.R.DE.LP\s-2JOVE\s0 has a special mechanism for checking the the spelling of a document;It runs the.UXspell program into a buffer.You then delete from this buffer all those words that are not spellingerrors and then \s-2JOVE\s0 runs the \fIparse-spelling-errors\fP command toyield a list of errors just as in the last section..NH 1Simple Customization.XS \n(PN\*(SN Simple Customization.XE.LP.NH 2Major Modes.XS \n(PN 5n\*(SN Major Modes.XE.LPTo help with editing particular types of file, say a paper or a C program,\s-2JOVE\s0 has several \fImajor modes\fP.These are as follows:.NH 3Text mode.XS \n(PN 10n\*(SN Text mode.XE.LPThis is the default major mode.  Nothing special is done..NH 3C mode.XS \n(PN 10n\*(SN C mode.XE.LPThis mode affects the behavior of the tab and parentheses characters.Instead of just inserting the tab, \s-2JOVE\s0 determineswhere the text "ought" to line up for the C language and tabs to that positioninstead.  The same thing happens with the close brace and close parenthesis;they are tabbed to the "right" place and then inserted.Using the \fIauto-execute-command\fP command, you can make \s-2JOVE\s0 enter\fIC Mode\fP whenever you edit a file whose name ends in \fI.c\fP..NH 3Lisp mode.XS \n(PN 10n\*(SN Lisp mode.XE.LPThis mode is analogous to \fIC Mode\fP,but performs the indentation needed to lay out Lisp programs properly.Note also the \fIgrind-s-expr\fP command that prettyprints an\fIs-expression\fP and the \fIkill-mode-expression\fP command..NH 2Minor Modes.XS \n(PN 5n\*(SN Minor Modes.XE.LPIn addition to the major modes,\s-2JOVE\s0 has a set of minor modes.These are as follows:.NH 3Auto Indent.XS \n(PN 10n\*(SN Auto Indent.XE.LPIn this mode,\s-2JOVE\s0 indents each line the same way as that above it.  That is,the Return key in this mode acts as the Linefeed key ordinarily does..NH 3Show Match.XS \n(PN 10n\*(SN Show Match.XE.LPMove the cursor momentarily to the matching opening parenthesis when a closingparenthesis is typed..NH 3Auto Fill.XS \n(PN 10n\*(SN Auto Fill.XE.LPIn \fIAuto Fill\fP mode,a newline is automatically inserted when the line lengthexceeds the right margin.This way,you can type a whole paper without having to use the Return key..NH 3Over Write.XS \n(PN 10n\*(SN Over Write.XE.LPIn this mode,any text typed in will replace the previous contents.(The default is for new text to be inserted and "push" the old along.)This is useful for editing an already-formatted diagram in which youwant to change some things without moving other things around on thescreen..NH 3Word Abbrev.XS \n(PN 10n\*(SN Word Abbrev.XE.LPIn this mode, every word you type is compared to a list of wordabbreviations; whenever you type an abbreviation, it is replacedby the text that it abbreviates.This can save typing if a particular word or phrase must be enteredmany times.The abbreviations and their expansions are held in a file that looks like:.DS Iabbrev:phrase.DEThis file can be set up in your \fI~/.\|joverc\fP with the \fIread-word-abbrev-file\fP command.Then, whenever you are editing a buffer in \fIWord Abbrev\fP mode,\s-2JOVE\s0 checks for the abbreviations you've given.See also the commands\fIread-word-abbrev-file\fP,\fIwrite-word-abbrev-file\fP,\fIedit-word-abbrevs\fP,\fIdefine-global-word-abbrev\fP,\fIdefine-mode-word-abbrev\fP,and \fIbind-macro-to-word-abbrev\fP,and the variable \fIauto-case-abbrev\fP..NH 2Variables.XS \n(PN 5n\*(SN Variables.XE.LP\s-2JOVE\s0 can be tailored to suit your needs by changing thevalues of variables.A \s-2JOVE\s0 variable can be given a value with the \fIset\fP command,and its value displayed with the \fIprint\fP command..LPThe variables \s-2JOVE\s0 understands are listed along with the commandsin the alphabetical list at the end of this document..NH 2Key Re-binding.XS \n(PN 5n\*(SN Key Re-binding.XE.LPMany of the commands built into \s-2JOVE\s0 are not bound tospecific keys.The command handler in\s-2JOVE\s0 is used to invoke these commands and is activatedby the \fIexecute-extended-command\fP command (ESC X).When the name of a command typed in is unambiguous,that command will be executed.Since it is very slow to haveto type in the name of each command every time it is needed,\s-2JOVE\s0 makes it possible to \fIbind\fP commands to keys.When a command is\fIbound\fP to a key any future hits on that key will invoke that command.All the printing characters are initially bound to thecommand \fIself-insert\fP.Thus, typing any printing character causes it to be inserted into the text.Any of the existing commands can be bound to any key.(A \fIkey\fP may actually be a \fIcontrol character\fPor an \fIescape sequence\fP as explained previously under\fICommand Input Conventions\fP)..LPSince there are more commands than there are keys,two keys are treated as \fIprefix\fP commands.When a key bound to one of the prefix commands is typed,the next charactertyped is interpreted on the basis that it was preceded by one of theprefix keys.Initially ^X and ESC are the prefix keys andmany of the built in commands are initially bound to these "two stroke" keys.(For historical reasons, the Escape key is often referred to as "Meta")..NH 2Keyboard Macros.XS \n(PN 5n\*(SN Keyboard Macros.XE.LPAlthough \s-2JOVE\s0 has many powerful commands,you often find that you have a task that no individual command can do.\s-2JOVE\s0 allows you to define your own commands from sequencesof existing ones "by example";Such a sequence is termed a \fImacro\fP.The procedure is as follows:First you type the \fIstart-remembering\fP command,usually bound to C-X (.Next you "perform" the commands which as they are being executed arealso remembered, which will constitute the body of the macro.Then you give the \fIstop-remembering\fP command, usually bound toC-X ).You now have a \fIkeyboard macro\fP.To run this command sequence again,use the command \fIexecute-keyboard-macro\fP, usually bound toC-X E.You may find this bothersome to type and re-type,so there is a way to bind the macro to a key.First,you must give the keyboard macro a name using the\fIname-keyboard-macro\fP command.Then the binding is made with the \fIbind-macro-to-key\fP command.We're still not finished because all this hard work will be lostif you leave \s-2JOVE\s0.What you do is to save your macros into a filewith the \fIwrite-macros-to-file\fP command.To retrieve your macros in the next editing session (but not their bindings),you can simply execute the \fIsource\fP command on that file..NH 2Initialization Files.XS \n(PN 5n\*(SN Initialization Files.XE.LPUsers will likely want to modify the default key bindings to their liking.Since it would be quite annoying to have to set up the bindingseach time \s-2JOVE\s0 is started up,\s-2JOVE\s0 has the ability to read in a "startup" file.Whenever \s-2JOVE\s0 is started,it reads commands from the file \fI.\|joverc\fP in the user's home directory..LPThese commands are read asif they were typed to the command handler (ESC X) during an edit.There can be only one command per line in the startup file.Lines that start with ``#'' are comments.Lines may be indented..LPSometimes it is useful for a startup file to do different things indifferent circumstances.To make this possible, there are two conditional commands:\fIif\fP and \fIifenv\fP.The \fIif\fP command takes as an operand a shell command, which it runs.If the command succeeds, the commands after the \fIif\fP, until a linecontaining \fIelse\fP or \fIendif\fP, are performed.Otherwise, these commands are suppressed.The commands after any \fIelse\fP, up until an \fIendif\fP, are executedonly if the shell command failed.Conditionals nest in the normal way..LPThe \fIifenv\fP command takes as operands the name of an environment variableand a pattern.If the environment variable is defined and its value matches the pattern,the \fIif\fP succeeds..LPIf there is a file \fI/usr/lib/jove/joverc\fP,then this file will be read before the user's.I .\|jovercfile.This can be used to set up a system-wide default startup mode for\s-2JOVE\s0that is tailored to the needs of that system..LPThe \fIsource\fP command can be used to read commands from a specified fileat any time during an editing session,even from inside the \fI.\|joverc\fP file.This means that a macro can be used to change the key bindings,e.g., to enter a mode,by reading from a specified file which contains all the necessary bindings.

⌨️ 快捷键说明

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