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

📄 map.txt

📁 MSYS在windows下模拟了一个类unix的终端
💻 TXT
📖 第 1 页 / 共 3 页
字号:
and ^[ is <Esc>)You type:   ab esc ^V^V^V^V^V^[	All keyboard input is subjected to ^V quote interpretation, so	the first, third, and fifth ^V  characters simply allow the second,	and fourth ^Vs, and the ^[, to be entered into the command-line.You see:    ab esc ^V^V^[	The command-line contains two actual ^Vs before the ^[.  This is	how it should appear in your .exrc file, if you choose to go that	route.  The first ^V is there to quote the second ^V; the :ab	command uses ^V as its own quote character, so you can include quoted	whitespace or the | character in the abbreviation.   The :ab command	doesn't do anything special with the ^[ character, so it doesn't need	to be quoted.  (Although quoting isn't harmful; that's why typing 7	[but not 8!] ^Vs works.)Stored as:  esc     ^V^[	After parsing, the abbreviation's short form ("esc") and long form	(the two characters "^V^[") are stored in the abbreviation table.	If you give the :ab command with no arguments, this is how the	abbreviation will be displayed.	Later, when the abbreviation is expanded because the user typed in	the word "esc", the long form is subjected to the same type of	^V interpretation as keyboard input.  So the ^V protects the ^[	character from being interpreted as the "exit input-mode" character.	Instead, the ^[ is inserted into the text.Expands to: ^[[example given by Steve Kirkendall]==============================================================================3. User-defined commands				*user-commands*It is possible to define your own ex commands. A user-defined command can actjust like a built-in command (it can have a range or arguments, arguments canbe completed as filenames or buffer names, etc), except that when the commandis executed, it is transformed into a normal ex command and then executed.All user defined commands must start with an uppercase letter, to avoidconfusion with builtin commands. (There are a few builtin commands, notably:Next, :Print and :X, which do start with an uppercase letter.  The builtinwill always take precedence in these cases).  The other characters of the usercommand can be uppercase letters, lowercase letters or digits.  When usingdigits, note that other commands that take a numeric argument may becomeambiguous.  For example, the command ":Cc2" could be the user command ":Cc2"without an argument, or the command ":Cc" with argument "2".  It is advised toput a space between the command name and the argument to avoid these problems.When using a user-defined command, the command can be abbreviated. However, ifan abbreviation is not unique, an error will be issued. Furthermore, abuilt-in command will always take precedence.Example:>	:command Rename ...>	:command Renumber ...>	:Rena				" Means "Rename">	:Renu				" Means "Renumber">	:Ren				" Error - ambiguous>	:command Paste ...>	:P				" The built-in :PrintIt is recommended that full names for user-defined commands are used inscripts.:com[mand]						*:com* *:command*			List all user-defined commands. When listing commands,			the characters in the first two columns are			    !	Command has the -bang attribute			    "	Command has the -register attribute			(see below for details on attributes):com[mand] {cmd}	List the user-defined commands that start with {cmd}:com[mand][!] [{attr}...] {cmd} {rep}			Define a user command.  The name of the command is			{cmd} and its replacement text is {rep}. The command's			attributes (see below) are {attr}. If the command			already exists, an error is reported, unless a ! is			specified, in which case the command is redefined.:delc[ommand] {cmd}					*:delc* *:delcommand*			Delete the user-defined command {cmd}.:comc[lear]						*:comc* *:comclear*			Delete all user-defined commands.Command attributesUser-defined commands are treated by Vim just like any other ex commands. Theycan have arguments, or have a range specified. Arguments are subject tocompletion as filenames, buffers, etc. Exactly how this works depends upon thecommand's attributes, which are specified when the command is defined.There are a number of attributes, split into four categories: argumenthandling, completion behavior, range handling, and special cases. Theattributes are described below, by category.Argument handlingBy default, a user defined command will take no arguments (and an error isreported if any are supplied). However, it is possible to specify that thecommand can take arguments, using the -nargs attribute. Valid cases are:	-nargs=0    No arguments are allowed (the default)	-nargs=1    Exactly one argument is required	-nargs=*    Any number of arguments are allowed (0, 1, or many)	-nargs=?    0 or 1 arguments are allowed	-nargs=+    Arguments must be supplied, but any number are allowedArguments are considered to be separated by (unescaped) spaces in thiscontext.Completion behaviorBy default, the arguments of user defined commands do not undergo completion.However, by specifying one or the other of the following attributes, argumentcompletion can be enabled:	-complete=augroup	autocmd groups	-complete=buffer	buffer names	-complete=command	Ex command (and arguments)	-complete=dir		directory names	-complete=event		autocommand events	-complete=file		file and directory names	-complete=help		help subjects	-complete=highlight	highlight groups	-complete=menu		menus	-complete=option	options	-complete=tag		tags	-complete=tag_listfiles	tags, file names are shown when CTRL-D is hit	-complete=var		user variablesRange handlingBy default, user-defined commands do not accept a line number range. However,it is possible to specify that the command does take a range (the -rangeattribute), or that it takes an arbitrary count value, either in the linenumber position (-range=N, like the |:split| command) or as a "count"argument (-count=N, like the |:Next| command). Possible attributes are:	-range	    Range allowed, default is current line	-range=%    Range allowed, default is whole file (1,$)	-range=N    A count (default N) which is specified in the line		    number position (like |:split|)	-count=N    A count (default N) which is specified either in the line		    number position, or as an initial argument (like |:Next|)		    Specifying -count (without a default) acts like -count=0Note that -range=N and -count=N are mutually exclusive - only one should bespecified.Special casesThere are some special cases as well:	-bang	    The command can take a ! modifier (like :q or :w)	-register   The first argument to the command can be an optional		    register name (like :del, :put, :yank).In the cases of the -count and -register attributes, if the optional argumentis supplied, it is removed from the argument list and is available to thereplacement text separately.Replacement textThe replacement text for a user defined command is scanned for special escapesequences, using <...> notation. Escape sequences are replaced with valuesfrom the entered command line, and all other text is copied unchanged. Theresulting string is executed as an Ex command. If the initial < of an escapesequence is preceded by a backslash, the sequence is copied unchanged.The valid escape sequences are						*<line1>*	<line1>	The starting line of the command range.						*<line2>*	<line2>	The final line of the command range.						*<count>*	<count>	Any count supplied (as described for the '-range'		and '-count' attributes).						*<bang>*	<bang>	(See the '-bang' attribute) Expands to a ! if the		command was executed with a ! modifier, otherwise		expands to nothing.						*<reg>* *<register>*	<reg>	(See the '-register' attribute) The optional register,		if specified. Otherwise, expands to nothing. <register>		is a synonym for this.						*<args>*	<args>	The command arguments, exactly as supplied (but as		noted above, any count or register can consume some		of the arguments, which are then not part of <args>).	<lt>	A single '<' (Less-Then) character.  This is needed if you		want to get a literal copy of one of these escape sequences		into the expansion - for example, to get <bang>, use		<lt>bang>.If the first two characters of an escape sequence are "q-" (for example,<q-args>) then the value is quoted in such a way as to make it a valid valuefor use in an expression.  This uses the argument as one single value.To allow commands to pass their arguments on to a user-defined function, thereis a special form <f-args> ("function args"). This splits the commandarguments at spaces, quotes each argument individually, and the <f-args>sequence is replaced by the comma-separated list of quoted arguments.  See theMycmd example below.  When there is no argument, <f-args> also has noargument.Examples>   " Delete everything after here to the end>   :com Ddel +,$d>   " Rename the current buffer>   :com -nargs=1 -bang -complete=file Ren f <args>|w<bang>>   " Replace a range with the contents of a file>   " (Enter this all as one line)>   :com -range -nargs=1 -complete=file>	 Replace <line1>-pu_|<line1>,<line2>d|r <args>|<line1>d>   " Count the number of lines in the range>   com! -range -nargs=0 Lines :echo <line2> - <line1> + 1 "lines">   " Call a user function (example of <f-args>)>   :com -nargs=* Mycmd call Myfunc(<f-args>)When executed as:>	:Mycmd arg1 arg2This will invoke:>	:call Myfunc("arg1","arg2")>   " A more substantial example>   :function Allargs(command)>   :	let i = 0>   :	while i < argc()>   :	   if filereadable(argv(i))>   :        execute "e " . argv(i)>   :	     execute a:command>   :      endif>   :      let i = i + 1>   :   endwhile>   :endfunction>   :command -nargs=+ -complete=command Allargs call Allargs(<q-args>)The command Allargs takes any Vim command(s) as argument and executes it on allfiles in the argument list.  Usage example (note use of the "e" flag to ignoreerrors and the "update" command to write modified buffers):>	:Allargs %s/foo/bar/ge|updateThis will invoke:>	:call Allargs("%s/foo/bar/ge|update") vim:tw=78:ts=8:sw=8:

⌨️ 快捷键说明

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