gd and gD in vim

發表于:2007-05-25來源:作者:點擊數: 標簽:代碼vim尋找直接某一
在閱讀代碼時,直接尋找某一變量的定義。 struct X x; void foo() { struct Y y; struct Z z; ... } For some reason you've forgotten what y and z are and want to go to their declaration double quick. One way of doing this is by searching backwar
在閱讀代碼時,直接尋找某一變量的定義。

struct X x;

void foo()
{
    struct Y y;
    struct Z z;

    ...
}

For some reason you've forgotten what y and z are and want to go to their declaration double quick. One way
of doing this is by searching backwards for y or z. VIM offers a simpler and quicker solution. The
gd keystroke stands for Goto Declaration. With the cursor on "y" if you hit gd the cursor will take you to the
declaration :− struct Y y;.
A similar keystroke is gD. This takes you to the global declaration of the variable under the cursor. So if one
want to go to the declaration of x, then all one needs to do is hit gD and the cursor will move to the
declaration of x.

原文轉自:http://www.anti-gravitydesign.com

評論列表(網友評論僅供網友表達個人看法,并不表明本站同意其觀點或證實其描述)
国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97