Code Monkey home page Code Monkey logo

vim-script-runner's Introduction

About

script-runner is a vim plugin that lets you easily and quickly run a perl, python, ruby, bash, etc. script. Just hit F5 and it runs your script and outputs the results in a split window at the bottom. Note that you don't even have to save your script first. You can just open a scratch buffer, type some code and hit F5.

Installation

Pathogen Install

If you have the pathogen plugin installed, you can just clone this project inside your ~/.vim/bundle folder

Script Install

bash install.sh

Manual Install

cp plugin/script-runner.vim ~/.vim/plugin

Usage

normal mode: F5

command mode: :sx

Advanced

If you want to change the default key mapping of F5, add this to your .vimrc:

let g:script_runner_key = '<F6>'

You can run a custom command based on the type of script you are working on. For example, if you want the Data::Dump module available each time you run a perl script, add this to your .vimrc:

let g:script_runner_perl = 'perl -MData::Dump'

To run a specific version of ruby:

let g:script_runner_ruby = '/usr/local/bin/ruby1.9'

Currently, script-runner will format xml and json file types. You must have xmllint and JSON::PP installed. On a debian based system, you can install those via:

sudo apt-get install libxml2-utils
sudo cpan JSON::PP

For json support, you may need to add the following to your .vimrc.

autocmd BufEnter *.json set ft=json

Contributors

vim-script-runner's People

Contributors

ironcamel avatar throughnothing avatar

Watchers

Jeff Schroeder avatar James Cloos avatar  avatar

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.