VSCodeVim/Vim

`gd` for local definition / first occurrence in function

Open

#3319 opened on Jan 2, 2019

View on GitHub
 (1 comment) (1 reaction) (0 assignees)TypeScript (12,664 stars) (1,271 forks)batch import
help wantedkind/enhancement

Description

Is your feature request related to a problem? Please describe. In vim, I used to have g-d going to the local definition or the first occurrence in a function for the word under the cursor. However, in VSCode-Vim I found that g-d is liking to the global definition. I already have "CTRL+]" going to the global definition, so I'm wondering how I could have "g-d" going to the local definition / the first occurrence in a function.

Describe the solution you'd like Under NORMAL mode, "g-d" goes to the local definition / first occurrence in a function of the word under the cursor.

Describe alternatives you've considered Search for the word under the cursor with "*" and use "[[" to go to the "{" bracket of a function and press "n" to do the search again.

I found that in the quickref.txt "g-d" "goto local declaration of identifier under the cursor" and "g-D" "goto global declaration of identifier under the cursor". But the current VSCode-Vim doesn't seem to work as it stated :(

Contributor guide