diff options
author | Teddy Wing | 2022-05-05 20:24:04 +0200 |
---|---|---|
committer | Teddy Wing | 2022-05-05 20:48:35 +0200 |
commit | d9ad91b54971581e4d6c55fc9bd94ef2896c8a3a (patch) | |
tree | d33b05e6fd750574c1088d45455e001823fb8810 /ftplugin/go.vim | |
parent | c75087d87e30825d645d4e920fa7420256eceecb (diff) | |
download | dotvim-d9ad91b54971581e4d6c55fc9bd94ef2896c8a3a.tar.bz2 |
ftplugin/go.vim: Add `GoDoc` command
Override the `GoDoc` command from 'vim-go'. That one produces docs
without the "-all" flag, and there's no option to enable "all". This
gives me all the documentation for a package.
This isn't as useful yet, as it breaks the `K` keywordprg.
Diffstat (limited to 'ftplugin/go.vim')
-rw-r--r-- | ftplugin/go.vim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ftplugin/go.vim b/ftplugin/go.vim index cdad2d5..d22bb67 100644 --- a/ftplugin/go.vim +++ b/ftplugin/go.vim @@ -44,3 +44,10 @@ nmap <buffer> z<C-^> :call go#alternate#Switch(1, 'edit')<CR> nmap <buffer> <C-w>z<C-^> :call go#alternate#Switch(1, 'vsplit')<CR> nmap <buffer> Ze <Plug>(go-iferr) + + +" TODO: if no q-args, use cword +command! -buffer -nargs=1 GoDoc :new <Bar> + \ execute 'read !go doc -all ' . shellescape(<q-args>) <Bar> + \ set readonly nomodified <Bar> + \ setfiletype go |