Code Monkey home page Code Monkey logo

vim-slime's Introduction

vim-slime

Demo

vim-slime session with R

What is vim-slime?

What is SLIME?

SLIME is an Emacs plugin to turn Emacs into a Lisp IDE. You can type text
in a file, send it to a live REPL, and avoid having to reload all your code
every time you make a change.

So, what is vim-slime?

vim-slime is a humble attempt at getting _some_ of the SLIME features into Vim.
It works with any REPL and isn't tied to Lisp.

Grab some text and send it to a target:

vim-slime sends text to a REPL through a target

The target contains a REPL, maybe Clojure, R or python. If you can type text into it, vim-slime can send text to it.

Why do this? Because you want the benefits of a REPL (instant feedback, no need to reload ...) and the benefits of using Vim (familiar environment, syntax highlighting, persistence ...).

More details in the blog post.

Targets

Configure vim-slime for your desired target:

" for all buffers
let g:slime_target = "tmux"

" and/or as a buffer-level override
let b:slime_target = "wezterm"

" if not explicitly configured, it defaults to `screen`

Many targets are supported, check their documentation for details:

Installation

Use your favorite package manager, or use Vim's built-in package support (since Vim 7.4.1528):

mkdir -p ~/.vim/pack/plugins/start
cd ~/.vim/pack/plugins/start
git clone https://github.com/jpalardy/vim-slime.git

You can try vim-slime in Docker before committing to anything else.

Usage

Put your cursor over the text you want to send and type:

ctrl-c ctrl-c --- the same as slime

(You can just hold ctrl and double-tap c.)

The current paragraph — what would be selected if you typed vip — is automatically selected.

To control exactly what is sent, you can manually select text before calling vim-slime.

Vim Style Mappings

To send text using vim-style mappings, such as slime operator+motion or slime operator+text object see the appropriate section of the advanced configuration documentation.

Config prompt

vim-slime needs to know where to send your text, it will prompt you. It will remember your answers and won't prompt you again.

If you want to reconfigure, type:

ctrl-c v --- mnemonic: "variables"

or call:

:SlimeConfig

Language Support

vim-slime might have to modify its behavior according to the language or REPL you want to use.

Many languages are supported without modifications, while others might tweak the text without explicit configuration:

Advanced Configuration

If plain vim-slime isn't doing exactly what you want, have a look at advanced configuration.

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.