Git Product home page Git Product logo

company-emoji's Introduction

company-emoji.el

Melpa Status Melpa Stable Status

company-mode backend providing autocompletion for emoji. 🆒💦

setup

Add company-emoji.el to your load-path, then add something like the following to your init file:

(require 'company-emoji)
(add-to-list 'company-backends 'company-emoji)

After selecting an emoji-word from the completion-list, it will be replaced by the real unicode emoji (:cactus: becomes 🌵, :cat: becomes 🐱, etc.)

emoji font support

If you’re on Linux, or on Mac OS X and using the Cocoa version of Emacs (i.e., if built ‐-with-ns, or --with-cocoa using Homebrew), you’ll need to add something like this to your init file (thanks to @syohex and @waymondo):

(defun --set-emoji-font (frame)
  "Adjust the font settings of FRAME so Emacs can display emoji properly."
  (if (eq system-type 'darwin)
      ;; For NS/Cocoa
      (set-fontset-font t 'symbol (font-spec :family "Apple Color Emoji") frame 'prepend)
    ;; For Linux
    (set-fontset-font t 'symbol (font-spec :family "Symbola") frame 'prepend)))

;; For when Emacs is started in GUI mode:
(--set-emoji-font nil)
;; Hook for when a frame is created with emacsclient
;; see https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Frames.html
(add-hook 'after-make-frame-functions '--set-emoji-font)

Symbola can be installed with apt-get:

apt-get install ttf-ancient-fonts

NB: The set-fontset-font function is apparently only available when Emacs has been compiled with a window system.

custom variables

aliases

You can add shortcode aliases by modifying company-emoji-aliases. Run M-x customize-variable [RET] company-emoji-aliases to bring up company-emoji’s customization pane, then add or remove aliases to your taste:

Hide Company Emoji Aliases:
[INS] [DEL] Symbol: :woman_man_holding_hands:
            String: :couple:
[INS]

(“Symbol” designates the user-defined alias, and “string” designates the original shortcode you want your alias to mimick.)

Occasionally new default aliases may be added. If you’re upgrading and have modified the company-emoji-aliases variable, the new aliases will be ignored; you’ll need to add them manually.

unicode replacement

By default, :cat: is replaced with 🐱 upon completion, but that can be turned off by setting the variable company-emoji-insert-unicode to nil.

contributing

Contributions are very welcome! But please don’t edit company-emoji-list.el directly: it’s generated by build/generate-list.rb, so you should modify that build script then run make company-emoji-list.el.

company-emoji's People

Contributors

dunn avatar syohex avatar torgeir avatar chobbes avatar ggreif avatar

Watchers

James Cloos avatar  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.