• Stars
    star
    217
  • Rank 182,446 (Top 4 %)
  • Language
    Vim Script
  • License
    Other
  • Created over 12 years ago
  • Updated about 4 years ago

Reviews

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

Repository Details

SLIME inspired tmux integration plugin for Vim

NOTE: This repository is not actively maintained anymore. You have an active fork please add a comment to this issue so others can find it, thanks!

Slimux

This is a SLIME inspired tmux integration plugin for Vim. It makes it easy to interact with different tmux panes directly from Vim. It has two styles for interacting with panes. REPL and Shell styles.

REPL commands are designed to work with various Read Eval Print Loops such as python, irb (Ruby), node (Javascript), coffee (CoffeeScript) etc. This is loosely modelled after SLIME for Emacs. Shell commands are designed to work with normal shells such as bash. These are useful for running tests for example.

Main difference between these is pane configuration visibility. Each buffer has own configuration for REPL, but for Shell there is only one global configuration. The configuration is prompted from user when the commands are used for the first time. The configuration happens interactively. You will see list of available tmux panes and you can choose one by hitting enter on top of one.

Also REPL commands can have custom pre, post and escape hooks. These allows interaction with some more complex REPLs such as the CoffeeScript REPL.

This plugin borrows ideas and some code from vim-slime.

Blog post

http://esa-matti.suuronen.org/blog/2012/04/19/slimux-tmux-plugin-for-vim/

Ascii.io screencast

https://asciinema.org/a/409

Installation

Use pathogen and put files to $HOME/.vim/bundle/slimux/

Slimux requires fairly recent tmux version. Be sure you have 1.5.x or later.

REPL Commands

SlimuxREPLSendLine

Send current line to the configured pane.

SlimuxREPLSendSelection

Send last visually selected text to the configured pane.

SlimuxREPLSendBuffer

Send current buffer to the configured pane.

SlimuxREPLConfigure

Prompt pane configuration for the current buffer.

Shell Commands

SlimuxShellPrompt

Prompt for a shell command and send it to the configured tmux pane.

SlimuxShellLast

Rerun last shell command(prompts for a shell command if none was run before).

SlimuxShellRun

Specify a shell command to run directly, without the prompt:

:SlimuxShellRun rspec spec/foo_spec.rb

Suitable for mapping and other automation.

Note that you need to escape strings intended for the shell. E.g. to list files with actual asterisks in their name:

:SlimuxShellRun ls *\**

SlimuxShellConfigure [pane-id]

Select the tmux pane to which shell commands will be sent. If executed without a parameter it prompts global pane configuration for the shell commands. If called with parameter it selects the pane without user interaction, which will aid multi-pane workflows. Parameter is the tmux pane identifier in \d:\d:\d form and completed automatically with cline completion.

Sending Keys

SlimuxSendKeysPrompt

Prompt for a key sequence using the 'tmux send-keys' syntax and send it to a configured tmux pane. E.g. Lets say you want to stop the webserver currently running in a shell(ctrl+c) and restart it(assuming the command to start is 'make run-server'):

:SlimuxSendKeysPrompt
KEYS>C-C 'make run-server' Enter

or run previous command with

KEYS>Up Enter

In short, some strings such as 'C-C' or 'Enter' have special meanings, while others are sent as a sequence of character keys(in the above example, 'make run-server')

SlimuxSendKeysLast

Resends the last key sequence sent(prompts for a sequence if none was sent before).

SlimuxSendKeysConfigure

Prompt global pane configuration to send the key sequence.

Keyboard Shortcuts

Slimux does not force any shortcuts on your Vim, but here's something you can put to your .vimrc

map <Leader>s :SlimuxREPLSendLine<CR>
vmap <Leader>s :SlimuxREPLSendSelection<CR>
map <Leader>b :SlimuxREPLSendBuffer<CR>
map <Leader>a :SlimuxShellLast<CR>
map <Leader>k :SlimuxSendKeysLast<CR>

