Skip to content

Instantly share code, notes, and snippets.

@leobalter
Created April 28, 2014 20:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leobalter/11383608 to your computer and use it in GitHub Desktop.
Save leobalter/11383608 to your computer and use it in GitHub Desktop.

Having esformatter installed - TL;DR: npm install -g esformatter - insert these lines to your ~/.vimrc file.

tjs is the shortcut to execute esformatter on your file.

nnoremap <silent> tjs :%!esformatter <Enter>
vnoremap <silent> tjs :!esformatter <Enter>

TODO: filter the command to run only on .js files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment