vim Visual Mode


1         The $ command

In the block visual mode ,the $ command causees the selection to be extended to the end of all the lines in the selection


2         Selecting Objects

The 'aw' command ,for example,highlights the next word,

If you want to just select the word ,and nothing bu the word ,use the 'iw' command



You can use the following commands to select text:
countaw Select a word and the space after it.
countiw Select a word only (inner word).
countaW Select a WORD and the space after it.
countiW Select inner WORD (the word only)
countas Select a sentence (and spaces after it.)
countis Select the sentence only.
countap Select a paragraph and the following space.
countip Select a paragraph only.
counta( From within text enclosed in (), select the text up to and including
       the ().
counti( Like ab, except the () characters are not selected.
for (i = 0; i < 100; ++1)
for (i = 0; i < 100; ++1)
a(
i(
Figure 22.5
a(
and i( commands.
counta< Select matching <> pair, include the <>.
counti< Select matching <> pair, excluding the <>.
counta[ Select matching [] pair, including the [].
counti[ Select matching [] pair, excluding the [].
counta{ Select matching {} pair, including the {}.
counti{ Select matching {} pair, excluding the {}.



3          The 'o' command moves the cursor to the other end of a selection


4          The '~' command inverts the case of the seletion,Th 'U' command makes the text uppercase and the 'u' command turns the text into lowercase 


5         The 'J' command joins all the highligthed lines into one long lines


6         The 'gq' command formats the text


7        The 'g?'  command encodes or decodes the highlightd text using the rot13 encoding.


8        The Colon (:) command start a command-mode with a range already specified,If you want to write a block to a file,for example,

select the text using the visual mode ,and then execute the following commands:

:write block.txt


9        The '!'  command pipes a region of text through an external program.For example ,the !sort pipes the selection

through the UNIX sort program

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值