Or if you like something more Emacs Slime style try something like this:

map <C-c><C-c> :SlimuxREPLSendLine<CR>
vmap <C-c><C-c> :SlimuxREPLSendSelection<CR>

You may also add shortcuts to other commands too.

For Scheme/Racket Slimux has few extra bindings. Enable them with

let g:slimux_scheme_keybindings=1
let g:slimux_racket_keybindings=1

For more information refer to the scheme plugin header.

Adding support for new languages

Usually new there is no need to do anything. For example Ruby and Node.js REPLs works just fine out of box, but for some languages you have to do some preprocessing before the code can be sent. There are three hooks you can specify for each language.

Custom escaping function

function SlimuxEscape_<filetype>(text)
    return a:text
endfunction

Pre send hook

function SlimuxPre_<filetype>(target_pane)
endfunction

Post send hook

function SlimuxPost_<filetype>(target_pane)
endfunction

Just add these to ftplugin directory contained within this plugin (and sent a pull request on Github!). You can use Python and CoffeeScript hooks as examples.

Options

  • g:slimux_tmux_path = /path/to/your/tmux sets the path to the preferred tmux binary, if not specified, defaults to getting tmux command from path using system('command -v tmux').

  • g:slimux_select_from_current_window = 1 select panes only from current window. Defaults to 0 to select panes from all tmux panes.

  • g:slimux_pane_format customize the formatting of the panes, see the FORMATS section in man tmux.
    The string "#{pane_id}: " is always prepended to the format so Slimux can identify the selected pane.

Other Vim Slime plugins

Before I created this plugin I tried several others, but non of them satisfied me. They where too complicated or just didn't support the languages I needed. So if Slimux isn't your cup of tea, maybe one of these is:

More Repositories

1

underscore.string

String manipulation helpers for javascript
JavaScript
3,367
star
2

react-zorm

πŸͺ± Zorm - Type-safe <form> for React using Zod
TypeScript
714
star
3

node-hbsfy

Handlebars precompiler plugin for Browserify
JavaScript
257
star
4

immer-reducer

Type-safe and terse reducers with Typescript for React Hooks and Redux
TypeScript
225
star
5

piler

Deprecated Asset Manager for Node.js
CoffeeScript
148
star
6

redux-hooks

βš“ React Hooks implementation for Redux
TypeScript
96
star
7

node-promisepipe

Safely pipe node.js streams while capturing all errors to a single promise
JavaScript
80
star
8

requirejs-hbs

Simple Handlebars loader plugin for RequireJS
JavaScript
78
star
9

lean-redux

Redux state like local component state
JavaScript
78
star
10

angry-caching-proxy

Make package downloads lightning fast!
JavaScript
77
star
11

browserify-externalize

Create external Browserify bundles for lazy asynchronous loading
JavaScript
73
star
12

postcss-ts-classnames

PostCSS plugin to generate TypeScript types from your CSS class names.
TypeScript
70
star
13

jslibs

List of Javascript libraries
59
star
14

backbone.viewmaster

Few tested opinions on how to handle deeply nested views in Backbone.js focusing on modularity.
JavaScript
52
star
15

babel-plugin-ts-optchain

Babel plugin for transpiling legacy browser support to ts-optchain by removing Proxy usage.
TypeScript
30
star
16

trpc-cloudflare-worker

TypeScript
29
star
17

carcounter

Asynchronous module loading example with Browserify
JavaScript
24
star
18

redux-render-prop

Redux with render props. Typescript friendly.
TypeScript
22
star
19

source-map-peek

Peek into original source via source maps from the command line when devtools fail.
JavaScript
21
star
20

TextareaServer

Server for opening external text editors from Chrome
CoffeeScript
19
star
21

deno_karabiner

Write Complex Modifications for Karabiner-Elements using Typescript and Deno.
TypeScript
17
star
22

