Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I format as indicated below?

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

like image 431
Reman Avatar asked Nov 14 '22 04:11

Reman


1 Answers

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

set nosmartindent
like image 119
PonyEars Avatar answered Jan 05 '23 07:01

PonyEars