Code Monkey home page Code Monkey logo

ac-nrepl's Introduction

nrepl completion source for Emacs auto-complete package

This plugin provides a completion source for the popular Emacs interactive auto-completion framework auto-complete.

Where nrepl provides it, pop-up documentation for completed symbols will be displayed.

Latest stable version: see the latest numbered tag, which will also be the latest version available via Marmalade.

Installation

First, ensure auto-complete and nrepl are installed: I recommend using packages from Marmalade or Melpa.

You'll need both auto-complete and nrepl to be enabled and working, so please consult the corresponding documentation is you have any trouble with this.

Next, install ac-nrepl. If you choose not to use the convenient package in Melpa and Marmalade, you'll need to add the directory containing ac-nrepl.el to your load-path, and then (require 'ac-nrepl).

ac-nrepl provides an nrepl-specific completion source, so auto-complete needs to be told to use them when nrepl-mode is active. To do this, put the following code in your emacs init file to

 (require 'ac-nrepl)
 (add-hook 'nrepl-mode-hook 'ac-nrepl-setup)
 (add-hook 'nrepl-interaction-mode-hook 'ac-nrepl-setup)
 (eval-after-load "auto-complete"
   '(add-to-list 'ac-modes 'nrepl-mode))

If you want to trigger auto-complete using TAB in nrepl buffers, you may want to put auto-complete into your completion-at-point-functions:

(defun set-auto-complete-as-completion-at-point-function ()
  (setq completion-at-point-functions '(auto-complete)))
(add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point-function)

(add-hook 'nrepl-mode-hook 'set-auto-complete-as-completion-at-point-function)
(add-hook 'nrepl-interaction-mode-hook 'set-auto-complete-as-completion-at-point-function)

You might consider using ac-nrepl's popup documentation in place of nrepl-doc:

(define-key nrepl-interaction-mode-map (kbd "C-c C-d") 'ac-nrepl-popup-doc)

Usage

ac-nrepl should now automatically be enabled when you visit a buffer in which nrepl-mode is active and auto-complete is enabled. (The symbols "nrepl and "AC" should appear in the modeline.)

Simply trigger auto-completion, and completion candidates supplied by nrepl should be displayed, with symbols on the right hand side of the completion pop-up to indicate the "flavour" of the completion candidate, e.g. "v" for variables. After a short delay, popup documentation for the completed symbol should also be displayed.

Acknowledgements

ac-nrepl was written by Steve Purcell, with important contributions from Sam Aaron.


Author links:

Steve Purcell's blog // @sanityinc on Twitter

ac-nrepl's People

Contributors

purcell avatar samaaron avatar jsnikeris avatar kingtim avatar

Watchers

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