Skip to content

Instantly share code, notes, and snippets.

@UncleBill
Last active December 17, 2015 16:49
Show Gist options
  • Save UncleBill/5641836 to your computer and use it in GitHub Desktop.
Save UncleBill/5641836 to your computer and use it in GitHub Desktop.
" unclebill <[email protected]>
function! Sdcv(...)
let s:keyword = ""
if a:0 == 0
let s:keyword = expand("<cword>")
if s:keyword == ""
echo "sdcv: no keyword input"
return
endif
else
let s:keyword = a:1
endif
let expl=system('sdcv -n ' . s:keyword)
windo if expand("%")=="diCt-tmp" | q! | endif
windo map q :q!<cr>
25sp diCt-tmp
setlocal buftype=nofile bufhidden=delete noswapfile
1s/^/\=expl/
1
wincmd J
endfunction
command! -nargs=* Sdcv call Sdcv(<args>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment