5

These are my format options in .vimrc:

set formatoptions=tqronw
set formatlistpat=^\\([\\-\\*]\\\|[0-9]\\+[.)]\\)\\s*
set textwidth=72
set autoindent

1)
My text:

- This is my text this is my text this is my text this is my text this is my text this is my text.

Output after formatting:

- This is my text this is my text this is my text this is my text this is my 
 text this is my text.

Expected output:

- This is my text this is my text this is my text this is my text this is my 
  text this is my text.

2)
My text:

for Biochemistry, conducted a quality clinical study to determine the effects of microwave cooking on food

Output after formatting:

for Biochemistry, conducted a quality clinical study to determine the
 effects of microwave cooking on food

Expected output:

for Biochemistry, conducted a quality clinical study to determine the
effects of microwave cooking on food

Edit
Found the solution for my first question :)
There were (no-visible) nbsp's (no breaking spaces) in the text.
When I did a substitute with normal-spaces the formatting was as expected

Reman
  • 7,931
  • 11
  • 55
  • 97
  • 1
    To make non-breaking spaces be distinguishable with normal spaces use `set list lcs=tab:\ \ ,nbsp:_` (it also makes sense to use something other then `tab:\ \ ` here to see tabs as well). None of the options will highlight any of the big bunch of other unicode spaces that have different width, but all are likely to have the same effect as a non-breaking space. – ZyX May 31 '12 at 18:14

1 Answers1

1

Let me take a wild guess for your second question. Try adding:

set nosmartindent
PonyEars
  • 2,144
  • 4
  • 25
  • 30
  • Glad it worked. Long ago, I remember having to get down to the level of doing a binary search over my huge .vimrc to figure this one out. – PonyEars Jul 11 '12 at 17:24