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

📄 vip.texinfo

📁 早期freebsd实现
💻 TEXINFO
📖 第 1 页 / 共 5 页
字号:
@itemx C-x C-i@kindex 1302 @kbd{X I} (@code{insert-file})Insert specified file at point.@end table@node Misc Commands, Vi Commands, File Commands, Differences from Vi@subsection Miscellaneous Commands@table @kbd@item X (@itemx C-x (@kindex 1301 @kbd{X (} (@code{start-kbd-macro})Start remembering keyboard macro.@item X )@itemx C-x )@kindex 1301 @kbd{X )} (@code{end-kbd-macro})Finish remembering keyboard macro.@item *@kindex 052 @kbd{*} (@code{vip-call-last-kbd-macro})Call last remembered keyboard macro.@item X Z@itemx C-x C-z@kindex 1302 @kbd{X Z} (@code{suspend-emacs})Suspend Emacs.@item Z ZExit Emacs.@itemx QQuery replace.@itemx RReplace.@end table@node Vi Commands, Numeric Arguments, Misc Commands, Top@chapter Vi CommandsThis chapter describes Vi commands other than Ex commands implemented inVIP.  Except for the last section which discusses insert mode, all thecommands described in this chapter are to be used in vi mode.@menu* Numeric Arguments::	Many commands accept numeric arguments* Important Keys::	Some very important keys.* Buffers and Windows::	Commands for handling buffers and windows.* Files::		Commands for handling files.* Viewing the Buffer::	How you can view the current buffer.* Mark Commands::	Marking positions in a buffer.* Motion Commands::	Commands for moving point.* Modifying Commands::	Commands for modifying the buffer.@end menu@node Numeric Arguments, Important Keys, Vi Commands, Vi Commands@section Numeric Arguments@cindex numeric arguments@cindex count@kindex 061 @kbd{1} (numeric argument)@kindex 062 @kbd{2} (numeric argument)@kindex 063 @kbd{3} (numeric argument)@kindex 064 @kbd{4} (numeric argument)@kindex 065 @kbd{5} (numeric argument)@kindex 066 @kbd{6} (numeric argument)@kindex 067 @kbd{7} (numeric argument)@kindex 068 @kbd{8} (numeric argument)@kindex 069 @kbd{9} (numeric argument)Most Vi commands accept a @dfn{numeric argument} which can be supplied asa prefix to the commands.  A numeric argument is also called a @dfn{count}.In many cases, if a count is given, the command is executed that many times.For instance, @kbd{5 d d} deletes 5 lines while simple @kbd{d d} deletes aline.  In this manual the metavariable @var{n} will denote a count.@refill@node Important Keys, Buffers and Windows, Numeric Arguments, Vi Commands@section Important KeysThe keys @kbd{C-g} and @kbd{C-l} are unique in that their associatedfunctions are the same in any of emacs, vi and insert mode.@table @kbd@item C-g@kindex 007 @kbd{C-g} (@code{vip-keyboard-quit})Quit.  Cancel running or partially typed command (@code{keyboard-quit}).@item C-l@kindex 014 @kbd{C-l} (@code{recenter})Clear the screen and reprint everything (@code{recenter}).@end tableIn Emacs many commands are bound to the key strokes that start with@kbd{C-x}, @kbd{C-c} and @key{ESC}.  These commands can beaccessed from vi mode as easily as from emacs mode.@refill@table @kbd@item C-x@itemx C-c@itemx @key{ESC}@kindex 003 @kbd{C-c} (@code{vip-ctl-c})@kindex 0300 @kbd{C-x} (@code{vip-ctl-x})@kindex 033 @kbd{ESC} (@code{vip-ESC})Typing one of these keys have the same effect as typing it in emacs mode.Appropriate command will be executed according as the keys you type afterit.  You will be in vi mode again after the execution of the command.For instance, if you type @kbd{@key{ESC} <} (in vi mode) then the cursor willmove to the beginning of the buffer and you will still be in vi mode.@item C@itemx X@kindex 103 @kbd{C} (@code{vip-ctl-c-equivalent})@kindex 1300 @kbd{X} (@code{vip-ctl-x-equivalent})Typing one of these keys have the effect of typing the correspondingcontrol character in emacs mode.  Moreover, if you type an upper casecharacter following it, that character will also be translated to thecorresponding control character.  Thus typing @kbd{X W} in vi mode is thesame as typing @kbd{C-x C-w} in emacs mode.  You will be in vi mode againafter the execution of a command.@item \@kindex 134 @kbd{\} (@code{vip-escape-to-emacs})Escape to emacs mode.  Hitting the @kbd{\} key will take you to emacs mode,and you can execute a single Emacs command.  After executing theEmacs command you will be in vi mode again.  You can give a count beforetyping @kbd{\}.  Thus @kbd{5 \ +}, as well as @kbd{\ C-u 5 +}, will insert@samp{+++++} before point.@refill@end table@node Buffers and Windows, Files, Important Keys, Vi Commands@section Buffers and Windows@cindex buffer@cindex selected buffer@cindex current bufferIn Emacs the text you edit is stored in a @dfn{buffer}.See GNU Emacs Manual, for details.  There is always one @dfn{selected}buffer which is called the @dfn{current buffer}.@refill@cindex window@cindex modified (buffer)You can see the contents of buffers through @dfn{windows} created by Emacs.When you have multiple windows on the screen only one of them is selected.Each buffer has a unique name, and each window has a mode line which showsthe name of the buffer associated with the window and other informationabout the status of the buffer.  You can change the format of the modeline, but normally if you see @samp{**} at the beginning of a mode line itmeans that the buffer is @dfn{modified}.  If you write out the content ofthe buffer to a file, then the buffer will become not modified.  Also ifyou see @samp{%%} at the beginning of the mode line, it means that the fileassociated with the buffer is write protected.We have the following commands related to windows and buffers.@table @kbd@item C-n@kindex 016 @kbd{C-n} (@code{vip-next-window})Move cursor to the next-window (@code{vip-next-window}).@item X 1@kindex 1301 @kbd{X 1} (@code{delete-other-windows})Delete other windows and make the selected window fill the screen@*(@code{delete-other-windows}).@item X 2@kindex 1301 @kbd{X 2} (@code{split-window-vertically})Split current window into two windows (@code{split-window-vertically}).@item X 3@kindex 1301 @kbd{X 3} (@code{vip-buffer-in-two-windows})Show current buffer in two windows.@item s @var{buffer} @key{RET}@kindex 163 @kbd{s} (@code{vip-switch-to-buffer})Select or create a buffer named @var{buffer} (@code{vip-switch-to-buffer}).@item S @var{buffer} @key{RET}@kindex 123 @kbd{S} (@code{vip-switch-to-buffer-other-window})Similar but select a buffer named @var{buffer} in another window@*(@code{vip-switch-to-buffer-other-window}).@item K@kindex 113 @kbd{K} (@code{vip-kill-buffer})Kill the current buffer if it is not modified or if it is not associatedwith a file @*(@code{vip-kill-buffer}).@item X B@kindex 1302 @kbd{X B} (@code{list-buffers})List the existing buffers (@code{list-buffers}).@end table@cindex buffer name completionAs @dfn{buffer name completion} is provided, you have only to type ininitial substring of the buffer name which is sufficient to identify itamong names of existing buffers.  After that, if you hit @key{TAB} the restof the buffer name will be supplied by the system, and you can confirm itby @key{RET}.  The default buffer name to switch to will also be prompted,and you can select it by giving a simple @key{RET}.  See GNU Emacs Manualfor details of completion.@node Files, Viewing the Buffer, Buffers and Windows, Vi Commands@section FilesWe have the following commands related to files.  They are used to visit,save and insert files.@table @kbd@item v @var{file} @key{RET}@kindex 166 @kbd{v} (@code{vip-find-file})Visit specified file in the current window (@code{vip-find-file}).@item V @var{file} @key{RET}@kindex 126 @kbd{V} (@code{vip-find-file-other-window})Visit specified file in another window (@code{vip-find-file-other-window}).@item X S@kindex 1302 @kbd{X S} (@code{save-buffer})Save current buffer to the file associated with the buffer.  If no file isassociated with the buffer, the name of the file to write out the contentof the buffer will be asked in the minibuffer.@item X W @var{file} @key{RET}@kindex 1302 @kbd{X W} (@code{write-file})Write current buffer into a specified file.@item X I @var{file} @key{RET}@kindex 1302 @kbd{X I} (@code{insert-file})Insert a specified file at point.@item g@kindex 147 @kbd{g} (@code{vip-info-on-file})Give information on the file associated with the current buffer.  Tell youthe name of the file associated with the buffer, the line number of thecurrent point and total line numbers in the buffer.  If no file isassociated with the buffer, this fact will be indicated by the null filename @samp{""}.@end table@cindex visiting (a file)@cindex default directoryIn Emacs, you can edit a file by @dfn{visiting} it.  If you wish to visit afile in the current window, you can just type @kbd{v}.  Emacs maintains the@dfn{default directory} which is specific to each buffer.  Suppose, forinstance, that the default directory of the current buffer is@file{/usr/masahiko/lisp/}.  Then you will get the following prompt in theminibuffer.@refill@examplevisit file: /usr/masahiko/lisp/@end example@noindent@cindex file name completionIf you wish to visit, say, @file{vip.el} in this directory, then you canjust type @samp{vip.el} followed by @key{RET}.  If the file @file{vip.el}already exists in the directory, Emacs will visit that file, and if not,the file will be created.  Emacs will use the file name (@file{vip.el}, inthis case) as the name of the buffer visiting the file.  In order to makethe buffer name unique, Emacs may append @samp{<2>}, @samp{<3>} etc., tothe buffer name.  As the @dfn{file name completion} is provided here, youcan sometime save typing.  For instance, suppose there is only one file in thedefault directory whose name starts with @samp{v}, that is @samp{vip.el}.Then if you just type @kbd{v @key{TAB}} then it will be completed to@samp{vip.el}.  Thus, in this case, you just have to type @kbd{v v @key{TAB}@key{RET}} to visit @file{/usr/masahiko/lisp/vip.el}.  Continuing theexample, let us now suppose that you wished to visit the file@file{/usr/masahiko/man/vip.texinfo}.  Then to the same prompt which you getafter you typed @kbd{v}, you can enter @samp{/usr/masahiko/man/vip.texinfo} or@samp{../man/vip.texinfo} followed by @key{RET}.Use @kbd{V} instead of @kbd{v}, if you wish to visit a file in anotherwindow.You can verify which file you are editing by typing @kbd{g}.  (You can alsotype @kbd{X B} to get nformation on other buffers too.)  If you type@kbd{g} you will get an information like below in the echo area:@refill@example"/usr/masahiko/man/vip.texinfo" line 921 of 1949@end exampleAfter you edited the buffer (@samp{vip.texinfo}, in our example) for a while,you may wish to save it in a file.  If you wish to save it in the fileassociated with the buffer (@file{/usr/masahiko/man/vip.texinfo}, in thiscase), you can just say @kbd{X S}.  If you wish to save it in another file,you can type @kbd{X W}.  You will then get a similar prompt as you get for@kbd{v}, to which you can enter the file name.@refill@node Viewing the Buffer, Mark Commands, Files, Vi Commands@section Viewing the BufferIn this and next section we discuss commands for moving around in thebuffer.  These command do not change the content of the buffer.  Thefollowing commands are useful for viewing the content of the currentbuffer.@table @kbd@item @key{SPC}@itemx C-f@kindex 040 @kbd{SPC} (@code{vip-scroll})@kindex 006 @kbd{C-f} (@code{vip-scroll-back})Scroll text of current window upward almost full screen.  You can go@i{forward} in the buffer by this command (@code{vip-scroll}).@item @key{RET}@itemx C-b@kindex 015 @kbd{RET} (@code{vip-scroll-back})@kindex 002 @kbd{C-b} (@code{vip-scroll-back})Scroll text of current window downward almost full screen.  You can go@i{backward} in the buffer by this command (@code{vip-scroll-back}).@itemx C-d@kindex 004 @kbd{C-d} (@code{vip-scroll-up})Scroll text of current window upward half screen.  You can go@i{down} in the buffer by this command (@code{vip-scroll-down}).@itemx C-u@kindex 025 @kbd{C-u} (@code{vip-scroll-down})Scroll text of current window downward half screen.  You can go@i{up} in the buffer by this command (@code{vip-scroll-up}).@item C-y@kindex 031 @kbd{C-y} (@code{vip-scroll-down-one})Scroll text of current window upward by one line (@code{vip-scroll-down-one}).@item C-e@kindex 005 @kbd{C-e} (@code{vip-scroll-up-one})Scroll text of current window downward by one line (@code{vip-scroll-up-one}).@end table@noindentYou can repeat these commands by giving a count.  Thus, @kbd{2 @key{SPC}}has the same effect as @kbd{@key{SPC} @key{SPC}}.The following commands reposition point in the window.@table @kbd@item z H@itemx z @key{RET}@kindex 1723 @kbd{z H} (@code{vip-line-to-top})@kindex 1721 @kbd{z RET} (@code{vip-line-to-top})Put point on the top (@i{home}) line in the window.  So the current linebecomes the top line in the window.  Given a count @var{n}, point will beplaced in the @var{n}-th line from top (@code{vip-line-to-top}).@item z M@itemx z .@kindex 1723 @kbd{z M} (@code{vip-line-to-middle})@kindex 1722 @kbd{z .} (@code{vip-line-to-middle})Put point on the @i{middle} line in the window.  Given a count @var{n},point will be placed in the @var{n}-th line from the middle line(@code{vip-line-to-middle}).@item z L@itemx z -@kindex 1723 @kbd{z L} (@code{vip-line-to-bottom})@kindex 1722 @kbd{z -} (@code{vip-line-to-bottom})Put point on the @i{bottom} line in the window.  Given a count @var{n},point will be placed in the @var{n}-th line from bottom(@code{vip-line-to-bottom}).@item C-lCenter point in window and redisplay screen (@code{recenter}).@end table

⌨️ 快捷键说明

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