GithubHelp home page GithubHelp logo

agentcoops / osx-dictionary.el Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuchunyang/osx-dictionary.el

0.0 1.0 0.0 141 KB

Mac OS X Dictionary.app interface for Emacs

Emacs Lisp 55.74% MATLAB 44.26%

osx-dictionary.el's Introduction

OSX Dictionary.app interface for Emacs


MELPA

Introduction

osx-dictionary is inspired by dictionary.vim. osx-dictionary provides functions which invoke Dictionary.app from Mac OS X.

Notes: translation between Chinese and English is well supported.

Requirement

If you don't use Chinese, no needs to care about it, features provided by chinese-word-at-point is disabled by default.

Install

osx-dictionary is available on Melpa, and that's the recommended way of installing it, i.e.

M-x package-install RET osx-dictionary RET

In this way, the requirement, chinese-word-at-point, will be installed automatically.

Usage

Below are commands you can use:

  • osx-dictionary-search-input Search input word and display result with buffer
  • osx-dictionary-search-pointer Search word around and display result with buffer

GNU Emacs itself has no idea what a Chinese word is, If you want Emacs to get Chinese word under the cursor, you have to set osx-dictionary-use-chinese-text-segmentation to t by yourself. Please refer to chinese-word-at-point for more info.

Below is my configuration for this package:

;; Support Chinese word
(setq osx-dictionary-use-chinese-text-segmentation t)

;; Key bindings
(global-set-key (kbd "C-c d") 'osx-dictionary-search-pointer)
;; (global-set-key (kbd "C-c i") 'osx-dictionary-search-input)

;; Work with popwin-el (https://github.com/m2ym/popwin-el)
;; (push "*osx-dictionary*" popwin:special-display-config)

Here is a screenshot of a sample usage: Imgur

Todo

  • Save search history
  • Improve regex for highlight
    • Add more keywords, for example, "名" and "代"
    • Adopt more precise matching
  • Use Chinese text segmentation for better Chinese translation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.