vimrc disable auto-wrap

If you have any suggestions or ideas about improving Salix, here's the place to post them.
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: vimrc disable auto-wrap

Post by mimosa »

I just tested it and it doesn't seem to affect the behaviour of vim when called as alternate editor by alpine; so I'm assuming alpine has some settings suitable for email that overrride whatever's in .vimrc. However, when vim is called directly, the modification works as described. That might not always be ideal, though I can certainly see that for some things it's much better than the existing default - particularly coding.

Supposing I want to define linewrapping at X characters, is it like this:

Code: Select all

:set wrap linebreak textwidth=X
:?:

... and is that the same as the existing default behaviour? In particular, the insertion of linebreaks, which might cause problems when you open your file with another editor?

I wonder how the options we're discussing play out in GVim. (I take it it bases its behaviour on .vimrc too.)
User avatar
pwatk
Posts: 474
Joined: 14. Mar 2010, 23:56
Location: United Kingdom

Re: vimrc disable auto-wrap

Post by pwatk »

mimosa wrote:I just tested it and it doesn't seem to affect the behaviour of vim when called as alternate editor by alpine; so I'm assuming alpine has some settings suitable for email that overrride whatever's in .vimrc. However, when vim is called directly, the modification works as described. That might not always be ideal, though I can certainly see that for some things it's much better than the existing default - particularly coding.

Supposing I want to define linewrapping at X characters, is it like this:

Code: Select all

:set wrap linebreak textwidth=X
:?:
Yes
... and is that the same as the existing default behaviour?
Yes
In particular, the insertion of linebreaks, which might cause problems when you open your file with another editor?
Um, well other editors won't see those breaks so no.

We could just use set textwidth=0 which would keep everything on one line without any breaks. At least this would remove the annoying margin.
I wonder how the options we're discussing play out in GVim. (I take it it bases its behaviour on .vimrc too.)
AFAIK Gvim will observe the options set in the .vimrc but don't quote me.
Image
User avatar
JRD
Salix Warrior
Posts: 950
Joined: 7. Jun 2009, 22:52
Location: Lyon, France

Re: vimrc disable auto-wrap

Post by JRD »

pwatk wrote:AFAIK Gvim will observe the options set in the .vimrc but don't quote me.
:) Yes it will.

I vote also for having this options by default.
for the "showbreak" content, whatever you find it ok is ok for me.

A bit off topic, but could "modeline" be also added to the standard default options ?
It's a option that say to parse modelines at start of files like :

Code: Select all

$ cat myfilewithweird.extension
# vim: syn=sh
echo "in fact it's a sh script"
Open this file with vim (or gvim) with a "set modeline" in .vimrc and you will have the correct syntax highlight.
I use this always. It's very convenient for some files with non-standard extension. The syntax of the modeline could vary a lot and adapt to any language.
Image
Post Reply