Skip to content

Instantly share code, notes, and snippets.

@nickbarnwell
Created May 19, 2013 22:17
Show Gist options
  • Save nickbarnwell/5609282 to your computer and use it in GitHub Desktop.
Save nickbarnwell/5609282 to your computer and use it in GitHub Desktop.
function! Viadict(word, thesaurus)
if !exists('g:viadict_window')
let g:viadict_window = bufnr('viadict_window', 1)
endif
if bufnr('%') != g:viadict_window
execute "below sb " . g:viadict_window
endif
setlocal buftype=nofile
setlocal bufhidden=hide
setlocal noswapfile
resize 10
au! * <buffer>
au BufLeave <buffer> hide
setlocal noro
execute "%d"
if a:thesaurus
execute "0r ! viadict -t " . a:word
else
execute "0r ! viadict " . a:word
endif
setlocal readonly
normal! gg
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment