Giter VIP home page Giter VIP logo

inf-clojure's Introduction

License GPL 3 MELPA MELPA Stable

inf-clojure

This package provides basic interaction with a Clojure subprocess (REPL). It's based on ideas from the popular inferior-lisp package.

inf-clojure has two components - a nice Clojure REPL with auto-completion and a minor mode (inf-clojure-minor-mode), which extends clojure-mode with commands to evaluate forms directly in the REPL.

For a more powerful/full-featured solution see CIDER.

Installation

Available on all major package.el community maintained repos - MELPA Stable and MELPA repos.

MELPA Stable is recommended as it has the latest stable version. MELPA has a development snapshot for users who don't mind breakage but don't want to run from a git checkout.

You can install inf-clojure using the following command:

M-x package-install [RET] inf-clojure [RET]

or if you'd rather keep it in your dotfiles:

(unless (package-installed-p 'inf-clojure)
  (package-refresh-contents)
  (package-install 'inf-clojure))

If the installation doesn't work try refreshing the package list:

M-x package-refresh-contents

Add the following to your Emacs config to enable inf-clojure-minor-mode for Clojure source buffers:

(add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)

Don't enable inf-clojure-minor-mode and cider-mode at the same time. They have overlapping functionality and keybindings and the result will be nothing short of havoc.

Usage

M-x inf-clojure or C-c C-z within a Clojure source file.

inf-clojure-program is a custom variable that defines a program to run or the tcp socket to connect to when starting inf-clojure. By default this variable is set to lein repl, which will start a REPL via Leiningen. However, it is possible to use a cons pair like ("localhost" . 5555) to connect to a socket REPL like the one provided with planck, which can be started from the command line with planck -n 5555.

Use C-u C-c C-z to start a REPL with a different command/cons pair than the default specified in inf-clojure-program.

ElDoc

eldoc-mode is supported in Clojure source buffers and *inferior-clojure* buffers which are running a Clojure REPL.

When ElDoc is enabled and there is an active REPL, it will show the argument list of the function call you are currently editing in the echo area.

You can activate ElDoc with M-x eldoc-mode or by adding the following to you Emacs config:

(add-hook 'clojure-mode-hook #'eldoc-mode)
(add-hook 'inf-clojure-mode-hook #'eldoc-mode)

ElDoc currently doesn't work with ClojureScript buffers and REPL's. You can leave it enabled, it just won't show anything in the echo area.

Troubleshooting

REPL not responsive in Windows OS

In Windows, the REPL is not returning anything. For example, type (+ 1 1) and press ENTER, the cursor just drops to a new line and nothing is shown.

The explanation of this problem and solution can be found here.

The solution is to create a file named .jline.rc in your $HOME directory and add this line to that file:

jline.terminal=unsupported

License

Copyright © 2014-2016 Bozhidar Batsov and contributors.

Distributed under the GNU General Public License; type C-h C-c to view it.

inf-clojure's People

Contributors

bbatsov avatar otijhuis avatar syohex avatar arichiardi avatar mavbozo avatar slipset avatar mahinshaw avatar ayato-p avatar oyvindstegard 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.