24

I've setup a colorcolumn=80, but I found I can not wrap long lines in ~/.vimrc.

Is there any method like C's \ to concatenate?

For example I tried this, but it does not work.

autocmd FileType python setlocal ai si et sta sw=4 \
textwidth=80 backspace=indent,eol,start fo=croql
Rob Bednark
  • 25,981
  • 23
  • 80
  • 125
Daniel YC Lin
  • 15,050
  • 18
  • 63
  • 96

1 Answers1

47

Lines in the .vimrc file can be wrapped by putting the escaping \ at the beginning of the continuation line:

autocmd FileType python
    \ setlocal ai si et sta sw=4
    \ textwidth=80 backspace=indent,eol,start fo=croql

See :h line-continuation

Rob Bednark
  • 25,981
  • 23
  • 80
  • 125
John Weldon
  • 39,849
  • 11
  • 94
  • 127
  • tks, where to find the document, I can not find it. I've tried `:help vimrc` – Daniel YC Lin Nov 04 '11 at 08:01
  • Agreed, I couldn't find this in the documentation, although I'm sure it's there somewhere. I found it by examining .vimrc files until I found it. – John Weldon Nov 04 '11 at 08:02
  • 23
    See `:help line-continuation` for description of the line continuation syntax in Vim scripts. – ib. Nov 04 '11 at 08:31
  • I haven't managed to comment continued line - seems all the following line continuations are considered as comment. Is there any solution? – bam Feb 28 '19 at 20:12