`
insertyou
  • 浏览: 868314 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Best of VIM Tips(译注) - 连载2 查找(a)

阅读更多

[翻译]

/joe/e : cursor set to End of match

把光标定位在匹配单词最后一个字母处

/joe/e+1 : cursor set to End of match plus 1

把光标定位在匹配单词最后一个字母的下一个字母处

/joe/s-2 : cursor set to Start of match minus 2

把光标定位在匹配单词第一个字母往前数两个字母的位置

/joe/+3 : find joe move cursor 3 lines down

查找joe,把光标向下移动3

[注解]

:help /

:help ?

VIM中的查找命令大家都知道:“/”或“?”,其中“/”是向下查找,“?”是向上查找。

:help search-offset

在查找时,缺省光标会放置在被查找单词的第一个字母上。但可以在查找时指定光标偏移,偏移可以是相对该单词的开始、结尾、向下几行或向上几行。

[参考文档]

1. http://www.rayninfo.co.uk/vimtips.html

2. http://groups.google.com/group/Vim-cn/msg/f72fba0645955101?

3. VIM帮助文件

4. http://vimcdoc.sourceforge.net/


[尾记]

本文可以自由应用于非商业用途。转载请注明出处。

原文链接:http://blog.csdn.net/easwy

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics