Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Execute vim buffer in the shell and view output in split pane
Python VimL
branch: master

README.md

vim-shell-executor

A simple way to execute Vim buffer contents with a shell command and view the results in a split window.

I find this most useful for SQL queries however, this will work with any program that can be called from the shell.

The Plugin In Action

executor_demo

How It Works

The plugin provides two commands:

ExecuteBuffer
ExecuteSelction

These commands allow you to execute either the entire buffer or the visually selected region. The first line passed to the plugin is the shell command that will be used to run the remaing lines of code. For example, to run a mysql query, the first line connects to the database and the remaining lines are the query being executed.

The example shown in the .gif above:

mysql -t -u root example
select * from mysql_example_table;

Installation

Use your plugin manager of choice.

  • Pathogen
    • git clone https://github.com/JarrodCTaylor/vim-shell-executor ~/.vim/bundle/vim-shell-executor
  • Vundle
    • Add Bundle 'https://github.com/JarrodCTaylor/vim-shell-executor' to .vimrc
    • Run :BundleInstall
  • NeoBundle
    • Add NeoBundle 'https://github.com/JarrodCTaylor/vim-shell-executor' to .vimrc
    • Run :NeoBundleInstall
  • vim-plug
    • Add Plug 'https://github.com/JarrodCTaylor/vim-shell-executor' to .vimrc
    • Run :PlugInstall
Something went wrong with that request. Please try again.