Vim 在单词或句子两侧插入括号,引号等等

插件名称

  • surround.vim

插件下载和安装

插件地址

操作

初始文本

"hello world!"

将光标移动到双引号内,按cs"'

'hello world!'

接着将光标放入其中,按cs'<q>

<q>hello world!</q>

移除它,cst"

hello world!

光标移动到 hello上,按ysiw]

[hello] world!

将整行外加括号同时括号内再加一个空格 yss(

( [hello] world! )

删除括号 ds[ds)

hello world!

强调hello

<em>hello</em> world!

采用visual模式,按下V选定整行后 输入S<p class="important">

<p class="important">
<em>hello</em> world!
</p>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章