Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapping: add gD for :GoDefType #3531

Merged
merged 1 commit into from
Mar 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1555,9 +1555,10 @@ Valid options are `gopls` and `guru`. By default it's `gopls`.
*'g:go_def_mapping_enabled'*

Use this option to enable/disable the default mapping of CTRL-],
<C-LeftMouse>, g<C-LeftMouse> and (`gd`) for GoDef and CTRL-t for :GoDefPop.
Disabling it allows you to map something else to these keys or mappings.
Default is enabled. >
<C-LeftMouse>, g<C-LeftMouse> and (`gd`) for GoDef, CTRL-t for :GoDefPop, and
(`gD`) for :GoDefType. Disabling it allows you to map something else to these
keys or mappings. Default is enabled.
>

let g:go_def_mapping_enabled = 1
<
Expand Down
1 change: 1 addition & 0 deletions ftplugin/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ if get(g:, "go_def_mapping_enabled", 1)
" these are default Vim mappings, we're overriding them to make them
" useful again for Go source code
nnoremap <buffer> <silent> gd :GoDef<cr>
nnoremap <buffer> <silent> gD :GoDefType<cr>
nnoremap <buffer> <silent> <C-]> :GoDef<cr>
nnoremap <buffer> <silent> <C-LeftMouse> <LeftMouse>:GoDef<cr>
nnoremap <buffer> <silent> g<LeftMouse> <LeftMouse>:GoDef<cr>
Expand Down