Home Explore Blog CI



neovim

4th chunk of `runtime/doc/indent.txt`
8e39da40584ab29e9bf8c7138c231ac74d6003c456daa9b90000000100000fa6
	      brace.  (default 0).

		cino=		    cino={2,}-0.5s	cino=}2 >
		  if (cond)	      if (cond)		  if (cond)
		  {			{		  {
		      foo;		  foo;		      foo;
		  }		      }			    }
<
							*cino-^*
	^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;
		      }			}		  }
		  }		      }			  }
<
							*cino-L*
	LN    Controls placement of jump labels. If N is negative, the label
	      will be placed at column 1. If N is non-negative, the indent of
	      the label will be the prevailing indent minus N.  (default -1).

		cino=               cino=L2             cino=Ls >
		  func()              func()              func()
		  {                   {                   {
		      {                   {                   {
		          stmt;               stmt;               stmt;
		  LABEL:                    LABEL:            LABEL:
		      }                   }                   }
		  }                   }                   }
<
							*cino-:*
	: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:
		  }		      }
<
							*cino-=*
	=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;
<
							*cino-l*
	lN    If N != 0 Vim will align with a case label instead of the
	      statement after it in the same line.

		cino=			    cino=l1 >
		    switch (a) {	      switch (a) {
			case 1: {		  case 1: {
				    break;	      break;
				}		  }
<
							*cino-b*
	bN    If N != 0 Vim will align a final "break" with the case label,
	      so that case..break looks like a sort of block.  (default: 0).
	      When using 1, consider adding "0=break" to 'cinkeys'.

		cino=		    cino=b1 >
		  switch (x)	      switch(x)
		  {		      {
		      case 1:		  case 1:
			  a = b;	      a = b;
			  break;	  break;

		      default:		  default:
			  a = 0;	      a = 0;
			  break;	  break;
		  }		      }
<
							*cino-g*
	gN    Place C++ scope declarations N characters from the indent of the
	      block they are in.  (default 'shiftwidth'). By default, a scope
	      declaration is "public:", "protected:" or "private:". This can
	      be adjusted with the 'cinscopedecls' option.

		cino=		    cino=g0 >
		  {		      {
		      public:	      public:
			  a = b;	  a = b;
		      private:	      private:
		  }		      }
<
							*cino-h*
	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;
<
							*cino-N*
	NN    Indent inside C++ namespace N characters extra compared to a
	      normal block.  (default 0).

		cino=			   cino=N-s >
		  namespace {                namespace {
		      void function();       void function();
		  }                          }

		  namespace my               namespace my
		  {                          {
		      void function();       void function();
		  }                          }
<
							*cino-E*
	EN    Indent inside C++ linkage specifications (extern "C" or
	      extern "C++") N characters extra compared to a normal block.
	      (default 0).

		cino=			   cino=E-s >
		  extern "C" {               extern "C" {
		      void function();       void function();
		  }                          }

		  extern "C"                 extern

Title: Advanced 'cinoptions' Values: Jump Labels, Case Statements, C++ Scopes, and Namespaces
Summary
This section covers advanced 'cinoptions' values, including options for jump labels (L), case statements (: and =), aligning with case labels (l), aligning "break" statements with case labels (b), C++ scope declarations (g and h), indentation within C++ namespaces (N), and indentation within C++ linkage specifications (E). It provides examples of how these options affect code formatting.