whatisgithub

What is vim-javascript?

pangloss/vim-javascript — explained in plain English

Analysis updated 2026-06-26

3,790Vim ScriptAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A Vim plugin that adds proper JavaScript syntax highlighting, smart indentation, and optional extras like JSDoc coloring, Flow type annotations, code folding, and character concealing for arrow functions and keywords.

Mindmap

mindmap
  root((repo))
    Syntax Highlighting
      JavaScript core
      JSDoc comments
      Flow type hints
      AngularJS NGDocs
    Indentation
      Smart JS indent
      Fine-tune controls
    Code Folding
      Collapse blocks
      Performance notes
    Concealing
      Keyword glyphs
      Arrow symbols
      Toggle keybinding
    Installation
      Vim 8 native
      vim-plug
      pathogen
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Get proper color-coded JavaScript syntax highlighting inside Vim so code is easier to read at a glance.

USE CASE 2

Enable JSDoc comment highlighting to make function documentation stand out while editing JavaScript files.

USE CASE 3

Use code folding to collapse large JavaScript files down to their structure so you can navigate them quickly.

USE CASE 4

Add Flow type annotation highlighting when working on type-checked JavaScript projects in Vim.

What is it built with?

Vim ScriptVim 8+JavaScriptJSDocFlowAngularJS

How does it compare?

pangloss/vim-javascriptmbbill/undotreejunegunn/goyo.vim
Stars3,7904,5304,675
LanguageVim ScriptVim ScriptVim Script
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperwriter

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Add to Vim 8 native packages or via vim-plug/pathogen. Optional features are enabled with one-line .vimrc settings. Code folding may hurt performance on large files.

Licensed under the same terms as Vim itself, a charityware open-source license that lets you freely use, copy, and modify the code.

So what is it?

vim-javascript is a plugin for the Vim text editor that adds JavaScript syntax highlighting and improved code indentation. It works with Vim 8 and later, installed through the native package manager or through popular plugin managers like pathogen or vim-plug. The plugin includes several optional settings you can enable in your Vim configuration file. One adds color coding for JSDoc comments, which are a structured way to document JavaScript functions and their parameters. Another adds extra highlighting for AngularJS documentation comments (NGDocs), though it requires the JSDoc option to be active first. A third option adds highlighting for Flow, a system that lets developers annotate JavaScript with type information. Code folding is another opt-in feature. When enabled, Vim can collapse blocks of code so only the structure of a file remains visible, making it easier to scan large files. The README notes this can slow Vim down considerably, especially when pasting text, and suggests switching to indentation-based folding if performance suffers. The plugin also supports character concealing, a visual trick that replaces certain keywords or symbols with glyphs from your font. For example, the keyword "function" could appear as a special character, and arrow functions could display as an arrow symbol. This is purely cosmetic and requires a font that includes those glyphs. Concealing can be toggled on and off with a key binding. The README references several built-in Vim indentation controls for fine-tuning how JavaScript code is indented, pointing to the relevant help pages without elaborating further. The project is distributed under the same license as Vim itself.

Copy-paste prompts

Prompt 1
I installed vim-javascript in Vim 8. How do I enable JSDoc comment highlighting and Flow type annotation highlighting in my .vimrc?
Prompt 2
Using the vim-javascript plugin, how do I turn on code folding for JavaScript files and what settings reduce the performance slowdown when pasting?
Prompt 3
I want to enable character concealing in vim-javascript so that the word 'function' shows as a symbol and arrow functions display as arrows. What do I add to my .vimrc and what font do I need?
Prompt 4
How do I install vim-javascript using vim-plug, and what is the minimum Vim version required?
Prompt 5
With vim-javascript installed, how do I enable NGDoc highlighting for AngularJS projects, and why does it require JSDoc to be active first?

Frequently asked questions

What is vim-javascript?

A Vim plugin that adds proper JavaScript syntax highlighting, smart indentation, and optional extras like JSDoc coloring, Flow type annotations, code folding, and character concealing for arrow functions and keywords.

What language is vim-javascript written in?

Mainly Vim Script. The stack also includes Vim Script, Vim 8+, JavaScript.

What license does vim-javascript use?

Licensed under the same terms as Vim itself, a charityware open-source license that lets you freely use, copy, and modify the code.

How hard is vim-javascript to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is vim-javascript for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.