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

📄 vip.texinfo

📁 早期freebsd实现
💻 TEXINFO
📖 第 1 页 / 共 5 页
字号:
% -*-texinfo-*-% Follow the following instructions to print the VIP manual.%% Run tex on this file:%%	tex vip.texinfo%% This creates vip.dvi and some files for cross references and% indices.  Since the manual contains key index and concept% index, it is necessary to create sorted index files for% them.  It is also necessary to edit the file vip.kys.  This% is done as follows.%%	texindex vip.ky vip.cp%	sed -e '/\\initial/ d' -e 's/{[^ ]* /{/' vip.kys > tmp%	mv tmp vip.kys%	tex vip.texinfo%% The dvi file created by the second run of tex can be used% for printing.\input texinfo@setfilename ../info/vip@settitle VIP@iftex@finalout@end iftex@titlepage@sp 10@center @titlefont{VIP}@sp 1@center A Vi Package for GNU Emacs@center (Version 3.5, September 15, 1987)@sp 2@center Masahiko Sato@sp 2@end titlepage@unnumbered DistributionCopyright @copyright{} 1987 Masahiko Sato.Permission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies.@ignorePermission is granted to process this file through Tex and print theresults, provided the printed document carries copying permissionnotice identical to this one except for the removal of this paragraph(this paragraph not being relevant to the printed manual).@end ignorePermission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that the entireresulting derived work is distributed under the terms of a permissionnotice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the same conditions as for modified versions.@ifinfo@node Top, Survey,, (DIR)VIP***VIP is a Vi emulating package written in Emacs Lisp.  VIP implements mostVi commands including Ex commands.  It is therefore hoped that this packagewill enable you to do Vi style editing under the powerful GNU Emacsenvironment.  This info file describes the usage of VIP assuming that youare fairly accustomed to Vi but not so much with Emacs.  Also we willconcentrate mainly on differences from Vi, especially features unique toVIP.It is recommended that you read nodes on survey and on customization beforeyou start using VIP.  Other nodes may be visited as needed.Comments and bug reports are welcome.  Please send messages to@code{ms@@Sail.Stanford.Edu} if you are outside of Japan and to@code{masahiko@@sato.riec.tohoku.junet} if you are in Japan.@refill@end ifinfo@menu* Survey::		A survey of VIP.* Vi Commands::		Details of Vi commands.* Ex Commands::		Details of Ex commands.* Customization::	How to customize VIP.@end menu@iftex@unnumbered IntroductionVIP is a Vi emulating package written in Emacs Lisp.  VIP implements mostVi commands including Ex commands.  It is therefore hoped that this packagewill enable you to do Vi style editing under the powerful GNU Emacsenvironment.  This manual describes the usage of VIP assuming that you arefairly accustomed to Vi but not so much with Emacs.  Also we willconcentrate mainly on differences from Vi, especially features unique toVIP.It is recommended that you read chapters on survey and on customizationbefore you start using VIP.  Other chapters may be used as futurereferences.Comments and bug reports are welcome.  Please send messages to@code{ms@@Sail.Stanford.Edu} if you are outside of Japan and to@code{masahiko@@unsun.riec.tohoku.junet} if you are in Japan.@end iftex@node Survey, Basic Concepts, Top, Top@chapter A Survey of VIPIn this chapter we describe basics of VIP with emphasis on the features notfound in Vi and on how to use VIP under GNU Emacs.@menu* Basic Concepts::	Basic concepts in Emacs.* Loading VIP::		How to load VIP automatically.* Modes in VIP::	VIP has three modes, which are orthogonal to modes			in Emacs.* Differences from Vi:: Differences of VIP from Vi is explained.@end menu@node Basic Concepts, Loading VIP, Survey, Survey@section Basic ConceptsWe begin by explaining some basic concepts of Emacs.  These concepts areexplained in more detail in the GNU Emacs Manual.@cindex buffer@cindex point@cindex mark@cindex text@cindex looking at@cindex end (of buffer)@cindex regionConceptually, a @dfn{buffer} is just a string of ASCII characters and twospecial characters @key{PNT} (@dfn{point}) and @key{MRK} (@dfn{mark}) suchthat the character @key{PNT} occurs exactly once and @key{MRK} occurs atmost once.  The @dfn{text} of a buffer is obtained by deleting theoccurrences of @key{PNT} and @key{MRK}.  If, in a buffer, there is acharacter following @key{PNT} then we say that point is @dfn{looking at}the character; otherwise we say that point is @dfn{at the end of buffer}.@key{PNT} and @key{MRK} are usedto indicate positions in a buffer and they are not part of the text of thebuffer.  If a buffer contains a @key{MRK} then the text between @key{MRK}and @key{PNT} is called the @dfn{region} of the buffer.@refill@cindex windowEmacs provides (multiple) @dfn{windows} on the screen, and you can see thecontent of a buffer through the window associated with the buffer.  Thecursor of the screen is always positioned on the character after @key{PNT}.@refill@cindex mode@cindex keymap@cindex local keymap@cindex global keymapA @dfn{keymap} is a table that records the bindings between characters andcommand functions.  There is the @dfn{global keymap} common to all thebuffers.  Each buffer has its @dfn{local keymap} that determines the@dfn{mode} of the buffer.  Local keymap overrides global keymap, so that ifa function is bound to some key in the local keymap then that function willbe executed when you type the key.  If no function is bound to a key in thelocal map, however, the function bound to the key in the global map becomesin effect.@refill@node Loading VIP, Modes in VIP, Basic Concepts, Survey@section Loading VIPThe recommended way to load VIP automatically is to include the line:@example(load "vip")@end example@noindentin your @file{.emacs} file.  The @file{.emacs} file is placed in your homedirectory and it will be executed every time you invoke Emacs.  If you wishto be in vi mode whenver Emacs starts up, you can include the followingline in your @file{.emacs} file instead of the above line:@example(setq term-setup-hook 'vip-mode)@end example@noindent(@xref{Vi Mode}, for the explanation of vi mode.)Even if your @file{.emacs} file does not contain any of the above lines,you can load VIP and enter vi mode by typing the following from withinEmacs.@exampleM-x vip-mode@end example@noindent@node Modes in VIP, Emacs Mode, Loading VIP, Survey@section Modes in VIP@kindex 032 @kbd{C-z} (@code{vip-change-mode-to-vi})@kindex 0301 @kbd{C-x C-z} (@code{suspend-emacs})Loading VIP has the effect of globally binding @kbd{C-z} (@kbd{Control-z})to the function @code{vip-change-mode-to-vi}. The default binding of @kbd{C-z}in GNU Emacs is @code{suspend-emacs}, but, you can also call@code{suspend-emacs} by typing @kbd{C-x C-z}.  Other than this, all thekey bindings of Emacs remain the same after loading VIP.@refill@cindex vi modeNow, if you hit @kbd{C-z}, the function @code{vip-change-mode-to-vi} will becalled and you will be in @dfn{vi mode}.  (Some major modes may locally bind@kbd{C-z} to some special functions.  In such cases, you can call@code{vip-change-mode-to-vi} by @code{execute-extended-command} which isinvoked by @kbd{M-x}.  Here @kbd{M-x} means @kbd{Meta-x}, and if yourterminal does not have a @key{META} key you can enter it by typing@kbd{@key{ESC} x}.  The same effect can also be achieve by typing@kbd{M-x vip-mode}.)@refill@cindex mode lineYou can observe the change of mode by looking at the @dfn{mode line}.  Forinstance, if the mode line is:@refill@example-----Emacs: *scratch*              (Lisp Interaction)----All------------@end example@noindentthen it will change to:@example-----Vi:    *scratch*              (Lisp Interaction)----All------------@end example@noindentThus the word @samp{Emacs} in the mode line will change to @samp{Vi}.@cindex insert mode@cindex emacs modeYou can go back to the original @dfn{emacs mode} by typing @kbd{C-z} invi mode.  Thus @kbd{C-z} toggles between these two modes.@refillNote that modes in VIP exist orthogonally to modes in Emacs.  This meansthat you can be in vi mode and at the same time, say, shell mode.Vi mode corresponds to Vi's command mode.  From vi mode you can enter@dfn{insert mode} (which corresponds to Vi's insert mode) by usual Vi commandkeys like @kbd{i}, @kbd{a}, @kbd{o} @dots{} etc.In insert mode, the mode line will look like this:@example-----Insert *scratch*              (Lisp Interaction)----All------------@end example@noindentYou can exit from insert mode by hitting @key{ESC} key as you do in Vi.That VIP has three modes may seem very complicated, but in fact it is notso.  VIP is implemented so that you can do most editing remaining onlyin the two modes for Vi (that is vi mode and insert mode).@ifinfoThe figure below shows the transition of three modes in VIP.@display           === C-z ==>          == i,o ... ==>emacs mode             vi mode                 insert mode           <== X-z ===          <=== ESC ====@end display@end ifinfo@menu* Emacs Mode::		This is the mode you should know better.* Vi Mode::		Vi commands are executed in this mode.* Insert Mode::		You can enter text, and also can do editing if you			know enough Emacs commands.@end menu@node Emacs Mode, Vi Mode, Modes in VIP, Modes in VIP@subsection Emacs Mode@kindex 032 @kbd{C-z} (@code{vip-change-mode-to-vi})You will be in this mode just after you loaded VIP.  You can do allnormal Emacs editing in this mode.  Note that the key @kbd{C-z} is globallybound to @code{vip-change-mode-to-vi}.  So, if you type @kbd{C-z} in this modethen you will be in vi mode.@refill@node Vi Mode, Insert Mode, Emacs Mode, Modes in VIP@subsection Vi ModeThis mode corresponds to Vi's command mode.  Most Vi commands work as theydo in Vi.  You can go back to emacs mode by typing @kbd{C-z}.  You canenter insert mode, just as in Vi, by typing @kbd{i}, @kbd{a} etc.@node Insert Mode, Differences from Vi, Vi Mode, Modes in VIP@subsection Insert ModeThe key bindings in this mode is the same as in the emacs mode except forthe following 4 keys.  So, you can move around in the buffer and changeits content while you are in insert mode.@table @kbd@item @key{ESC}@kindex 033 @kbd{ESC} (@code{vip-change-mode-to-vi}) (insert mode)This key will take you back to vi mode.@item C-h@kindex 010 @kbd{C-h} (@code{vip-delete-backward-char}) (insert mode)Delete previous character.@item C-w@kindex 027 @kbd{C-w} (@code{vip-delete-backward-word}) (insert mode)Delete previous word.@item C-z@kindex 032 @kbd{C-z} (@code{vip-ESC}) (insert mode)Typing this key has the same effect as typing @key{ESC} in emacs mode.Thus typing @kbd{C-z x} in insert mode will have the same effect as typing@kbd{ESC x} in emacs mode.@end table@node Differences from Vi, Undoing, Insert Mode, Survey@section Differences from ViThe major differences from Vi are explained below.@menu* Undoing::		You can undo more in VIP.* Changing::		Commands for changing the text.* Searching::		Search commands.* z Command::		You can now use zH, zM and zL as well as z- etc.* Counts::		Some Vi commands which do not accept a count now			accept one.* Marking::		You can now mark the current point, beginning of			the buffer etc.* Region Commands::	You can now give a region as an argument for delete

⌨️ 快捷键说明

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