Need help with bracey.vim?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

281 Stars 22 Forks GNU General Public License v2.0 268 Commits 26 Opened issues


live edit html, css, and javascript in vim

Services available


Need anything else?

Contributors list

# 178,303
27 commits
# 173,266
2 commits
# 72,101
1 commit

bracey logo

Build Status

plugin for live html, css, and javascript editing in vim

live html editing demo

live css editing

bracey highlights all the elements selected by the css rule under the cursor. Any changes to a css file will automatically reload the css file in the browser if it contains no errors

live css editing demo

evaluate javascript on save

by default when a buffer containing javascript is saved, it will be evaluated by the browser

live javascript editing demo

change page on buffer switch

bracey will always keep the last buffer with html as the current browser page

keep current buffer and current page in sync


(bracey has only been tested on linux)

Bracey follows the standard vim plugin folder structure so it should work with your plugin manager of choice * pathogen * run

git clone ~/.vim/bundle/bracey.vim
* neoBundle * add
NeoBundle 'turbio/bracey.vim'
to your
* vundle * add
Plugin 'turbio/bracey.vim'
to your
* plug * add
Plug 'turbio/bracey.vim'
to your

bracey requires nodejs to be installed, along with npm for the initial installation of dependencies. Although, in most cases, npm will probably be installed along with nodejs.

bracey does not include it's javascript dependencies in the repository and they must be downloaded separately. after the plugin has been installed, you need to install its dependencies.

  1. change into the plugins installation directory. This is different for every plugin manager but should be something like
    • cd ~/.vim/bundle/bracey.vim
      for pathogen/neoBundle/vundle
    • cd ~/.vim/plugged/bracey.vim
      for plug
  2. run
    npm install --prefix server
    • you can automate this for
      by using the following command in your
      Plug 'turbio/bracey.vim', {'do': 'npm install --prefix server'}
      . This will run the npm command every time you update the plugin as well

in order to automatically open your default browser when bracey starts, the

command must be available.


bracey won't do anything until it is explicitly called


this starts the bracey server and optionally opens your default web browser to bracey's address. if you have an html file open as your current buffer, it will be displayed and you may begin editing it live.


will shutdown the server and stop sending commands


force the current web page to be reloaded

:BraceyEval [args]

if argument(s) are given then evaluate them as javascript in the browser. Otherwise, evaluate the entire buffer (regardless of its filetype).



default: 0 * (string) command used to launch browser * 0 if it should be detected automatically using


default: 1 * (false: 0, true: 1) whether or not to start the browser (by running g:braceybrowsercommand) when bracey is started


default: 0 * (false: 0, true: 1) whether or not to reload the current web page whenever its corresponding buffer is written


default: 1 * (false: 0, true: 1) whether or not to evaluate a buffer containing javascript when it is saved


default: 1 * (false: 0, true: 1) whether or not to start the node server when

is run

default: 0 * (false: 0, true: 1) whether or not to allow other machines on the network to connect to the node server's webpage. This is useful if you want to view what changes will look like on other platforms at the same time


default: random-ish number derived from vim's pid * (int) the port that the node server will serve files at and receive commands at


default: '' * (string) address at which the node server will reside at (should start with 'http://' and not include port)


default: '/tmp/braceyserverlogfile' * (string) location to log the node servers output

how it works

The architecture looks something like this:

+-----+--------+    +--------+     +---------+
| vim | python |    | nodejs |     | browser |
|     | plugin ---->| server |---->| client  |
|     |        |    |        |     |         |
+-----+--------+    +--------+     +---------+
  • Vim uses python to launch and communicate with the nodejs server. All relevant actions (cursor move, text change, buffer switch, etc.) are sent to the node server.
  • The nodejs web server sits at the heart of bracey. This server maintains file state, serves assets, transforms documents, and forwards events.
  • The browser client is created by transforming and injecting scripts into the user's code. This client carries out actions on behalf of the nodejs server.

When the server first starts up it waits for messages indicating the project's root directory and current buffer. Once these are received it will begin serving the current buffer along with any static assets.

To serve an HTML document it must first parse it into an AST, annotate the elements, inject the client, and send the result to the web browser. Edits from Vim will diffed against the existing AST to produce a (ideally) minimal set of tree modifications to send to the client. Reducing the number of ops is vital as any remounted element loses runtime state and too many remounts might as well just be a page refresh.

Highlighting the element under the cursor is done through the AST's line/column annotations. The HTML transformation step includes tagging each element with a unique key. Once an AST node is selected a unique key is looked up and sent to the client.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.