I have the following line in my .gvimrc file for automatically wrapping a string of 80 characters.
set textwidth=80
I also have the following lines to control the deviation of C ++ code.
set smartindent set cindent
This works well most of the time, but has a limitation when typing long lines. Spaces or tabs added by auto-indexing become part of the line. For example, currently wrapping a string:
puts("I have put `set textwidth=80` in my `.gvimrc` file to make gvim automatically wrap long strings like this one.");
whereas I would like to do the following:
puts("I have put `set textwidth=80` in my `.gvimrc` file to make gvim " "automatically wrap long strings like this one.");
This will ensure that there are no false promising spaces in the output, while maintaining a constant indentation of the code.
Is there any way to configure gvim for this? I searched the Internet and StackOverflow but couldn't figure out how to do this.
source share