More concise JavaScript using Vim's "conceal" feature
Pull request Compare This branch is 9 commits ahead of tyok:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


js-mask: Because 'λ' is shorter than 'function'

A Vim plugin that makes your javascripts look more concise. The original intention is to make anonymous function less verbose and easier to understand at a glance. Requires Vim at least version 7.3.

The functionality can be described in this code below.


    function Add(b, c) { return b + c; };
    var log = function(txt) { console.log(txt) };
    setTimeout(function(){ console.log("wooot") }, 10);


    λ Add(b, c) { return b + c };
    var log = λ(txt) { console.log(txt) };
    setTimeout(λ() { console.log("woooot") }, 10);

That's it.


Put the content of /after folder to ~/.vim folder.

What Does It Do?

It conceals the "function" keyword.

How Does It Work?

You still write the code in normal javascript. This plugin just makes it looks concise. It does not alter your code. The concealed parts will expand back to normal when you put the cursor at the containing line. Or when you open the code from another editor.

It Doesn't Do Much!

Yes. The main reason is when you move the cursor to a line, all concealed text on that line will expand. I find such behavior quite confusing because texts are moving around. If I had too much concealed keywords then there would be texts flying everywhere everytime I hit 'j' or 'k' and my head would explode.

Feel free to suggest additions and improvements via Or you can fork this from and add your own very personalized flavor.


This Vim plugin is inspired by which, in turn, is inspired by