VIM TIP12

To insert space characters whenever the tab key is pressed, set the 'expandtab' option: 想要按下TAB的时候插入的是空格的话,请做如下设定: set expandtab

With this option set, if you want to enter a real tab character use Ctrl-V key sequence. 在此设定下,想要输入真正的TAB制表符,用Ctrl-V #说实话,这条tip似乎没有什么用啊~用ts什么的停方便的啊

Technorati Tags:

VIM TIP11

In Insert mode, press the Ctrl-p or Ctrl-n key to complete part of a word that has been typed. 在插入模式下,Ctrl-pCtrl-n 可以补全已经录入单词 This is useful while typing C programs to complete long variable and function names. This also helps in avoiding typing mistakes. 很有用在编程过程中有长的变量或函数名时,也可以有效的避免拼写错误 Note that using the 'complete' option, you can complete keywords defined in one of the include files, tag file, etc. 值得注意的时,使用补全模式,可以补全在include文件或tag文件中的单词 To get more help on this, use 想知道更多,请查阅帮助 :help i_Ctrl-N :help i_Ctrl-P :help ins-completion :help complete

Technorati Tags:

VIM TIP10

Vim remembers all the locations visited by you in a file in a session. You can jump to the older locations by pressing the Ctrl-O key. You can jump to the newer locations by pressing the Ctrl-I or the key. Vim 记得在编辑过程中光标所有的移动位置。可以通过Ctrl-O 来跳转先前位置,Ctrl-I 可以跳转到后来的位置。

经试验,似乎两个命令发生打开历史文件的作用。类似浏览器中的前进、后退命令。

To get more help on these keys, use 想知道更多,请查阅帮助 :help CTRL-O :help CTRL-I :help jump-motions Technorati Tags:

VIM TIP9

VimTip 9: Displaying a variable/macro definition
显示变量、宏定义


