Memo

カーソルの下の単語が最初
に現れる場所を、カレントファイルの中だけ検索し、その場所にジャンプするには、次
のコマンドを使います: gD ヒント: Goto Definition (定義に移動)。このコマンドはローカル(C 用語で”static”)
に定義された変数や関数を検索するのに便利です。例 (カーソルは”counter” の上): +-> static int counter = 0; | | int get_counter(void) gD | { | ++counter; +— return counter; } さらに検索範囲を狭めて、現在の関数の中だけ検索したい場合は次のコマンドを使いま
す: gd 現在の関数の開始位置から最初に単語が使われている場所が検索されます。実際に、行
頭が “{” で始まる行を後方検索して、その上の空行まで戻り、そこから識別子を前方
検索しています。例 (カーソルは “idx” の上): int find_entry(char *name) { +-> int idx; | gd | for (idx = 0; idx

Vim documentation: usr_29
To Tumblr, Love PixelUnion

We're updating Fluid!

Soon, we'll be updating the look and feel of this theme. Read about the changes here. You can easily turn off this notification in the theme customization panel.

Close