Vim Tutorial Study(10)

Chapter 11 Dealing with Text Files
Automatic Text Wrapping
:set textwidth=30 : Vim automatically inserts line breaks
:set wrapmargin=10
:set textwidth=70  
(:set textwidth=0 means use default value 80)
which means you have a screen that is 80 characters wide, but you at most can have 70 characters in one line
Bad Thing:
if you delete something from one line, all you get is a short line!
How to get the paragraph into shape:
1.
a) select the paragraph as part of visual selection
b) execute gq command
2.
a) gq<motion> command: like gq4j which means formating 5 lines starting from the current line
3.
a)position the cursor on the first line of the paragraph
b)gq} command (no need to count the lines)
(this method has a risk: it will merge many paragraphs into one paragraph, suck!   ANSWER: if you have a empty line between each paragraphs, it will work perfectly! Wonderful!)
4.
a)gqip (ip means inner graph, no need to put the cursor on the beginning of a paragraph)
****************************************************
Each paragraph should be separated by an empty line!
****************************************************
Text Formatting Command
:range center width  ---> :1,5 center 30 (I haven't understood what width means)
:1,5 right 30
:range left margin   ---> :1 left 5    :2,5 left 0
Movement
) command: moves forward one sentence
( command: does the same thing backward
} command: moves forward one paragraph
{ command: moves one paragraph backward

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值