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
If you want to wrap lines in a specific area, move the cursor to the text you want to format and type gq followed by the range. For example, gqq wraps the current line and gqip wraps the current paragraph.
Command to toggle word wrap in Vim While :set wrap will turn on word wrap in Vim and :set nowrap will turn off word wrapping, you can also use both commands with the ! (bang) symbol to toggle word wrap. So using either: :set wrap!
It is better to use the :normal command with ! -specifier in this case to avoid clashes with custom mappings. – ib.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With