vim dictionary lookup command - 01-11-20
As I author all my blog posts, including this text, as markdown documents with vim sometime I come across a word I’d like to lookup. Today I’ve added a vim command to do just this.
snippet from .vimrc or .nvimrc
function! LookUpDef(word)
silent !clear
execute "!open https://www.wordnik.com/words/" . a:word
endfunction
command! -nargs=* Dic call LookUpDef(<f-args>)
Then an example vim workflow
-
navigating to word, ex “faucet”, then yank inner word with
yiw
-
open command prompt enter command
:Dic
-
then paste yanked txt into command prompt with <C-R>"
:Dic faucet
- press enter and watch default browser pop up with the word searched via wordnik.com
screen recording