compliment icon indicating copy to clipboard operation
compliment copied to clipboard

Clojure completion library that you deserve

  • Compliment [[https://circleci.com/gh/alexander-yakushev/compliment][https://img.shields.io/circleci/project/github/alexander-yakushev/compliment/master.svg]] [[https://coveralls.io/r/alexander-yakushev/compliment?branch=master][https://coveralls.io/repos/alexander-yakushev/compliment/badge.svg?branch=master]] [[https://clojars.org/compliment][https://versions.deps.co/alexander-yakushev/compliment/downloads.svg]] [[https://versions.deps.co/alexander-yakushev/compliment][https://versions.deps.co/images/up-to-date.svg]] [[CHANGELOG.md][https://img.shields.io/badge/-changelog-blue.svg]]

    Compliment is the ultimate Clojure completion library. It provides a fast and smart solution to complete vars, namespaces, class members, keywords, locals. It also allows users to implement custom completion sources.

    Compliment is used as a completion backend in the following editors/IDEs:

    • Emacs --- [[https://cider.readthedocs.io/en/latest/code_completion/][CIDER]] (through [[http://company-mode.github.io/][company-mode]] or, now deprecated, [[https://github.com/clojure-emacs/ac-cider][ac-cider]])
    • Vim --- [[https://github.com/tpope/vim-fireplace][vim-fireplace]] and [[https://liquidz.github.io/vim-iced/][vim-iced]]
    • Neovim --- [[https://github.com/Olical/conjure][Conjure]]
    • Visual Studio Code --- [[https://calva.io/][Calva]]
    • Atom --- [[https://atom.io/packages/proto-repl][Proto REPL]] and [[https://atom.io/packages/chlorine][Chlorine]]
    • @bhauman's [[https://github.com/bhauman/rebel-readline/][rebel-readline]]

    Also, I am so glad you came here. You look gorgeous today.

** Rationale

I wrote Compliment specifically for you because you are amazing and I believe you deserve a matching completion lib. Here are the features it boasts:

  • Speed. Your time is too precious to wait for completion to happen. Compliment is designed to be fast and is carefully benchmarked to make sure no sudden performance drops appear.
  • Smart completion. Such a smart person like you is entitled to completion being smart as well. Default Compliment sources use various techniques to give more meaningful completion depending on the context, and allow some fuzziness in prefix.
  • Extensibility. Your insatiable passion for exploration won't be satisfied by a set in stone completion list. For this reason Compliment allows every library developer to write custom sources, so later other users of the library will have better experience utilizing it.

** Installation

If you use vim-fireplace, or Atom, then you don't have to install anything at all --- Compliment will already be there for you. In case you are an Emacs+CIDER user you'll also need to install [[http://company-mode.github.io/][company-mode]] and [[https://github.com/expez/company-quickhelp][company-quickhelp]] for optimal results. This [[https://docs.cider.mx/cider/usage/code_completion.html][guide]] will help you configure it.

If you need Compliment embedded directly into your program then add this to the =:dependencies=:

[[https://clojars.org/compliment][https://clojars.org/compliment/latest-version.svg]]

** Examples

[[https://github.com/alexander-yakushev/compliment/wiki/Examples][Here]] you can find examples of different completion scenarios Compliment supports so far.

You can advise Compliment to provide special treatment for certain Vars by attaching metadata to them. See the [[https://github.com/alexander-yakushev/compliment/wiki/Metadata][Metadata]] page for details.

** For developers

See the test files to get an idea how public API and completion sources work.

To understand what is a context and how it works see the [[https://github.com/alexander-yakushev/compliment/wiki/Context][Context]] wiki page.

How to write your own sources is explained on the [[https://github.com/alexander-yakushev/compliment/wiki/Custom-sources][Custom sources]] page.

** License

Copyright © 2013-2022 Alexander Yakushev. Distributed under the Eclipse Public License, the same as Clojure. See [[https://github.com/alexander-yakushev/compliment/blob/master/LICENSE][LICENSE]].