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

📄 change.txt

📁 MSYS在windows下模拟了一个类unix的终端
💻 TXT
📖 第 1 页 / 共 4 页
字号:
'formatoptions' is a string that can contain any of the letters below.  Thedefault setting is "tcq".  You can separate the option letters with commas forreadability.letter	 meaning when present in 'formatoptions'    ~t	Auto-wrap text using textwidthc	Auto-wrap comments using textwidth, inserting the current comment	leader automatically.r	Automatically insert the current comment leader after hitting	<return> in insert mode.o	Automatically insert the current comment leader after hitting 'o' or	'O' in Normal mode.q	Allow formatting of comments with "gq".	Note that formatting will not change blank lines or lines containing	only the comment leader.  A new paragraph starts after such a line,	or when the comment leader changes.2	When formatting text, use the indent of the second line of a paragraph	for the rest of the paragraph, instead of the indent of the first	line.  This supports paragraphs in which the first line has a	different indent than the rest.  Note that 'autoindent' must be set	too.v	Vi-compatible auto-wrapping in insert mode: Only break a line at a	blank that you have entered during the current insert command.  (Note:	this is not 100% Vi compatible.  Vi has some "unexpected features" or	bugs in this area.  It uses the screen column instead of the line	column.)b	Like 'v', but only auto-wrap if you enter a blank at or before	the wrap margin.  If the line was longer than 'textwidth' when you	started the insert, or you do not enter a blank in the insert before	reaching 'textwidth', Vim does not perform auto-wrapping.l	Long lines are not broken in insert mode: When a line was longer than	'textwidth' when the insert command started, Vim does not	automatically format it.With 't' and 'c' you can specify when Vim performs auto-wrapping:value	action	~""	no automatic formatting (you can use "gq" for manual formatting)"t"	automatic formatting of text, but not comments"c"	automatic formatting for comments, but not text (good for C code)"tc"	automatic formatting for text and commentsNote that when 'textwidth' is 0, Vim does no formatting anyway (but doesinsert comment leaders according to the 'comments' option).Note that when 'paste' is on, Vim does no formatting at all.Note that 'textwidth' can be non-zero even if Vim never performs auto-wrapping;'textwidth' is still useful for formatting with "gq".If the 'comments' option includes "/*", "*" and/or "*/", then Vim has somebuilt in stuff to treat these types of comments a bit more cleverly.Opening a new line before or after "/*" or "*/" (with 'r' or 'o' present in'formatoptions') gives the correct start of the line automatically.  The samehappens with formatting and auto-wrapping. Opening a line after a linestarting with "/*" or "*" and containing "*/", will cause no comment leader tobe inserted, and the indent of the new line is taken from the line containingthe start of the comment.E.g.:    /*     * Your typical comment.     */    The indent on this line is the same as the start of the above    comment.All of this should be really cool, especially in conjunction with the new:autocmd command to prepare different settings for different types of file.Some examples:  for C code (only format comments):>	fo=croq  for Mail/news	(format all, don't start comment with "o" command):>	fo=tcrq==============================================================================7. Indenting C programs					*C-indenting*Vim has options for automatically indenting C program files.  These optionsaffect only the indent and do not perform other formatting.  For commentformatting, see |format-comments|.Note that you can disable the |+smartindent| and |+cindent| features atcompile time.There are in fact three methods available for indentation:'autoindent'	uses the indent from the previous line.'smartindent'	is like 'autoindent' but also recognizes some C syntax to		increase/reduce the indent where appropriate.'cindent'	Works more cleverly than the other two and is configurable to		different indenting styles.The rest of this section describes the 'cindent' option.Note that 'cindent' indenting does not work for every code scenario.  Vimis not a C compiler: it does not recognize all syntax.These four options control C program indenting:'cindent'	Enables Vim to perform C program indenting automatically.'cinkeys'	Specifies which keys trigger reindenting in insert mode.'cinoptions'	Sets your preferred indent style.'cinwords'	Defines keywords that start an extra indent in the next line.If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents usingVim's built-in algorithm rather than calling an external program.See |autocommand| for how to set the 'cindent' option automatically for C codefiles and reset it for others.							*'cinkeys'* *'cink'*The 'cinkeys' option is a string that controls Vim's indenting in response totyping certain characters or commands in certain contexts.  The default is"0{,0},:,0#,!^F,o,O,e" which specifies that indenting occurs as follows:	"0{"	if you type '{' as the first character in a line	"0}"	if you type '}' as the first character in a line	":"	if you type ':' after a label or case statement	"0#"	if you type '#' as the first character in a line	"!^F"	if you type CTRL-F (which is not inserted)	"o"	if you type a <CR> anywhere or use the "o" command (not in		insert mode!)	"O"	if you use the "O" command (not in insert mode!)	"e"	if you type the second 'e' for an "else" at the start of a		lineCharacters that can precede each key:'!'	When a '!' precedes the key, Vim will not insert the key but will	instead reindent the current line.  This allows you to define a	command key for reindenting the current line.  CTRL-F is the default	key for this.  Be careful if you define CTRL-I for this because CTRL-I	is the ASCII code for <Tab>.'*'	When a '*' precedes the key, Vim will reindent the line before	inserting the key.  If 'cinkeys' contains "*<Return>", Vim reindents	the current line before opening a new line.'0'	When a zero precedes the key (but appears after '!' or '*') Vim will	reindent the line only if the key is the first character you type in	the line.When neither '!' nor '*' precedes the key, Vim reindents the line after youtype the key.  So ';' sets the indentation of a line which includes the ';'.Special key names:<>	Angle brackets mean spelled-out names of keys.  For example: "<Up>",	"<Ins>" (see |key-notation|).'^'	Letters preceded by a caret (^) are control characters.  For example:	"^F" is CTRL-F.'o'	Reindent a line when you use the "o" command or when Vim opens a new	line below the current one (e.g., when you type <Return> in insert	mode).'O'	Reindent a line when you use the "O" command.'e'	Reindent a line that starts with "else" when you type the second 'e'.':'	Reindent a line when a ':' is typed which is after a label or case	statement.  Don't reindent for a ":" in "class::method" for C++.If you really want to reindent when you type 'o', 'O', 'e', '0', '<', '>', '*'or '!', use "<o>", "<O>", "<e>", "<0>", "<<>", "<>>", "<*>" or "<!>",respectively, for those keys.For an emacs-style indent mode where lines aren't indented every time youpress Return but only if you press Tab, I suggest:	:set cinkeys=0{,0},:,0#,!<Tab>,!^FYou might also want to switch off 'autoindent' then.Note: If you change the current line's indentation manually, Vim ignores thecindent settings for that line.  This prevents vim from reindenting after youhave changed the indent by typing <BS>, <Tab>, or <Space> in the indent orused CTRL-T or CTRL-D.						*cinoptions-values*The 'cinoptions' option sets how Vim performs indentation.  In the list below,"N" represents a number of your choice (the number can be negative).  Whenthere is an 's' after the number, Vim multiplies the number by 'shiftwidth':"1s" is 'shiftwidth', "2s" is two times 'shiftwidth', etc.  You can use adecimal point, too: "-0.5s" is minus half a 'shiftwidth'.  The examples belowassume a 'shiftwidth' of 4.	>N    Amount added for "normal" indent.  Used after a line that should	      increase the indent (lines starting with "if", an opening brace,	      etc.).  (default 'shiftwidth').		cino=		    cino=>2		cino=>2s		  if (cond)	      if (cond)		  if (cond)		  {		      {			  {		      foo;		foo;			  foo;		  }		      }			  }	eN    Add N to the prevailing indent inside a set of braces if the	      opening brace at the End of the line (more precise: is not the	      first character in a line).  This is useful if you want a	      different indent when the '{' is at the start of the line from	      when '{' is at the end of the line.  (default 0).		cino=		    cino=e2		cino=e-2		  if (cond) {	      if (cond) {	  if (cond) {		      foo;		    foo;	    foo;		  }		      }			  }		  else		      else		  else		  {		      {			  {		      bar;		  bar;		      bar;		  }		      }			  }	nN    Add N to the prevailing indent for a statement after an "if",	      "while", etc., if it is NOT inside a set of braces.  This is	      useful if you want a different indent when there is no '{'	      before the statement from when there is a '{' before it.	      (default 0).		cino=		    cino=n2		cino=n-2		  if (cond)	      if (cond)		  if (cond)		      foo;		    foo;	    foo;		  else		      else		  else		  {		      {			  {		      bar;		  bar;		      bar;		  }		      }			  }	fN    Place the first opening brace of a function or other block in	      column N.  This applies only for an opening brace that is not	      inside other braces and is at the start of the line.  What comes	      after the brace is put relative to this brace.  (default 0).		cino=		    cino=f.5s		cino=f1s		  func()	      func()		  func()		  {			{		      {		      int foo;		    int foo;		  int foo;	{N    Place opening braces N characters from the prevailing indent.	      This applies only for opening braces that are inside other	      braces.  (default 0).		cino=		    cino={.5s		cino={1s		  if (cond)	      if (cond)		  if (cond)		  {			{		      {		      foo;		  foo;		      foo;	}N    Place closing braces N characters from the matching opening	      brace.  (default 0).		cino=		    cino={2,}-0.5s	cino=}2		  if (cond)	      if (cond)		  if (cond)		  {			{		  {		      foo;		  foo;		      foo;		  }		      }			    }	^N    Add N to the prevailing indent inside a set of braces if the	      opening brace is in column 0.  This can specify a different	      indent for whole of a function (some may like to set it to a	      negative number).  (default 0).		cino=		    cino=^-2		cino=^-s		  func()	      func()		  func()		  {		      {			  {		      if (cond)		if (cond)	  if (cond)		      {			{		  {			  a = b;	    a = b;	      a = b;		      }			}		  }		  }		      }			  }	:N    Place case labels N characters from the indent of the switch().	      (default 'shiftwidth').		cino=		    cino=:0		  switch (x)	      switch(x)		  {		      {		      case 1:	      case 1:			  a = b;	  a = b;		      default:	      default:		  }		      }	=N    Place statements occurring after a case label N characters from	      the indent of the label.  (default 'shiftwidth').		cino=		    cino==10		   case 11:		case 11:  a = a + 1;		       a = a + 1;		  b = b + 1;	gN    Place C++ scope declarations N characters from the indent of the	      block they are in.  (default 'shiftwidth').  A scope declaration	      can be "public:", "protected:" or "private:".		cino=		    cino=g0		  {		      {		      public:	      public:			  a = b;	  a = b;		      private:	      private:		  }		      }	hN    Place statements occurring after a C++ scope declaration N	      characters from the indent of the label.  (default	      'shiftwidth').		cino=		    cino=h10		   public:		public:   a = a + 1;		       a = a + 1;		  b = b + 1;	pN    Parameter declarations for K&R-style function declarations will	      be indented N characters from the margin.  (default	      'shiftwidth').		cino=		    cino=p0		cino=p2s		  func(a, b)	      func(a, b)	  func(a, b)		      int a;	      int a;			  int a;		      char b;	      char b;			  char b;	tN    Indent a function return type declaration N characters from the	      margin.  (default 'shiftwidth').		cino=		    cino=t0		cino=t7		      int	      int			 int		  func()	      func()		  func()	+N    Indent a continuation line (a line that spills onto the next) N	      additional characters.  (default 'shiftwidth').		cino=			  cino=+10		  a = b + 9 *		    a = b + 9 *		      c;			      c;	cN    Indent comment lines after the comment opener, when there is no	      other text with which to align, N characters from the comment	      opener.  (default 3).  See also |format-comments|.		cino=			  cino=c5		  /*			    /*		     text.			 text.		   */			     */	(N    When in unclosed parentheses, indent N characters from the line	      with the unclosed parentheses.  When N is 0 or the line starts	      with '(', line up with the unclosed parentheses.  (default	      'shiftwidth' * 2).		cino=			  cino=(0		  if (c1 && (c2 ||	    if (c1 && (c2 ||			      c3))		       c3))		      foo;			foo;		  if (c1 &&		    if (c1 &&			  (c2 || c3))		(c2 || c3))		     {			       {	uN    Same as (N, but for one level deeper.  (default 'shiftwidth').		cino=			  cino=u2		  if (c123456789	    if (c123456789			  && (c22345		    && (c22345			      || c3))		      || c3))	)N    Vim searches for unclosed parentheses at most N lines away.	      This limits the time needed to search for parentheses.  (default	      20 lines).	*N    Vim searches for unclosed comments at most N lines away.  This	      limits the time needed to search for the start of a comment.	      (default 30 lines).The defaults, spelled out in full, are:	cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,ps,ts,c3,+s,(2s,us,)20,*30,gs,hsVim puts a line in column 1 if:- It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'.- It starts with a label (a keyword followed by ':', other than "case" and  "default").- Any combination of indentations causes the line to have less than 0  indentation. vim:tw=78:ts=8:sw=8:

⌨️ 快捷键说明

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