Skip to content

Instantly share code, notes, and snippets.

@pauldub
Created April 8, 2016 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauldub/96aba025e147353be2f8331ece7e6060 to your computer and use it in GitHub Desktop.
Save pauldub/96aba025e147353be2f8331ece7e6060 to your computer and use it in GitHub Desktop.
def -allow-override -params 1 godoc %{
%sh{
output=$(mktemp -d -t kak-temp-XXXXXXXX)/fifo
mkfifo ${output}
(go doc $1 > ${output}) > /dev/null 2>&1 < /dev/null &
echo "eval -client %opt{docsclient} echo '
edit! -fifo ${output} *godoc*
hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${output})}}
'"
}
}
def -allow-override godoc-at-point %{ godoc %val{selection} }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment