vimrc disable auto-wrap

If you have any suggestions or ideas about improving Salix, here's the place to post them.
User avatar
pwatk
Posts: 474
Joined: 14. Mar 2010, 23:56
Location: United Kingdom

vimrc disable auto-wrap

Post by pwatk »

Here's another command I'd like added to .vimrc to change a really annoying default.

Could set showbreak=>\ wrap linebreak textwidth=0 please be added to /etc/skel/.vimrc in the user-settings package to stop vim auto-wrapping (at a silly width) and provide a marker when you reach the edge of the screen/window instead.

Thanks.

-pwatk
Image
User avatar
gapan
Salix Wizard
Posts: 6349
Joined: 6. Jun 2009, 17:40

Re: vimrc disable auto-wrap

Post by gapan »

Well, ok... I guess we can have that. But I don't like the "wrap" text showing up. How about something like:

Code: Select all

set showbreak=>>\  linebreak textwidth=0
Image
Image
User avatar
pwatk
Posts: 474
Joined: 14. Mar 2010, 23:56
Location: United Kingdom

Re: vimrc disable auto-wrap

Post by pwatk »

That'll teach me not to blindly copy commands from web pages :oops: .

The "wrap" is supposed to be part of the command but for some reason it's being printed on screen when the terminal has a small enough geometry. I didn't notice this until I saw your post and started playing around with it though.

This fixes the problem:

Code: Select all

:set wrap linebreak textwidth=0 showbreak=>>
Image
User avatar
gapan
Salix Wizard
Posts: 6349
Joined: 6. Jun 2009, 17:40

Re: vimrc disable auto-wrap

Post by gapan »

I'm not sure I like that. There are a lot of people (including me) that use vim as a text editor (not a code editor) and being able to view the entire paragraph you're writing is a must have.

I'd like to have more opinions on this.
Image
Image
User avatar
fredg
Posts: 232
Joined: 3. Oct 2009, 16:50
Location: Lyon, France
Contact:

Re: vimrc disable auto-wrap

Post by fredg »

I agree with pwatk.
and being able to view the entire paragraph you're writing is a must have.
You will see your entire paragraph.
Like this :

Code: Select all

Lorem Ipsum is simply dummy text of the printing and typesetting industry.
>>Lorem Ipsum has been the industry's standard dummy text ever since 
>>the 1500s, when an unknown printer took a galley of type and scrambled
>> it to make a type specimen book. It has survived not only five centuries
>>, but also the leap into electronic typesetting, remaining essentially
>>unchanged. It was popularised in the 1960s with the release of Letraset 
>>sheets containing Lorem Ipsum passages, and more recently with desktop
>> publishing software like Aldus PageMaker including versions of Lorem Ipsum.
All this sentence is a one-liner

++
User avatar
gapan
Salix Wizard
Posts: 6349
Joined: 6. Jun 2009, 17:40

Re: vimrc disable auto-wrap

Post by gapan »

You're right, I seem to have mistyped that somehow. Well, I'm ok with that. Although I'm not sure what the difference is between the one I posted and the last one.
Image
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: vimrc disable auto-wrap

Post by mimosa »

I use vim as an editor for composing emails in alpine, and I'm not altogether sure what this change would do, but the current default works well in terms of wrapping. :)

I'd like to learn more about this sort of thing, though. Sometimes my emails get indented as though they were code. On the other hand, I'm now starting to code too, and the indenting isn't always the way I want it.

I suppose what I'm trying to say is if you know how these things work ... you can always change it. The real problem is people like me who haven't worked it out yet. ;) Defaults should ideally be transparent and well-commented in the config fle to help on the learning curve, i.e. nothing too tricksy. Not that I'm saying what is being proposed here is that; but I still don't understand it.

EDIT

fredg, that looks ugly ;)
User avatar
pwatk
Posts: 474
Joined: 14. Mar 2010, 23:56
Location: United Kingdom

Re: vimrc disable auto-wrap

Post by pwatk »

set wrap textwidth=0 stops vim line wrapping at a silly invisible margin. At the very least keep this.

set linebreak showbreak=>> displays the >> to denote a break when you finally hit the edge of the screen on a single line.

-pwatk
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: vimrc disable auto-wrap

Post by mimosa »

Thanks for the explanation, pwatk.

I'll try putting these in my .vimrc and continue using vim to write email for a while.

You say the existing wrap width is "silly". No doubt it wasn't set with alpine users in mind - and maybe alpine is already doing something to change the behaviour when it calls vim. But what *did* they have in mind, the vim devs, and what is the width, anyway?

I am dimly aware that line wrapping is an important issue with clients such as pine, so that different defaults used by the clients of your correspondents don't produce unreadable text when you (or they) scroll down to see what was said a day or two ago. But maybe alpine deals with this satisfactorily, whatever editor you use?

I also wonder how those >> might interact with the use of similar symbols to indicate text you are replying to (and so on, till >>>>>> recursively takes over the screen).
User avatar
pwatk
Posts: 474
Joined: 14. Mar 2010, 23:56
Location: United Kingdom

Re: vimrc disable auto-wrap

Post by pwatk »

Sorry, I actually got that wrong. Use :set wrap linebreak textwidth=0 to force vim to only wrap the text when you hit the end of the screen/terminal. I would like this to be added at the very least.

The current default is to wrap text at a very short, fixed margin which IMO is very annoying.

You can add what ever showbreak= option you like to denote a line break or just leave it off.

-pwatk
Image
Post Reply