_ _
/ \ / \
| V |
>>>-VIM-------- /------->
\ TMUX /
\ /
\ /
\ /
V
WARNING: This plugin is still in development, and may stuck in this state for ever. If you need something stable and robust you can check out these projects that inspired msg2tmux in the first place.
Transform markdown documents into interactive notebooks with vim
and tmux
.
msg2tmux
is supposed to be a simple and stupid lightweight alternative to nvim-R
with some extra features, like supporting code blocks in non-r-markdown files, and multiple other languages, like javascript
, bash
, python
(but it doesn't support .ipynb
files, and doesn't plan to due to technical limitations).
This plugin requires tmux, so if you'r not a tmux user that could be a deal breaker.
This plugin is not as robust and stable as other more matured and specialised tools. Here are some good alternatives, that were the inspirations of this project:
- Nvim-R: for working with
R
(and R markdown documents) - Vimux: Interact with
tmux
panes from vim - tslime.vim: "a simple vim script to send portion of text from a vim buffer to a running tmux session" (from their GitHub page)
This plugin can interact reliably with the following shells:
R
radian
- with the following caveat:- Bracket completion must be disabled (
options.radian.auto_match = FALSE
). Check out the docs of radian on modyfing the settings here.
- Bracket completion must be disabled (
bash
ipython
General caveats:
- As a workaround for some technical problems with the how the shells handle new lines, this plugin sends unnecessary
Enter
keystrokes to the targeted pane in some cases.
python
R
javascript
bash
The python
shell is not supported, and I'm not planning to work on it in the future.
Compatible with both vim
(from version 8.0
and above) and nvim
.
Use your preferred plugin manager, I use vim-plug
:
Plug 'fulopkovacs/msg2tmux'
Plug 'fulopkovacs/msg2tmux'
You must run vim
in a tmux session
===========================================================
GENERAL
<LocalLeader>we Send the visual selection to the next
tmux pane
===========================================================
MARKDOWN, R-MARKDOWN
<LocalLeader>jj Jump to next code block
<LocalLeader>kk Jump to previous code block
<LocalLeader>cc Execute the current code block in
the next tmux pane
<LocalLeader>pp Execute the current and all previous
code blocks in the next tmux pane
<LocalLeader>aa Execute every code block of the document
from the first to the last one in the
next tmux pane
<LocalLeader>cl Sends the `C-l` keystroke to the next tmux
pane (usually it clears it)