1

I'm trying to configure vim so that the text breaks automatically at 80 characters. I know the way to do this is with

set textwidth=80

However, the lines don't automatically break when I typed past 80 characters. It waits until I hit Enter, then it applies the 80 character rule to what I've typed, and places my cursor on the line below all of the newly formatted text. So, I hit Enter, it reformats, then I have to go one line up to continue typing from where I was. I would like it so that the line breaks happen automatically while I'm typing. This was the case before I switched to arch-linux, but I lost my .vimrc and I can't tell if it's an issue with my new .vimrc or something else.

Here's my current .vimrc. http://pastebin.com/A4H9E0SA

Edit: Okay, so I decided to go through and replace chunks of my .vimrc until I found which part of the code caused this issue. It turns out that it's neocomplete that's causing this issue. I tried removing a bunch of the neocomplete settings (see the bottom of my .vimrc, starting at line 112) to see if any of those lines were causing the issue. It appears merely having neocomplete on is the cause of this issue.

Can anyone replicate this issue with neocomplete and/or have any ideas as to how to fix this without completely removing this plugin?

  • If you add noremap pp p[v]gq$ to your vimrc then pressing pp should do what you want. – Chrispie Mar 3 '15 at 8:39
  • I'd rather not have to press any keys to make this happen, though. And I'm sure it's possible, given that it worked in my previous configuration a couple of weeks ago. – grish Mar 3 '15 at 9:14
  • Your update changes completely the question. Probably you should make a new question providing details on your new problem, and removing the "already understood" part. – JJoao Mar 3 '15 at 11:03
  • Gotcha, will do. Would it be better to delete this question, then, or get rid of the added detail leave it up? – grish Mar 3 '15 at 17:45
  • @grish, don't delete it, the question is good. (just focus in subject at a time). – JJoao Mar 5 '15 at 13:46
0

I use set wrap margin 1 in a 80 char terminal

:set textwidth=80
:set wm=1

And it words pretty well.

(when you want to switch off wrapping do :set wm=0 )

  • Yeah, I've thought about that, but I'd prefer it not to depend on the terminal width since the terminals I work in vary in size. – grish Mar 3 '15 at 9:16
  • @grish see my edit (= use both textwith and wrapmargin) – JJoao Mar 3 '15 at 9:29
  • Doesn't quite fix my problem, does this configuration work on your machine with the rest of my vimrc? – grish Mar 3 '15 at 9:36
  • @grish Sorry typo: not textwith but textwidth=80! (edit) – JJoao Mar 3 '15 at 9:43
  • Ha, no worries, I made that change when I tried the code. – grish Mar 3 '15 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.