On Thursday 11 February 2010 03:00:48 pm Joyce Tipping wrote:

> Hi guys,
> 
> I've been having an odd problem with my automatic text
>  wrapping in vim. I wrap my text with the "gq" command,
>  sometimes as "gqap" (to wrap a paragraph), sometimes as
>  "gggqG" (to wrap the whole document). I've been using vim for
>  years and I don't recall ever having this issue.
> 
> Just recently, it started doing something really weird. I
>  think a picture is worth a thousand words, so here's a blog
>  post I've been working on:
> 
> http://old.nabble.com/file/p27554664/vim-problem.png
> 
> Here's the contents of my vimrc:
> 
>   1 set number
>   2 set nowrap
>   3 set tabstop=2
>   4 set expandtab
>   5 set shiftwidth=2
>   6 set autoindent
>   7 set smartindent
>   8 set hlsearch
>   9
>  10 au BufRead,BufNewFile *.cltex    set filetype=cltex
>  11 au BufRead,BufNewFile *.gnarly   set filetype=gnarly
>  12 au BufRead,BufNewFile *.ocamltex set filetype=ocamltex
>  13 au BufRead,BufNewFile *.scala    set filetype=scala
>  14 au BufReadPost,BufNew *.profile  set syntax=profile
> 
> Here are some things I've tried:
> 
> 1. Changing the text width. In this particular case, I've got
>  the text width set to 65 -- ":set tw=65" -- but I've tried it
>  with text widths of 55, 60, 65, 70, and 75. Changing the text
>  width will usually fix the paragraph in question, but then
>  another one will start doing the same thing.
> 
> 2. Manually correcting the paragraph. But unfortunately, as
>  soon as I use the "gq" command again, it goes right back.
> 
> 3. Uninstalling and reinstalling vim. No change.
> 
> 4. Playing with my vimrc. It might have something to do with
>  the shiftwidth because when I took out that line, I got the
>  same problem, except indented 8 spaces instead of 2:
> 
> http://old.nabble.com/file/p27554664/vim-problem-2.png
> 
> (This image is not showing up on the preview. If it doesn't
>  display when I post, I'll try reposting it in a reply ...
>  hopefully you get the idea though.)
> 
> Anyway, my programmer husband (who has been a major vim user
>  and Linux geek for years and years and years) has never seen
>  this happen. And I've done a few google searches, but beyond
>  "vim text wrapping problem" (which doesn't turn up much) I
>  don't know what to look for.
> 
> So sorry for the information overload, and especially if this
>  is a routine problem. But any help is much appreciated!
> 
> Joyce
> (who is pretty baffled and would just like her text wrapping
>  to work :D)
> 

this looks like what happens when vim thinks the filetype of the 
buffer you are editing is some language which has indenting 
rules, and you have 'filetype indent on' (i believe 'on' is the 
default)

you can add 'filetype indent off' to your .vimrc, see if that 
fixes it, and if it does you might also want to determine why vim 
thinks you are editing code -- check filetype with

    :set filetype?

or the more informational

    :verbose set filetype?

that's my guess anyway,

sc

-- 
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to