babel-plugin-display-name-custom

display name inference for your custom react component creators
JavaScript
15
star
23

geekslides

Remote controllable Node.js introduction slides
JavaScript
15
star
24

npm-release

Github action for npm (pre)releases
TypeScript
15
star
25

sauna.reload

Development & Issues MOVED to https://github.com/collective/sauna.reload
Python
13
star
26

TextareaConnect

Edit textareas in Google Chrome using any external editor!
CoffeeScript
13
star
27

node-clim

Console.Log IMproved for Node.js
JavaScript
12
star
28

react-simple

simple style only components for the web & native
JavaScript
9
star
29

typescript-redux-todoapp

Type-safe Boilerplate-free Redux Example
TypeScript
9
star
30

jquery.panfullsize

jQuery plugin for panning large images
JavaScript
8
star
31

neovim-config

Vim Script
8
star
32

Projectwatch

Watch file changes and run multiple css/js pre-processors from one watcher
JavaScript
8
star
33

multip

Tiny multi process init for containers written in Rust πŸ¦€
Rust
8
star
34

ts-box

Put exceptions into boxes πŸ“¦
TypeScript
8
star
35

vimconfig

Vim and other dotfiles
Vim Script
7
star
36

node-tftp

Streaming TFTP Server for node.js
JavaScript
7
star
37

yalr

YALR - Yet Another Live Reload
JavaScript
6
star
38

react-makefile

Makefile boilerplate for React.js
JavaScript
6
star
39

vscode-unsaved

Makes you actually notice when you have unsaved files
TypeScript
5
star
40

reallyexpress

Really Express extends Express with extraordinary features given by Node.js. Work in progress.
CoffeeScript
5
star
41

shell-cheatsheet

4
star
42

tmpshare

Easily share temporary files over http
JavaScript
4
star
43

ircshare

Simple service for sharing your pictures on IRC
JavaScript
3
star
44

qdomain

Promises from domains
JavaScript
3
star
45

ircshare-android

Share pictures easily in IRC from Android phone
Java
3
star
46

browserify-cs-example

Browserify v2 with CoffeeScript Source Maps
CoffeeScript
3
star
47

flysight-subtitles

Convert FlySight data files (.csv) to SubRip (.srt) subtitles.
JavaScript
3
star
48

node-handlebars-runtime

Handlebars runtime only
JavaScript
2
star
49

node-lights

Instanssi Light Server Simulator
CoffeeScript
2
star
50

flips.io

JavaScript
2
star
51

revisioncask

Version control management made simple
Python
2
star
52

subssh

Small framework for creating SSH public key based shell accounts.
Python
2
star
53

toggl-paster

I need to paste Toggl time entries into things so I made a thing.
TypeScript
2
star
54

utils

Epeli's Javascript / Typescript utilities
TypeScript
2
star
55

MAILNETD

Meta Asynchronous Irc Linked Network Email Transport Daemon
Python
1
star
56

rt

Instant tab-complete for npm scripts and Jakefiles
Rust
1
star
57

lunarvim-config

Lua
1
star
58

awesome

My Personal Awesome WM config
Lua
1
star
59

wp-graphql-todoapp

TypeScript
1
star
60

stylify

JavaScript
1
star
61

subssh_buildout

buildout for subssh development purposes
Python
1
star
62

rollsum

Just experiments with rolling checksums. Nothing to see here.
C
1
star
63

sh-thunk

Generate promise returning thunks from shell strings.
JavaScript
1
star
64

LightManager

lightmanager tool written for instanssi.org party
Java
1
star
65

konf

TypeScript
1
star
66

HAL2012

Home hack using Node.js and Raspberry Pi
CoffeeScript
1
star
67

IRCPost

Simple IRC bot with HTTP POST API
CoffeeScript
1
star
68

blog

JavaScript
1
star
69

aswyg-editor

ASWYG Editor - Also See What You Get Editor
JavaScript
1
star