Home Explore Blog CI



neovim

5th chunk of `runtime/doc/indent.txt`
c158b2124ef9e09d6f8e24ecba755b6e9e58529050e8ade60000000100000fa3
 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 "C"
		  {                          {
		      void function();       void function();
		  }                          }
<
							*cino-p*
	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;
<
							*cino-t*
	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()
<
							*cino-i*
	iN    Indent C++ base class declarations and constructor
	      initializations, if they start in a new line (otherwise they
	      are aligned at the right side of the ':').
	      (default 'shiftwidth').

		cino=			  cino=i0 >
		  class MyClass :	    class MyClass :
		      public BaseClass      public BaseClass
		  {}			    {}
		  MyClass::MyClass() :	    MyClass::MyClass() :
		      BaseClass(3)	    BaseClass(3)
		  {}			    {}
<
							*cino-+*
	+N    Indent a continuation line (a line that spills onto the next)
              inside a function N additional characters.  (default
              'shiftwidth').
              Outside of a function, when the previous line ended in a
              backslash, the 2 * N is used.

		cino=			  cino=+10 >
		  a = b + 9 *		    a = b + 9 *
		      c;			      c;
<
							*cino-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.
		   */			     */
<
							*cino-C*
	CN    When N is non-zero, indent comment lines by the amount specified
	      with the c flag above even if there is other text behind the
	      comment opener.  (default 0).

		cino=c0			  cino=c0,C1 >
		  /********		    /********
		    text.		    text.
		  ********/		    ********/
<	      (Example uses ":set comments& comments-=s1:/* comments^=s0:/*")

							*cino-/*
	/N    Indent comment lines N characters extra.  (default 0).
		cino=			  cino=/4 >
		  a = b;		    a = b;
		  /* comment */			/* comment */
		  c = d;		    c = d;
<
							*cino-(*
	(N    When in unclosed parentheses, indent N characters from the line
	      with the unclosed parenthesis.  Add a 'shiftwidth' for every
	      extra unclosed parentheses.  When N is 0 or the unclosed
	      parenthesis is the first non-white character in its line, line
	      up with the next non-white character after the unclosed
	      parenthesis.  (default 'shiftwidth' * 2).

		cino=			  cino=(0 >
		  if (c1 && (c2 ||	    if (c1 && (c2 ||
			      c3))		       c3))
		      foo;			foo;
		  if (c1 &&		    if (c1 &&
			  (c2 || c3))		(c2 || c3))
		     {			       {
<
							*cino-u*
	uN    Same as (N, but for one

Title: More 'cinoptions' Values: C++ Constructs, K&R Functions, and Comments
Summary
This section details 'cinoptions' values for indenting elements within C++ code, including statements after scope declarations (h), namespaces (N), linkage specifications (E), K&R-style function parameter declarations (p) and return types (t), C++ base class declarations and constructor initializations (i), continuation lines (+), and comment formatting (c, C, /). It also covers indentation within unclosed parentheses, uN, similar to (N but for one.