Learning linux……

VimTip 5: 轻松编辑相同目录下的文件

原 文: http://www.vim.org/tips/tip.php?tip_id=5
翻 译: huangyi yi.codeplayer@gmail.com
修 订:
更新日期: 2006-5-25

VimTip 5: 轻松编辑相同目录下的文件
------------------------------------

搜索当前文件中当前光标下的单词,你可以使用 "*" 或 "#"

"*" 键从当前光标位置开始搜索到文件结束。"#"键从当前光标位置开始
搜索到文件开头。

注意上面两个键都会搜索整个单词而不是单词的一部分。这和在搜索命令(/和?)
中使用<word>模式是等价的。

要搜索部分匹配的话,你可以使用"g*"和"g#"。

你也可以使用鼠标来搜索一个单词。这只在GUI版本的VIM (gvim)
或在接受鼠标的xterm下的控制台版本的VIM中有用。还要把 'mousemodel'
设为 'extend' 。在你的 .vimrc 中添加下面这一行:

set mousemodel=extend

要从当前光标位置到文件结尾搜索光标下的单词,按 shift 键并左键单击该单词。
要从相反方向搜索的话,按 shift 键并右键单击该单词。

更多帮助请查看:

:help *
:help #
:help g*
:help g#
:help <S-LeftMouse>
:help <S-RightMouse>

VimTip 4 单词补全VimTip 6:百分号"%"的用途

Comments

Anonymous Sunday, September 26, 2010 11:23:53 AM

Анонімний writes: We probably must follow your best outcome associated with this topic in the essay or just dance essay writing. Thus, thanks a lot for your contribution.

Anonymous Wednesday, April 13, 2011 10:33:32 AM

Анонімний writes: You should be very yeasty guy to create such very hot dissertation writing reffering to this topic . We would like to buy term papers or custom thesis about this. I appreciate it!

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies