• Stars
    star
    1,739
  • Rank 25,664 (Top 0.6 %)
  • Language
    Vim Script
  • Created over 11 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

fireplace.vim: Clojure REPL support

fireplace.vim

There's a REPL in Fireplace, but you probably wouldn't have noticed if I hadn't told you. Such is the way with fireplace.vim. By the way, this plugin is for Clojure.

Installation

First, set up cider-nrepl. (If you skip this step, only a subset of functionality will be available.)

Install Fireplace using your favorite package manager, or use Vim's built-in package support:

mkdir -p ~/.vim/pack/tpope/start
cd ~/.vim/pack/tpope/start
git clone https://tpope.io/vim/fireplace.git
vim -u NONE -c "helptags fireplace/doc" -c q

You might also want salve.vim for assorted static project support.

Features

This list isn't exhaustive; see the :help for details.

Transparent setup

Fireplace talks to nREPL. With Leiningen and Boot, it connects automatically using the .nrepl-port file created when you run lein repl or boot repl. If you are starting nREPL some other way, run :FireplaceConnect host:port. You can connect to multiple instances of nREPL for different projects, and it will use the right one automatically. ClojureScript support is just as seamless with Piggieback.

If you're using the new Clojure CLI, you can follow the instructions for running cider-nrepl with clj. Briefly, clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.21.1"} }}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" should do the trick. The cider-nrepl docs also show you how you can add an alias to your user's ~/.clojure/deps.edn file, letting you more simply run clj -A:cider-clj.

Oh, and if you don't have an nREPL connection, installing salve.vim lets it fall back to using java clojure.main for some of the basics, using a class path based on your Leiningen or Boot config. It's a bit slow, but a two-second delay is vastly preferable to being forced out of my flow for a single command, in my book.

Not quite a REPL

You know that one plugin that provides a REPL in a split window and works absolutely flawlessly, never breaking just because you did something innocuous like backspace through part of the prompt? No? Such a shame, you really would have liked it.

I've taken a different approach in Fireplace. cq (Think "Clojure Quasi-REPL") is the prefix for a set of commands that bring up a command-line window β€” the same thing you get when you hit q: β€” but set up for Clojure code.

cqq prepopulates the command-line window with the expression under the cursor. cqc gives you a blank line in insert mode.

Evaluating from the buffer

Standard stuff here. :Eval evaluates a range (:%Eval gets the whole file), :Require requires a namespace with :reload (:Require! does :reload-all), either the current buffer or a given argument. :RunTests kicks off (clojure.test/run-tests) and loads the results into the quickfix list.

There's a cp operator that evaluates a given motion (cpp for the innermost form under the cursor). cm and c1m are similar, but they only run clojure.walk/macroexpand-all and macroexpand-1 instead of evaluating the form entirely.

Any failed evaluation loads the stack trace into the location list, which can be easily accessed with :lopen.

Navigating and Comprehending

I was brand new to Clojure when I started this plugin, so stuff that helped me understand code was a top priority.

  • :Source, :Doc, and :FindDoc, which map to the underlying clojure.repl macro (with tab complete, of course).

  • K is mapped to look up the symbol under the cursor with doc.

  • [d is mapped to look up the symbol under the cursor with source.

  • [<C-D> jumps to the definition of a symbol (even if it's inside a jar file). <C-]> does the same and uses the tag stack.

  • gf, everybody's favorite "go to file" command, works on namespaces.

Where possible, I favor enhancing built-ins over inventing a bunch of <Leader> maps.

Omnicomplete

Because why not? It works in the quasi-REPL too.

FAQ

Why does it take so long for Vim to start up?

That's either classpath.vim or salve.vim.

Self-Promotion

Like fireplace.vim? Follow the repository on GitHub and vote for it on vim.org. And if you're feeling especially charitable, follow tpope on Twitter and GitHub.

License

Copyright Β© Tim Pope. Distributed under the same terms as Vim itself. See :help license.

More Repositories

1

vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
Vim Script
19,128
star
2

vim-surround

surround.vim: Delete/change/add parentheses/quotes/XML-tags/much more with ease
Vim Script
12,968
star
3

vim-pathogen

pathogen.vim: manage your runtimepath
Vim Script
12,086
star
4

vim-commentary

commentary.vim: comment stuff out
Vim Script
5,661
star
5

vim-sensible

sensible.vim: Defaults everyone can agree on
Vim Script
5,038
star
6

vim-rails

rails.vim: Ruby on Rails power tools
Vim Script
4,067
star
7

vim-unimpaired

unimpaired.vim: Pairs of handy bracket mappings
Vim Script
3,213
star
8

vim-dadbod

dadbod.vim: Modern database interface for Vim
Vim Script
3,169
star
9

vim-abolish

abolish.vim: Work with several variants of a word at once
Vim Script
2,662
star
10

vim-dispatch

dispatch.vim: Asynchronous build and test dispatcher
Vim Script
2,589
star
11

vim-repeat

repeat.vim: enable repeating supported plugin maps with "."
Vim Script
2,536
star
12

vim-vinegar

vinegar.vim: Combine with netrw to create a delicious salad dressing
Vim Script
2,184
star
13

vim-eunuch

eunuch.vim: Helpers for UNIX
Vim Script
1,773
star
14

vim-sleuth

sleuth.vim: Heuristically set buffer options
Vim Script
1,771
star
15

vim-obsession

obsession.vim: continuously updated session files
Vim Script
1,684
star
16

vim-markdown

Vim Markdown runtime files
Vim Script
1,215
star
17

vim-endwise

endwise.vim: Wisely add
Vim Script
1,090
star
18

vim-projectionist

projectionist.vim: Granular project configuration
Vim Script
1,030
star
19

vim-rhubarb

rhubarb.vim: GitHub extension for fugitive.vim
Vim Script
916
star
20

vim-speeddating

speeddating.vim: use CTRL-A/CTRL-X to increment dates, times, and more
Vim Script
911
star
21

timl

Clojure like language which compiles down to VimL
Vim Script
683
star
22

vim-scriptease

scriptease.vim: A Vim plugin for Vim plugins
Vim Script
668
star
23

dotfiles

tpope's dotfiles. DON'T USE unless you're tpope
Vim Script
608
star
24

vim-haml

Vim runtime files for Haml, Sass, and SCSS
Vim Script
596
star
25

vim-git

Vim Git runtime files
Vim Script
588
star
26

vim-rsi

rsi.vim: Readline style insertion
Vim Script
560
star
27

heroku-fucking-console

When I run heroku console, I want a fucking console, dammit
Ruby
559
star
28

hookup

Automate the bundle/migration tedium of Rails with Git hooks
Ruby
478
star
29

vim-sexp-mappings-for-regular-people

vim-sexp mappings for regular people
Vim Script
426
star
30

gem-ctags

Automatic ctags generation on gem install
Ruby
395
star
31

vim-bundler

bundler.vim: Lightweight support for Ruby's Bundler
Vim Script
394
star
32

vim-tbone

tbone.vim: tmux basics
Vim Script
389
star
33

gem-shut-the-fuck-up

Gem SHUT THE FUCK UP
Ruby
377
star
34

vim-ragtag

ragtag.vim: ghetto HTML/XML mappings (formerly allml.vim)
Vim Script
354
star
35

vim-jdaddy

jdaddy.vim: JSON manipulation and pretty printing
Vim Script
352
star
36

vim-cucumber

Vim Cucumber runtime files
Vim Script
321
star
37

vim-vividchalk

vividchalk.vim: a colorscheme strangely reminiscent of Vibrant Ink for a certain OS X editor
Vim Script
313
star
38

pickler

PIvotal traCKer Liaison to cucumbER
Ruby
300
star
39

vim-characterize

characterize.vim: Unicode character metadata
Vim Script
281
star
40

git-bump

Create Git release commits and tags with changelogs
Ruby
256
star
41

fivemat

MiniTest/RSpec/Cucumber formatter that gives each test file its own line of dots
Ruby
244
star
42

vim-rake

rake.vim: it's like rails.vim without the rails
Vim Script
239
star
43

vim-flagship

flagship.vim: Configurable and extensible tab line and status line
Vim Script
226
star
44

gem-browse

gem edit, gem open, gem clone, gem browse
Ruby
221
star
45

vim-salve

salve.vim: static support for Leiningen and Boot
Vim Script
197
star
46

vim-dotenv

dotenv.vim: Basic support for .env and Procfile
Vim Script
185
star
47

vim-apathy

apathy.vim: Set the 'path' option for miscellaneous file types
Vim Script
180
star
48

vim-afterimage

afterimage.vim: edit binary files by converting them to text equivalents
Vim Script
161
star
49

vim-capslock

capslock.vim: Software caps lock
Vim Script
151
star
50

rbenv-ctags

Automatically generate ctags for rbenv Ruby stdlibs
Shell
147
star
51

rbenv-aliases

Create aliases for rbenv Ruby versions
Shell
128
star
52

vim-liquid

Vim Liquid runtime files with Jekyll enhancements
Vim Script
126
star
53

vim-rvm

rvm.vim: Switch Ruby versions from inside Vim
Vim Script
119
star
54

rbenv-communal-gems

Share gems across multiple rbenv Ruby installs
Shell
119
star
55

vim-classpath

classpath.vim: Set 'path' from the Java class path
Vim Script
111
star
56

rumember

Remember The Milk Ruby API and command line interface
Ruby
106
star
57

vim-heroku

heroku.vim: Heroku CLI wrapper
Vim Script
104
star
58

heroku-binstubs

Create binstubs to easily dispatch the heroku command for specific apps
Ruby
94
star
59

vim-haystack

haystack.vim: fuzzy matching algorithm
Vim Script
74
star
60

vim-rbenv

rbenv.vim: Minimal rbenv support
Vim Script
69
star
61

rbenv-readline

Automatically link rbenv Ruby installs to readline on OS X
Shell
64
star
62

heroku-wildcards

Run a Heroku command across multiple apps
Ruby
52
star
63

rails-default-database

Make database.yml optional in Rails
Ruby
48
star
64

heroku-pgbackups-pull

Import a Heroku PostgreSQL backup into your Rails development database
Ruby
47
star
65

pry-editline

C-x C-e to invoke an editor on the current pry (or irb) line
Ruby
47
star
66

heroku-surrogate

Run commands locally using a Heroku app's environment variables
Ruby
41
star
67

lein-dotenv

Leiningen plugin to merge .env into environment variables
Clojure
35
star
68

heroku-remote

Commands for working with (multiple) Heroku remotes
Ruby
28
star
69

vim-flatfoot

flatfoot.vim: experimental enhancement of "f" and "t" keys
Vim Script
26
star
70

ldaptic

Object-oriented schema-aware LDAP wrapper for Ruby
Ruby
24
star
71

chrome-defenestration

JavaScript
19
star
72

mta-settings

Configure ActionMailer or Mail delivery settings based on the environment
Ruby
12
star
73

zerbo

Zeo Personal Sleep Coach Ruby Interface
Ruby
12
star
74

girth

Git Interactive Ruby Toolset . . . Hippopotamus?
Ruby
10
star
75

.github

this doesn't work does it?
10
star
76

artifice-passthru

Artifice extension that allows you to let certain requests pass thru to use HTTP
Ruby
8
star
77

rbenv-sentience

Make rbenv self aware
Shell
8
star
78

rack-taint

Rack middleware to taint incoming data
Ruby
7
star
79

tpope.github.com

5
star