Re: [PATCH v2 1/2] Add project-wide .vimrc configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 09, 2020 at 12:55:36AM -0600, Felipe Contreras wrote:

> +augroup git
> +	au BufRead,BufNewFile */Documentation/*.txt set filetype=asciidoc
> +
> +	au FileType c setl noexpandtab tabstop=8 shiftwidth=0 cino=(s,:0,l1,t0

I had to read up on a few of these settings, and I'm still slightly
puzzled:

  - I generally leave shiftwidth=8, but reading the documentation says
    that 0 is equivalent to "1 tabstop". So that should be equivalent.

  - I've been using "(0" for years for my git work (which indents to
    align new lines with the unclosed parenthesis). I'm not quite sure
    what "(s" means. The documentation says "1s" would be "one
    shiftwidth". Is just "s" the same?

  - I also have ":0", which doesn't indent case labels. Matches our
    style.

  - I didn't have "l" set myself. I never noticed because it only
    matters if you open a case with an extra brace, which is relatively
    rare. For non-vim folks, it is preferring:

	switch (foo) {
	case 0: {
		break;
	}

    to:

	switch (foo) {
	case 0: {
			break;
		}

    which seems consistent with our style. So I think that is worth
    doing.

  - t0 is specifying not to indent function return types when they
    appear on a separate line. But our style is not to put those return
    types on a separate line, anyway. Do we need this?

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux