Git Product home page Git Product logo

msg2tmux.vim's Introduction

  
            _     _
          /   \ /   \
          |    V    |
>>>-VIM--------     /------->
           \  TMUX /
            \     /
             \   /
              \ /
               V
  

[WIP] msg2tmux.vim

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.

Use cases

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.

Alternatives

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)

Compatibility with shells and caveats

This plugin can interact reliably with the following shells:

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.

Supported languages

  • python
  • R
  • javascript
  • bash

The python shell is not supported, and I'm not planning to work on it in the future.

Installation

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'

Features (and default keybindings)

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)

msg2tmux.vim's People

Contributors

fulopkovacs avatar

Watchers

 avatar

msg2tmux.vim's Issues

Escape keywords from the message string

Send literal strings instead.

# CORRECT (sends literal string)
tmux send-keys -l -t + "end"

# WRONG (sends the signal of the `end` button)
tmux send-keys -t + "end"

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.