Coder Social home page Coder Social logo

0xc22b / emacs-company-dict Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hlissner/emacs-company-dict

0.0 0.0 0.0 24 KB

A port of ac-source-dictionary to company-mode, plus annotation and documentation support.

License: MIT License

Emacs Lisp 100.00%

emacs-company-dict's Introduction

MIT MELPA MELPA Stable

Company Dictionary

This simple company backend emulates ac-source-dictionary and vim's dictionary omnicompletion (C-x C-k). It's much like company-keywords, but with lazy-loaded dictionary files, and support for annotations and documentation.

  • It is meant as an alternative to company-keywords.
  • A dictionary is a plaintext file named after the major-mode in which it should be active.
  • The dictionary file all applies to all modes.
  • This file is a newline-delimited list of keywords.
  • Each keyword is tab-delimited in the following format: [keyword] [[annotation] [documentation]]
    • e.g. os.path.basename [function] Return the base name of pathname path
    • Screenshot
    • NOTE: the parser squashes multiple tab characters, so use as many tabs as you'd like to organize your dictionary files.

Installation

M-x package-install RET company-dict

Usage

(require 'company-dict)

;; Where to look for dictionary files. Default is ~/.emacs.d/dict
(setq company-dict-dir (concat user-emacs-directory "dict/"))

;; Optional: if you want it available everywhere
(add-to-list 'company-backends 'company-dict)

;; Optional: evil-mode users may prefer binding this to C-x C-k for vim
;; omni-completion-like dictionary completion
(define-key evil-insert-state-map (kbd "C-x C-k") 'company-dict)

Add minor mode symbols to company-dict-minor-mode-list to make company-dict aware of minor mode dictionaries.

Yasnippet integration

company-dict autocompletions are automatically expanded like they're yasnippet snippets if yasnippet is installed and yas-minor-mode is enabled in the current buffer.

Yasnippet is not a dependency of company-dict, so you must install and enable it yourself. Which can be done through MELPA: M-x package-install RET yasnippet

To disable this behavior, set company-dict-enable-yasnippet to nil

Configuration

  • company-dict-minor-mode-alist
  • company-dict-dir
  • company-dict-minor-mode-alist
  • company-dict-enable-fuzzy
  • company-dict-enable-yasnippet

emacs-company-dict's People

Contributors

hlissner avatar 0xc22b avatar swarnendubiswas avatar syohex avatar

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.