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

📄 repeat.txt

📁 MSYS在windows下模拟了一个类unix的终端
💻 TXT
字号:
*repeat.txt*    For Vim version 5.8.  Last change: 2000 Apr 14		  VIM REFERENCE MANUAL    by Bram MoolenaarRepeating commands					*repeating*1. Single repeats	|single-repeat|2. Multiple repeats	|multi-repeat|3. Complex repeats	|complex-repeat|==============================================================================1. Single repeats					*single-repeat*							*.*.			Repeat last change, with count replaced with [count].			Also repeat a yank command, when the 'y' flag is			included in 'cpoptions'.Simple changes can be repeated with the "." command.  Without a count, thecount of the last change is used.  If you enter a count, it will replace thelast one.  If the last change included a specification of a numbered register,the register number will be incremented.  See |undo-redo| for an example howto use this.  Note that when repeating a command that used a Visual selection,the same SIZE of area is used, see |visual-repeat|.							*@:*@:			Repeat last command-line [count] times.==============================================================================2. Multiple repeats					*multi-repeat*							*:g* *:global*:[range]g[lobal]/{pattern}/[cmd]			Execute the Ex command [cmd] (default ":p") on the			lines within [range] where {pattern} matches.:[range]g[lobal]!/{pattern}/[cmd]			Execute the Ex command [cmd] (default ":p") on the			lines within [range] where {pattern} does NOT match.							*:v* *:vglobal*:[range]v[global]/{pattern}/[cmd]			Same as :g!.The global commands work by first scanning through the [range] lines andmarking each line where a match occurs.  In a second scan the [cmd] isexecuted for each marked line with its line number prepended.  If a line ischanged or deleted its mark disappears.  The default for [range] is the wholebuffer (1,$).  Use "CTRL-C" to interrupt the command.  If an error message isgiven for a line, the command for that line is aborted and the global commandcontinues with the next matching line.To repeat a non-Ex command, you can use the ":normal" command:	:g/pat/normal {commands}Make sure that {commands} ends with a whole command, otherwise Vim will waitfor you to type the rest of the command for each match.  The screen will nothave been updated, so you don't know what you are doing.  See |:normal|.The undo/redo command will undo/redo the whole global command at once.The previous context mark will only be set once (with "''" you go back towhere the cursor was before the global command).The global command sets both the last used search pattern and the last usedsubstitute pattern (this is vi compatible).  This makes it easy to globallyreplace a string:	:g/pat/s//PAT/gThis replaces all occurrences of "pat" with "PAT".  The same can be done with:	:%s/pat/PAT/gWhich is two characters shorter!==============================================================================3. Complex repeats					*complex-repeat*							*q* *recording*q{0-9a-zA-Z"}		Record typed characters into register {0-9a-zA-Z"}			(uppercase to append).  The 'q' command is disabled			while executing a register, and it doesn't work inside			a mapping.  {Vi: no recording}q			Stops recording.  (Implementation note: The 'q' that			stops recording is not stored in the register, unless			it was the result of a mapping)  {Vi: no recording}							*@*@{0-9a-z".=*}		Execute the contents of register {0-9a-z".=*} [count]			times.  Note that register '%' (name of the current			file) and '#' (name of the alternate file) cannot be			used.  For "@=" you are prompted to enter an			expression.  The result of the expression is then			executed.  See also |@:|.  {Vi: only named registers}							*@@*@@			Repeat the previous @{0-9a-z":*} [count] times.:[addr]*{0-9a-z".=}						*:@* *:star*:[addr]@{0-9a-z".=*}	Execute the contents of register {0-9a-z".=*} as an Ex			command.  First set cursor at line [addr] (default is			current line).  When the last line in the register does			not have a <CR> it will be added automatically when			the 'e' flag is present in 'cpoptions'.			Note that the ":*" command is only recognized when the			'*' flag is present in 'cpoptions'.  This is NOT the			default when 'nocompatible' is used.			For ":@=" the last used expression is used.  The			result of evaluating the expression is executed as an			Ex command.			Mappings are not recognized in these commands.			{Vi: only in some versions} Future: Will execute the			register for each line in the address range.							*:@:*:[addr]@:		Repeat last command-line.  First set cursor at line			[addr] (default is current line).  {not in Vi}							*:@@*:[addr]@@		Repeat the previous :@{0-9a-z"}.  First set cursor at			line [addr] (default is current line).  {Vi: only in			some versions}					*:so* *:source* *load-vim-script*:so[urce] {file}	Read Ex commands from {file}.:so[urce]! {file}	Read Vim commands from {file}.  {not in Vi}All commands and command sequences can be repeated by putting them in a namedregister and then executing it.  There are two ways to get the commands in theregister:- Use the record command "q".  You type the commands once, and while they are  being executed they are stored in a register.  Easy, because you can see  what you are doing.  If you make a mistake, "p"ut the register into the  file, edit the command sequence, and then delete it into the register  again.  You can continue recording by appending to the register (use an  uppercase letter).- Delete or yank the command sequence into the register.Often used command sequences can be put under a function key with the ':map'command.An alternative is to put the commands in a file, and execute them with the':source!' command.  Useful for long command sequences.  Can be combined withthe ':map' command to put complicated commands under a function key.The ':source' command reads Ex commands from a file line by line.  You willhave to type any needed keyboard input.  The ':source!' command reads from ascript file character by character, interpreting each character as if youtyped it.Example: When you give the ":!ls" command you get the |hit-return| prompt.  Ifyou ':source' a file with the line "!ls" in it, you will have to type thereturn yourself.  But if you ':source!' a file with the line ":!ls" in it, thenext characters from that file are read until a <CR> is found.  You will nothave to type <CR> yourself, unless ":!ls" was the last line in the file.It is possible to put ':source[!]' commands in the script file, so you canmake a top-down hierarchy of script files.  The ':source' command can benested as deep as the number of files that can be opened at one time (about15).  The ':source!' command can be nested up to 15 levels deep.You can use the "<sfile>" string (literally, this is not a special key) insideof the sourced file, in places where a file name is expected.  It will bereplaced by the file name of the sourced file.  For example, if you have a"other.vimrc" file in the same directory as your ".vimrc" file, you can sourceit from your ".vimrc" file with this command:>	:source <sfile>:h/other.vimrcIn script files terminal-dependent key codes are represented byterminal-independent two character codes.  This means that they can be usedin the same way on different kinds of terminals.  The first character of akey code is 0x80 or 128, shown on the screen as "~@".  The second one can befound in the list |key-notation|.  Any of these codes can also be enteredwith CTRL-V followed by the three digit decimal code.  This does NOT work forthe <t_xx> termcap codes, these can only be used in mappings.							*:source_crnl*MS-DOS, Win32 and OS/2: Files that are read with ":source" normally have<CR><NL> <EOL>s.  These always work.  If you are using a file with <NL> <EOL>s(for example, a file made on Unix), this will be recognized if 'fileformats'is not empty and the first line does not end in a <CR>.  This fails if thefirst line has something like ":map <F1> :help^M", where "^M" is a <CR>.  Ifthe first line ends in a <CR>, but following ones don't, you will get an errormessage, because the <CR> from the first lines will be lost.On other systems, Vim expects ":source"ed files to end in a <NL>.  Thesealways work.  If you are using a file with <CR><NL> <EOL>s (for example, afile made on MS-DOS), all lines will have a trailing <CR>.  This may causeproblems for some commands (e.g., mappings).  There is no automatic <EOL>detection, because it's common to start with a line that defines a mappingthat ends in a <CR>, which will confuse the automaton.							*line-continuation*Long lines in a ":source"d Ex command script file can be split by insertinga line continuation symbol "\" (backslash) at the start of the next line.There can be white space before the backslash, which is ignored.Example: the lines>	set comments=sr:/*,mb:*,el:*/,>		     \://,>		     \b:#,>		     \:%,>		     \n:>,>		     \fb:-are interpreted as if they were given in one line:>	set comments=sr:/*,mb:*,el:*/,://,b:#,:%,n:>,fb:-All leading whitespace characters in the line before a backslash are ignored.Note however that trailing whitespace in the line before it cannot beinserted freely; it depends on the position where a command is split upwhether additional whitespace is allowed or not.There is a problem with the ":append" and ":insert" commands:>   1append>   \asdf>   .The backslash is seen as a line-continuation symbol, thus this results in thecommand:>   1appendasdf>   .To avoid this, add the 'C' flag to the 'cpoptions' option:>   set cpo+=C>   1append>   \asdf>   .>   set cpo-=CRationale: Most programs work with a trailing backslash to indicate linecontinuation.  Using this in Vim would cause incompatibility with Vi.  Forexample for this Vi mapping:>	map xx  asdf\Therefore the unusual leading backslash is used. vim:tw=78:ts=8:sw=8:

⌨️ 快捷键说明

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