Git Product home page Git Product logo

browser-connect.vim's Introduction

This plugin implements a VIM interface for browser-connect-server in order to provide a live coding environment similar to the one currently available in LightTable.

If you would like to see it in action, a (very crude) demo video is available here.

Installation

Use pathogen (or Vundle) and clone this repository into your ~/.vim/bundle directory. That's it, you're good to go.

Usage

Copy the following code snippet into your template and open it inside of a (modern) browser. Make sure that you have VIM running before you do so.

<script src="http://localhost:9001/ws"></script>

After doing so, you should be able to evaluate CSS buffers and JS buffers using <LocalLeader>be as well as selections of JS. The changes should be instantly reflected in your browser. Whenever you save a JS file or an HTML page, the template will be fully refreshed, you can also refresh the template without having to save the file using <LocalLeader>br.

Notes

If you installed the plugin someplace other than ~/.vim/bundle/browser-connect.vim you will have to paste the following snippet into your .vimrc file and update the path to reflect the actual location of the browser-connect.vim folder.

let g:bc_server_path = "/home/me/.vim/bundle/browser-connect.vim/server"

To disable the plugin from setting its own mappings, paste the following into your .vimrc file:

let g:bc_no_mappings = 1

You can set your LocalLeader key to be , by doing:

let maplocalleader = ","

If you would like to map your own keys to evaluate buffers, map them to the following commands:

vmap <silent><LocalLeader>be :BCEvaluateSelection<CR>
nmap <silent><LocalLeader>be :BCEvaluateBuffer<CR>
nmap <silent><LocalLeader>br :BCReloadPage<CR>

To disable automatic behavior on save add the following to your .vimrc file:

let g:bc_no_au = 1

Windows

To run the plugin on Windows you must start the server yourself by going into the browser-connect.vim/server folder and running the following command: start.bat "-Dhttp.port=9001".

Requirements

  • VIM 7.0+ compiled with +python
  • Python 2.6+
  • Java 7+

browser-connect.vim's People

Contributors

bogdanp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

gamont

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.