diff options
Diffstat (limited to 'runtime/doc/usr_29.txt')
-rw-r--r-- | runtime/doc/usr_29.txt | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/runtime/doc/usr_29.txt b/runtime/doc/usr_29.txt index d8c556c281..751cb9a902 100644 --- a/runtime/doc/usr_29.txt +++ b/runtime/doc/usr_29.txt @@ -33,9 +33,8 @@ following command: > ctags *.c "ctags" is a separate program. Most Unix systems already have it installed. -If you do not have it yet, you can find Universal/Exuberant ctags at: - http://ctags.io ~ - http://ctags.sf.net ~ +If you do not have it yet, you can find Universal ctags at: + https://ctags.io ~ Universal ctags is preferred, Exuberant ctags is no longer being developed. @@ -54,7 +53,7 @@ function. The "write_line" function calls "write_char". You need to figure out what it does. So you position the cursor over the call to "write_char" and press CTRL-]. Now you are at the definition of "write_char". - +> +-------------------------------------+ |void write_block(char **s; int cnt) | |{ | @@ -80,7 +79,7 @@ CTRL-]. Now you are at the definition of "write_char". | putchar((int)(unsigned char)c); | |} | +------------------------------------+ - +< The ":tags" command shows the list of tags that you traversed through: :tags @@ -268,9 +267,6 @@ doesn't work if the tags file isn't sorted. The 'taglength' option can be used to tell Vim the number of significant characters in a tag. -Cscope is a free program. It does not only find places where an identifier is -declared, but also where it is used. See |cscope|. - ============================================================================== *29.2* The preview window @@ -429,7 +425,7 @@ MOVING IN COMMENTS To move back to the start of a comment use "[/". Move forward to the end of a comment with "]/". This only works for /* - */ comments. - +> +-> +-> /* | [/ | * A comment about --+ [/ | +-- * wonderful life. | ]/ @@ -438,7 +434,7 @@ comment with "]/". This only works for /* - */ comments. +-- foo = bar * 3; --+ | ]/ /* a short comment */ <-+ - +< ============================================================================== *29.4* Finding global identifiers @@ -579,7 +575,7 @@ and jump to the first place where the word under the cursor is used: > Hint: Goto Definition. This command is very useful to find a variable or function that was declared locally ("static", in C terms). Example (cursor on "counter"): - +> +-> static int counter = 0; | | int get_counter(void) @@ -587,7 +583,7 @@ function that was declared locally ("static", in C terms). Example (cursor on | ++counter; +-- return counter; } - +< To restrict the search even further, and look only in the current function, use this command: > @@ -597,7 +593,7 @@ This will go back to the start of the current function and find the first occurrence of the word under the cursor. Actually, it searches backwards to an empty line above a "{" in the first column. From there it searches forward for the identifier. Example (cursor on "idx"): - +> int find_entry(char *name) { +-> int idx; @@ -606,7 +602,7 @@ for the identifier. Example (cursor on "idx"): | if (strcmp(table[idx].name, name) == 0) +-- return idx; } - +< ============================================================================== Next chapter: |usr_30.txt| Editing programs |