Defining the Word at Point

I just stumbled upon a new offering from abo-abo. It's define-word, a very nice package that allows you to get a definition of the word at point. You can also specify the word in the minibuffer if you want.

The package works by connecting to wordnik, grabbing the resulting page, parsing out the definition, and then displaying it as a message. That's nice because it doesn't require that you have a dictionary installed to work. Abo-abo says the package is less than 50 lines so there's no memory overhead to speak of.

OS X has a nice feature where you can three-finger tap on a word in most of the native apps and get a definition from the system dictionary. Unfortunately it doesn't work with Emacs so I had to manually look up definitions using spotlight. That wasn't too much trouble but define-word is so much better. I bound the commands to【Hyper+d】 and【Hyper+D】 using use-package like this

(use-package define-word
  :ensure t
  :bind (("H-d" . define-word-at-point)
         ("H-D" . define-word)))

I just installed it as I'm writing this and I'm already in love with it. A really great package.

This entry was posted in General and tagged . Bookmark the permalink.
  • brabalan

    This OS X version of emacs has the three-finger tap thing: https://github.com/railwaycat/homebrew-emacsmacport

    • jcs

      Looks interesting. I'll have to check it out. Thanks.

  • Damien Cassou

    Here is a version of the use-package expression that will load define-word only when necessary and not at emacs load time:


    (use-package define-word
    :bind (("H-d" . define-word-at-point)
    ("H-D" . define-word)))