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

📄 vi_diff.txt

📁 MSYS在windows下模拟了一个类unix的终端
💻 TXT
📖 第 1 页 / 共 3 页
字号:
	paragraph conveniently (e.g. when the text is later read into a DTP	program).  Move the cursor up/down with the "gk" and "gj" commands.Text formatting.					|formatting|	The 'textwidth' option can be used to automatically limit the line	length.  This supplements the 'wrapmargin' option of Vi, which was not	very useful.  The "gq" operator can be used to format a piece of text	(for example, "gqap" formats the current paragraph).  Commands for	text alignment: ":center", ":left" and ":right".Edit-compile-edit speedup.				|quickfix|	The ":make" command can be used to run the compilation and jump to	the first error.  Alternatively Vim can be started with the "-q"	option from the compiler.  A file with compiler error messages is	interpreted.  Vim starts editing at the first error.	Each line in the error file is scanned for the name of a file, line	number and error message.  The 'errorformat' option can be set to a	list of scanf-like strings to handle output from many compilers.	The ":cn" command can be used to jump to the next error.	":cl" lists all the error messages.  Other commands are available	(almost the same as with Manx's Z editor on the Amiga).	The 'makeef' option has the name of the file with error messages.	The 'makeprg' option contains the name of the program to be executed	with the ":make" command.	The 'shellpipe' option contains the string to be used to put the	output of the compiler into the errorfile.Improved indenting for C programs			|'cindent'|	When the 'cindent' option is on the indent of each line is	automatically adjusted.  C syntax is mostly recognized.  The indent	for various styles can be set with 'cinoptions'.  The keys to trigger	indenting can be set with 'cinkeys'.	Comments can be automatically formatted.  The 'comments' option can be	set to the characters that start and end a comment.  This works best	for C code, but also works for e-mail (">" at start of the line) and	other types of text.  The "=" operator can be used to re-indent	lines.Searching for words in include files			|include-search|	The "[i" command can be used to search for a match of the word under	the cursor in the current and included files.  The 'include' option	can be set the a pattern that describes a command to include a file	(the default is for C programs).	The "[I" command lists all matches, the "[ CTRL-I" command jumps to	a match.	The "[d", "[D" and "[ CTRL-D" commands do the same, but only for	lines where the pattern given with the 'define' option matches.Automatic commands					|autocommand|	Commands can be automatically executed when reading a file, writing a	file, jumping to another buffer, etc., depending on the file name.	This is useful to set options and mappings for C programs,	documentation, plain text, e-mail, etc.  This also makes it possible	to edit compressed files.Scripts and Expressions					|expression|	Commands have been added to form up a simple but powerful script	language.	|:if|		Conditional execution, which can be used for example			to set options depending on the value of $TERM.	|:while|	Repeat a number of commands.	|:echo|		Print the result of an expression.	|:let|		Assign a value to an internal variable, option, etc.	|:execute|	Execute a command formed by an expression.	etc.Viminfo							|viminfo-file|	The command-line history, marks and registers can be stored in a file	that is read on startup.  This can be used to repeat a search command	or command-line command after exiting and restarting Vim.  It is also	possible to jump right back to where the last edit stopped with "'0".	The 'viminfo' option can be set to select which items to store in the	.viminfo file.  This is off by default.Mouse support						|mouse-using|	The mouse is supported in the GUI version, in an xterm for Unix, for	Linux with gpm, for MS-DOS, and Win32.  It can be used to position the	cursor, select the visual area, paste a register, etc.Usage of key names					|<>| |key-notation|	Special keys now all have a name like <Up>, <End>, etc.	This name can be used in mappings, to make it easy to edit them.Editing binary files					|edit-binary|	Vim can edit binary files.  You can change a few characters in an	executable file, without corrupting it.  Vim doesn't remove NUL	characters (they are represented as <NL> internally).	|-b|		command-line argument to start editing a binary file	|'binary'|	Option set by "-b".  Prevents adding an <EOL> for the			last line in the file.==============================================================================5. Other vim features					*other-features*A random collection of nice extra features.When Vim is started with "-s scriptfile", the characters read from"scriptfile" are treated as if you typed them.  If end of file is reachedbefore the editor exits, further characters are read from the console.The "-w" option can be used to record all typed characters in a script file.This file can then be used to redo the editing, possibly on another file orafter changing some commands in the script file.The "-o" option opens a window for each argument.  "-o4" opens four windows.In command mode:When the 'showcmd' option is set, the command characters are shown in the lastline of the screen.  They are removed when the command is finished.If the 'ruler' option is set, the current cursor position is shown in thelast line of the screen.'U' still works after having moved off the last changed line and after 'u'.Characters with the 8th bit set are displayed.  The characters between '~' and0xa0 are displayed as "~?", "~@", "~A", etc., unless the "graphic' option isset.'][' goes to the next ending of a C function ('}' in column 1).'[]' goes to the previous ending of a C function ('}' in column 1).']f', '[f' and 'gf' start editing the file whose name is under the cursor.CTRL-W f splits the window and starts editing the file whose name is underthe cursor.'*' searches forward for the identifier under the cursor, '#' backward.'K' runs the program defined by the "keywordprg" option, with the identifierunder the cursor as argument.'%' can be preceded with a count.  The cursor jumps to the line thatpercentage down in the file.  The normal '%' function to jump to the matchingbrace skips braces inside quotes.With the CTRL-] command, the cursor may be in the middle of the identifier.The used tags are remembered.  Commands that can be used with the tag stackare CTRL-T, ':pop' and ':tag'.  ':tags' lists the tag stack.The 'tags' option can be set to a list of tag file names.  Thus multipletag files can be used.  For file names that start with '.', the '.' isreplaced with the path of the current file.  This makes it possible to use atags file in the same directory as the file being edited.Previously used file names are remembered in the alternate file name list.CTRL-^ accepts a count, which is an index in this list.Search patterns have more features.  The <NL> character is seen as part of thesearch pattern and the substitute string of ":s".  Vi sees it as the end ofthe command.Searches can put the cursor on the end of a match and may include a characteroffset.Count added to '~', ':next', ':Next', 'n' and 'N'.The command ":next!" with 'autowrite' set does not write the file.  In vi thefile was written, but this is considered to be a bug, because one does notexpect it and the file is not written with ':rewind!'.In Vi when entering a <CR> in replace mode deletes a character only when 'ai'is set (but does not show it until you hit <Esc>).  Vim always deletes acharacter (and shows it immediately).Added :wnext command.  Same as ":write" followed by ":next".The ":w!" command always writes, also when the file is write protected.  In Viyou would have to do ":!chmod +w %" and ":set noro".When 'tildeop' has been set, '~' is an operator (must be followed by amovement command).With the 'J' (join) command you can reset the 'joinspaces' (js) option tohave only one space after a period (Vi inserts two spaces).'cw' can be used to change white space formed by several characters (Vi isconfusing: 'cw' only changes one space, while 'dw' deletes all white space).'o' and 'O' accept a count for repeating the insert (Vi clears a part ofdisplay).Previously used file names are remembered in the alternate file name list.":files" command shows the list of alternate file names.'#'<N> is replaced with the <N>th alternate file name in the list."#<" is replaced with the current file name without extension.Flags after Ex commands not supported (no plans to include it).On non-UNIX systems ":cd" command shows current directory instead of going tothe home directory (there isn't one).  ":pwd" prints the current directory onall systems.':source!' command reads Vi commands from a file.':mkexrc' command writes current modified options and mappings to a ".exrc"file.  ':mkvimrc' writes to a ".vimrc" file.No check for "tail recursion" with mappings.  This allows things like":map! foo ^]foo".When a mapping starts with number, vi loses the count typed before it (e.g.when using the mapping ":map g 4G" the command "7g" goes to line 4).  This isconsidered a vi bug.  Vim concatenates the counts (in the example it becomes"74G"), as most people would expect.The :put! command inserts the contents of a register above the current line.The 'p' and 'P' commands of vi cannot be repeated with '.' when the puttedtext is less than a line.  In Vim they can always be repeated.":noremap" command can be used to enter a mapping that will not be remapped.This is useful to exchange the meaning of two keys.  ":cmap", ":cunmap" and":cnoremap" can be used for mapping in command-line editing only.  ":imap",":iunmap" and ":inoremap" can be used for mapping in insert mode only.Similar commands exist for abbreviations: ":noreabbrev", ":iabbrev"":cabbrev", ":iunabbrev", ":cunabbrev", ":inoreabbrev", ":cnoreabbrev".In Vi the command ":map foo bar" would remove a previous mapping":map bug foo".  This is considered a bug, so it is not included in Vim.":unmap! foo" does remove ":map! bug foo", because unmapping would be verydifficult otherwise (this is vi compatible).The ':' register contains the last command-line.The '%' register contains the current file name.The '.' register contains the last inserted text.':dis' command shows the contents of the yank registers.CTRL-O/CTRL-I can be used to jump to older/newer positions.  These are thesame positions as used with the '' command, but may be in another file.  The':jumps' command lists the older positions.If the 'shiftround' option is set, an indent is rounded to a multiple of'shiftwidth' with '>' and '<' commands.The 'scrolljump' option can be set to the minimum number of lines to scrollwhen the cursor gets off the screen.  Use this when scrolling is slow.The 'scrolloff' option can be set to the minimum number of lines to keepabove and below the cursor.  This gives some context to where you areediting.  When set to a large number the cursor line is always in the middleof the window.Uppercase marks can be used to jump between files.  The ':marks' command listsall currently set marks.  The commands "']" and "`]" jump to the end of theprevious operator or end of the text inserted with the put command.  "'[" and"`[" do jump to the start.The 'shelltype' option can be set to reflect the type of shell used on theAmiga.The 'highlight' option can be set for the highlight mode to be used forseveral commands.The CTRL-A (add) and CTRL-X (subtract) commands are new.  The count to thecommand (default 1) is added to/subtracted from the number at or after thecursor.  That number may be decimal, octal (starts with a '0') or hexadecimal(starts with '0x').  Very useful in macros.

⌨️ 快捷键说明

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