ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Mac​Dictionary

by Goto Hayato ST3 OS X

📚 A Sublime Text 3 package which provides a popup function for the MacOS dictionary service.

Labels mac, dictionary

Details

Installs

  • Total 414
  • Win 0
  • OS X 414
  • Linux 0
Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
OS X 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 2 0 2 1 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 2 0 1 1 0 1 3 0 1
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

MacDictionary

A Sublime Text 3 package which provides a popup function for the macOS dictionary service.

SublimeMacDictionary capture

Dependencies

This package depends on Sublime Markdown Popups (mdpopups). You don't need to install it separately since it's automatically installed when you use Package Control to install this package.

Installation

It's easy to install this package with Package Control. If you haven't installed Package Control yet, first install it following the instruction.

Once you've installed Pacakge Control, restart your Sublime Text and open the command palette (ctrl/cmd + shift + p). Then, find and select Package Control: Install Package. You will see MacDictionary in the list and select it.

Usage

SublimeMacDictionary animated capture

Commands

This package provides the following commands.

  • MacDictionary: Show definition (mac_dictionary_show_def_for_selection)
  • MacDictionary: Switch brute mode (mac_dictionary_brute_mode_switch)

You can run these commands with the command palette (ctrl/cmd + shift + p).

Also you can set any custom key binding to run a command:

[
  {
    "keys": ["shift+ctrl+d"],
    "command": "mac_dictionary_show_def_for_selection"
  }
]

Context menu (right click menu)

Or, you can use the context menu item Show definition to open the definition popup.

Brute mode

Additionally, you can use a mode named brute_mode with which the package tries to generate a popup aggressively every time when you move your mouse cursor. With the mode enabled, you don't need to call the command.

SublimeMacDictionary animated capture for brute mode

The mode is disabled by default. You can enable it through the package settings:

{
  "brute_mode": true
}

You can also use MacDictionary: Switch brute mode in the Command Palette to switch the brute_mode.

Switching dictionaries

Although the macOS dictionary has a range of built-in and downloadable dictionaries, Apple unfortunately does not provide an API to the one that is used. Therefore, the package will return the first match from all enabled dictionaries. If you want to change that, you can do so with a workaround: In dictionary.app, open the preferences and drag your preferred dictionary (such as a thesaurus) to the top. You should see that it now has also moved to the leftmost position in the selection bar on top of the main app window.

After restarting sublime, the package will now use your new primary dictionary.

License

Licensed under the MIT license.