To display the definition of a variable, place the cursor on the variable and use the [i command. To display a macro definition, place the cursor on the macro name and use the [d command.
显示变量、宏定义可将光标放在变量下用[i 命令。宏定义使用[d
Note that these commands will work most of the time (not all the time).
以上命令在绝大多数场合都使用(非所有)#唐僧了吧又
To get more help on these commands, use
想知道更多,请查阅帮助
:help [i
:help [d

Technorati Tags:

Technorati Tags:

VIM TIP8

VimTip 8: Jumping to the declaration of a local/global variable



'gd' command:
To
jump to the declaration of a local variable in a C program, position
the cursor on the name of the variable and use the gd command.
gd 在c语言中就是跳到光标下本地变量的声名处
'gD' command:
To
jump to the declaration of a global variable in a C program, position
the cursor on the name of the variable and use the gD command.
gd 在c语言中就是跳到光标下全局变量的声名处
#其实啊,在普通的文件中我觉得两个命令跟*和#基本上是一样的
My del.icio.us Tags

VIM TIP6

The % key can be used %是很有用的!

  1. To jump to a matching opening or closing parenthesis, square bracket or a curly brace i.e. ([{}])
  2. To jump to start or end of a C-style comment /* */.
  3. To jump to a matching #if, #ifdef, #else, #elif, #endif C preprocessor conditionals.
  1. 找到匹配得括号
  2. 找到匹配得c语言风格注释/**/
  3. 找到匹配得c语言预处理块#if, #ifdef,#else, #elif, #endif

To get more information about this, do 想知道更多,请查阅帮助: :help %

The % key can be extended to support other matching pairs by modifying the "matchpairs" option. Read the help on 当然,%也可以通过扩展来增加对其他匹配对得匹配查找,想知道请: :help matchpairs

My del.icio.us Tags

VIM TIP7

To jump to the beginning of a C code block (while, switch, if etc),use the [{ command. 跳到代码块头,用[{ To jump to the end of a C code block (while, switch, if etc),use the ]} command. 跳到代码块头,用]} The above two commands will work from anywhere inside the code block. 上边两个命令在代码块中的任何地方都适用 To jump to the beginning of a parenthesis圆括号 use the [( command. 跳到 To jump to the end of a parenthesis圆括号 use the ]) command.

To get more help on these commands, do 想知道更多,请查阅帮助

:help [{ :help ]} :help [( :help ])
My del.icio.us Tags

VIM TIP5

To search for a word under the cursor in the current file you can use either the "" or "#" keys. 可以用“”或“#”来搜索光标下的单词 The "" key will search for the word from the current cursor position to the end of the file. The "#" key will search for the word from the current cursor position to the top of the file. “”是下文搜索,“#”是上文搜索。 Note that the above two keys will search for the whole word and not the partial word. This is equivalent to using the pattern in the search commands (/ and ?). 注意以上*和#两种用法同/ 和?的用法都是,用来查找整词而不是检索词是被包含在其中单词

To search for partial matches, you can use the "g" and "g#" keysequence. 找检索词被包含在检索结果中单词 可以用g和g#

You can also use the mouse to search for a word. 同样可以用鼠标来搜索单词 This will only work in the GUI version of VIM (gvim) or a console version of VIM in an xterm which accepts a mouse. 当然实在gvim或支持鼠标的xterm类似的终端环境下 Also, the 'mousemodel' should be set to 'extend'. Add the following line to your .vimrc: 想用的话当然得扩展一下 。在配置文件中加:

set mousemodel=extend

To search for a word under the cursor from the current cursor position to the end of the file, press the shift key and click on the word using the left mouse button. To search in the opposite direction, press the shift key and click on the word using the the right mouse button. 这样就可以使用shift+左键来搜索下文中光标下得单词咯,上文搜索是shift+右键

To get more help on these, use 想多知道得话查帮助吧! :help :help # :help g :help g# :help :help

My del.icio.us Tags

由vi和emacs的圣战想

vi抑或Emacs,这是个问题。
对于国外的geek来说,这个问题引发了一次次口诛笔伐,可谓geek圣战。不经意间发现了这样几片文章:
或许对大多数人会说“有什么好争的,编辑器 Notepad就够了,许多IDE中自带的编辑器就够了嘛”;一如浏览器ie就够了,大不了用Maxthon嘛。其中暴露出来的是一种及其恶劣的惰性,懒惰是一种美德,而精致的懒惰或许就是另外的一种境界了。
很多的时候,如同布道者一样苦口婆心介绍,如同传教士一样推广,得到怕麻烦之类的反映亦已习以为常。
所谓人性化、科技以人为本原是广告自我标榜得字汇,易用性、用户习惯是商家产品设计的目标,如今确成为各色人等的人生信条。哪怕是牺牲暂时的适应来获得长久的快捷。对于用户来说,这,的确是个台阶。

希望自己能够成为精致的懒惰的强迫症,偏执狂患者

My del.icio.us Tags:vi,emacs
Technorati Tags: ,

好想一起去旅行

有一什么乐队来着?对,叫星期三的旅行吧?赝品MazzyStar,赝的有点多的那种,不过名字这会听来极为受用。

她在旅行,一个人,为了那个12年前许诺,经历了进15个小时历史上罕见的铁路晚点,出发了……

好想一起去旅行。

其实我们一直都是在旅行,当然不是空间上的那种旅行。因为我们不是叮当,所以这种非空间旅行没有双程票,只是单行道,且不知道目的地,不定到哪就是终点了;没法停,一旦停就是永久的停了;路上及其容易被沿途的风光、旅途的疲劳所淹没,忘记自己是谁,在干吗,一迷糊就一位自己是上帝在天堂巡游要么就是绑老虎凳上嘴里灌了辣椒水的严刑拷打宁死不屈的共产党。其实就一旅客旅行嘛。切

真的,好想一起去旅行。随便什么地,一起就行



Technorati Tags: