Skip to content

Commit

Permalink
Merge pull request #3531 from bhcleek/gD-mapping
Browse files Browse the repository at this point in the history
mapping: add gD for :GoDefType
  • Loading branch information
bhcleek committed Mar 5, 2023
2 parents d2c730c + 3fccf24 commit ae80922
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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

0 comments on commit ae80922

Please sign in to comment.