From d9ad91b54971581e4d6c55fc9bd94ef2896c8a3a Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 5 May 2022 20:24:04 +0200 Subject: 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. --- ftplugin/go.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ftplugin') 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 z :call go#alternate#Switch(1, 'edit') nmap z :call go#alternate#Switch(1, 'vsplit') nmap Ze (go-iferr) + + +" TODO: if no q-args, use cword +command! -buffer -nargs=1 GoDoc :new + \ execute 'read !go doc -all ' . shellescape() + \ set readonly nomodified + \ setfiletype go -- cgit v1.2.3