All Projects → esamattis → Slimux

esamattis / Slimux

Licence: other
SLIME inspired tmux integration plugin for Vim

Labels

Projects that are alternatives of or similar to Slimux

Eternalterminal
Re-Connectable secure remote shell
Stars: ✭ 2,191 (+953.37%)
Mutual labels:  tmux
Neovim Config
Neovim configuration
Stars: ✭ 180 (-13.46%)
Mutual labels:  tmux
Dotfiles
My dotfiles: Experimental, ongoing configuration files, development environment and scripts for various Unix-like systems, text-based command-line applications and interfaces.
Stars: ✭ 185 (-11.06%)
Mutual labels:  tmux
Tmux 1password
🔑 Access your 1Password login items within tmux!
Stars: ✭ 167 (-19.71%)
Mutual labels:  tmux
Powerline
Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.
Stars: ✭ 12,989 (+6144.71%)
Mutual labels:  tmux
Fast Ide
🕺Fast Integrated Development Environment 😻
Stars: ✭ 181 (-12.98%)
Mutual labels:  tmux
Tmux Bash Completion
Tmux bash completion
Stars: ✭ 153 (-26.44%)
Mutual labels:  tmux
Tmux Gruvbox
Gruvbox color scheme for Tmux.
Stars: ✭ 204 (-1.92%)
Mutual labels:  tmux
Dotfiles
🔩 Dotfiles for bash, zsh, tmux, emacs, vim, etc
Stars: ✭ 175 (-15.87%)
Mutual labels:  tmux
Tmux Onedark Theme
A dark tmux color scheme inspired by Atom's One Dark syntax theme.
Stars: ✭ 183 (-12.02%)
Mutual labels:  tmux
Tmux Gitbar
Git in your tmux status bar
Stars: ✭ 167 (-19.71%)
Mutual labels:  tmux
Dotfiles
vim, zsh, git, homebrew, nvm, neovim - my whole world
Stars: ✭ 2,217 (+965.87%)
Mutual labels:  tmux
Gitmux
💻 Git in your tmux status bar
Stars: ✭ 180 (-13.46%)
Mutual labels:  tmux
Sendcode
Send code and text to macOS and Linux Terminals, iTerm, ConEmu, Cmder, Tmux, Terminus; R (RStudio), Julia, IPython.
Stars: ✭ 166 (-20.19%)
Mutual labels:  tmux
Smug
A session manager for tmux written in Go
Stars: ✭ 200 (-3.85%)
Mutual labels:  tmux
Vimux
easily interact with tmux from vim
Stars: ✭ 1,980 (+851.92%)
Mutual labels:  tmux
Dotfiles
My [NeoVim + Tmux + Fish Shell] Setup /w install scripts
Stars: ✭ 180 (-13.46%)
Mutual labels:  tmux
Dotfiles
Ninrod's sharpened dotfiles for emacs, vim, zsh, tmux. Since '15.
Stars: ✭ 208 (+0%)
Mutual labels:  tmux
.tmux
🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
Stars: ✭ 15,594 (+7397.12%)
Mutual labels:  tmux
Teamocil
There's no I in Teamocil. At least not where you think. Teamocil is a simple tool used to automatically create windows and panes in tmux with YAML files.
Stars: ✭ 2,179 (+947.6%)
Mutual labels:  tmux

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:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].