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

📄 motion.txt

📁 MSYS在windows下模拟了一个类unix的终端
💻 TXT
📖 第 1 页 / 共 3 页
字号:
*motion.txt*    For Vim version 5.8.  Last change: 2001 May 18		  VIM REFERENCE MANUAL    by Bram MoolenaarCursor motions					*cursor-motions* *navigation*These commands move the cursor position.  If the new position is off of thescreen, the screen is scrolled to show the cursor (see also 'scrolljump' and'scrolloff' options).1. Motions and operators	|operator|2. Left-right motions		|left-right-motions|3. Up-down motions		|up-down-motions|4. Word motions			|word-motions|5. Text object motions		|object-motions|6. Text object selection	|object-select|7. Various motions		|various-motions|==============================================================================1. motions and operators				*operator*The motion commands can be used after an operator command, to have the commandoperate on the text that was moved over.  That is the text between the cursorposition before and after the motion.  Operators are generally used to deleteor change text.  The following operators are available:	|c|	c	change	|d|	d	delete	|y|	y	yank into register (does not change the text)	|~|	~	swap case (only if 'tildeop' is set)	|g~|	g~	swap case	|gu|	gu	make lower case	|gU|	gU	make upper case	|!|	!	filter through an external program	|=|	=	filter through 'equalprg' or C-indenting if empty	|gq|	gq	text formatting	|>|	>	shift right	|<|	<	shift leftIf the motion includes a count and the operator also had a count before it,the two counts are multiplied.  For example: "2d3w" deletes six words.After applying the operator the cursor is mostly left at the start of the textthat was operated upon.  For example, "yfe" doesn't move the cursor, but "yFe"moves the cursor leftwards to the "e" where the yank started.						*linewise* *characterwise*The operator either affects whole lines, or the characters between the startand end position.  Generally, motions that move between lines affect lines(are linewise), and motions that move within a line affect characters (arecharacterwise).  However, there are some exceptions.A character motion is either inclusive or exclusive. When inclusive, the startand end position of the motion are included in the operation.  When exclusive,the last character towards the end of the buffer is not included.  Linewisemotions always include the start and end position.Which motions are linewise, inclusive or exclusive is mentioned below.  Thereare however, two general exceptions:1. If the motion is exclusive and the end of the motion is in column 1, the   end of the motion is moved to the end of the previous line and the motion   becomes inclusive.  Example: "}" moves to the first line after a paragraph,   but "d}" will not include that line.2. If the motion is exclusive, the end of the motion is in column 1 and the   start of the motion was at or before the first non-blank in the line, the   motion becomes linewise.  Example: If a paragraph begins with some blanks   and you do "d}" while standing on the first non-blank, all the lines of   the paragraph are deleted, including the blanks.  If you do a put now, the   deleted lines will be inserted below the cursor position.Note that when the operator is pending (the operator command is typed, but themotion isn't yet), a special set of mappings can be used.  See |:omap|.Instead of first giving the operator and then a motion you can use Visualmode: mark the start of the text with "v", move the cursor to the end of thetext that is to be affected and then hit the operator.  The text between thestart and the cursor position is highlighted, so you can see what text willbe operated upon.  This allows much more freedom, but requires more keystrokes and has limited redo functionality.  See the chapter on Visual mode|Visual-mode|.If you want to know where you are in the file use the "CTRL-G" command|CTRL-G| or the "g CTRL-G" command |g_CTRL-G|.  If you set the 'ruler' option,the cursor position is continuously shown in the status line (which slows downVim a little).NOTE: Experienced users prefer the hjkl keys because they are always rightunder their fingers.  Beginners often prefer the arrow keys, because theydo not know what the hjkl keys do.  The mnemonic value of hjkl is clear fromlooking at the keyboard.  Think of j as an arrow pointing downwards.==============================================================================2. Left-right motions					*left-right-motions*h		or					*h*<Left>		or					*<Left>*CTRL-H		or					*CTRL-H* *<BS>*<BS>			[count] characters to the left (exclusive).			Note: If you prefer <BS> to delete a character, use			the mapping:				:map CTRL-V<BS>		X			(to enter "CTRL-V<BS>" type the CTRL-V key, followed			by the <BS> key)			See |:fixdel| if the <BS> key does not do what you			want.l		or					*l*<Right>		or					*<Right>* *<Space>*<Space>			[count] characters to the right (exclusive).							*0*0			To the first character of the line (exclusive).  When			moving up or down, stay in same screen column (if			possible).							*<Home>* *<kHome>*<Home>			To the first character of the line (exclusive).  When			moving up or down, stay in same text column (if			possible).  Works like "1|", which differs from "0"			when the line starts with a <Tab>.  {not in Vi}							*^*^			To the first non-blank character of the line			(exclusive).							*$* *<End>* *<kEnd>*$  or <End>		To the end of the line and [count - 1] lines downward			(inclusive).							*g0* *g<Home>*g0 or g<Home>		When lines wrap ('wrap on): To the first character of			the screen line (exclusive).  Differs from "0" when a			line is wider than the screen.			When lines don't wrap ('wrap' off): To the leftmost			character of the current line that is on the screen.			Differs from "0" when the first character of the line			is not on the screen.  {not in Vi}							*g^*g^			When lines wrap ('wrap' on): To the first non-blank			character of the screen line (exclusive).  Differs			from "^" when a line is wider than the screen.			When lines don't wrap ('wrap' off): To the leftmost			non-blank character of the current line that is on the			screen.  Differs from "^" when the first non-blank			character of the line is not on the screen.  {not in			Vi}							*gm*gm			Like "g0", but half a screenwidth to the right (or as			much as possible). {not in Vi}							*g$* *g<End>*g$ or g<End>		When lines wrap ('wrap' on): To the last character of			the screen line and [count - 1] screen lines downward			(inclusive).  Differs from "$" when a line is wider			than the screen.			When lines don't wrap ('wrap' off): To the rightmost			character of the current line that is visible on the			screen.  Differs from "$" when the last character of			the line is not on the screen or when a count is used.			{not in Vi}							*bar*|			To screen column [count] in the current line			(exclusive).							*f*f{char}			To [count]'th occurrence of {char} to the right.  The			cursor is placed on {char} (inclusive).							*F*F{char}			To the [count]'th occurrence of {char} to the left.			The cursor is placed on {char} (inclusive).							*t*t{char}			Till before [count]'th occurrence of {char} to the			right.  The cursor is placed on the character left of			{char} (inclusive).							*T*T{char}			Till after [count]'th occurrence of {char} to the			left.  The cursor is placed on the character right of			{char} (inclusive).							*;*;			Repeat latest f, t, F or T [count] times.							*,*,			Repeat latest f, t, F or T in opposite direction			[count] times.These commands move the cursor to the specified column in the current line.They stop at the first column and at the end of the line, except "$", whichmay move to one of the next lines.  See 'whichwrap' option to make some of thecommands move across line boundaries.==============================================================================3. Up-down motions					*up-down-motions*k		or					*k*<Up>		or					*<Up>* *CTRL-P*CTRL-P			[count] lines upward (linewise).j		or					*j*<Down>		or					*<Down>*CTRL-J		or					*CTRL-J*<NL>		or					*<NL>* *CTRL-N*CTRL-N			[count] lines downward (linewise).gk		or					*gk* *g<Up>*g<Up>			[count] display lines upward (exclusive).  Differs			from 'k' when lines wrap, and when used with an			operator, because it's not linewise.  {not in Vi}gj		or					*gj* *g<Down>*g<Down>			[count] display lines downward (exclusive).  Differs			from 'j' when lines wrap, and when used with an			operator, because it's not linewise.  {not in Vi}							*-*-  <minus>		[count] lines upward, on the first non-blank			character (linewise).+		or					*+*CTRL-M		or					*CTRL-M* *<CR>*<CR>			[count] lines downward, on the first non-blank			character (linewise).							*_*_  <underscore>		[count] - 1 lines downward, on the first non-blank			character (linewise).<C-End>		or					*G* *<C-End>*G			Goto line [count], default last line, on the first			non-blank character (linewise).  If 'startofline' not			set, keep the same column.<C-Home>	or					*gg* *<C-Home>*gg			Goto line [count], default first line, on the first			non-blank character (linewise).  If 'startofline' not			set, keep the same column.:[range]		Set the cursor on the (last) specified line number			(cannot be used with an operator).							*N%*{count}%		Go to {count} percentage in the file, on the first			non-blank in the line (linewise).  To compute the new			line number this formula is used:			    ({count} * number-of-lines + 99) / 100			See also 'startofline' option.  {not in Vi}:[range]go[to] [count]					*:go* *:goto* *go*[count]go		Go to {count} byte in the buffer.  Default [count] is			zero, start of the file.  When giving [range], the			last number in it used.  End-of-line characters are			counted depending on the current 'fileformat' setting.			{not in Vi}			{not available when compiled without the			|+byte_offset| feature}These commands move to the specified line.  They stop when reaching the firstor the last line.  The first two commands put the cursor in the same column(if possible) as it was after the last command that changed the column,except after the "$" command, then the cursor will be put on the lastcharacter of the line.==============================================================================4. Word motions						*word-motions*<S-Right>	or					*<S-Right>* *w*w			[count] words forward (exclusive).<C-Right>	or					*<C-Right>* *W*W			[count] WORDS forward (exclusive).							*e*e			Forward to the end of word [count] (inclusive).							*E*E			Forward to the end of WORD [count] (inclusive).<S-Left>	or					*<S-Left>* *b*b			[count] words backward (exclusive).<C-Left>	or					*<C-Left>* *B*B			[count] WORDS backward (exclusive).							*ge*ge			Backward to the end of word [count] (inclusive).							*gE*

⌨️ 快捷键说明

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