# vim-javascript: two conceal glyphs share one character and folding can hang while pasting

> vim-javascript is a Vim runtime bundle that supplies JavaScript syntax highlighting and indentation through the usual filetype, syntax and indent directories, configured by a handful of global variables. What is worth knowing is in the details: one configuration option is documented as a performance hazard, two of the conceal glyphs are the same character, one option silently depends on another, and the last tagged version predates the last commit by eight years.

**pangloss/vim-javascript** — GitHub describes it as Vastly improved Javascript indentation and syntax support in Vim.. The repository metadata lists Vim Script as its primary language. This article stays within the project description and details documented in the GitHub repository README.

- Repository: https://github.com/pangloss/vim-javascript
- Website: http://www.vim.org/scripts/script.php?script_id=4452
- Stars: 3,788 · Forks: 350
- Language: Vim Script
- License: not declared
- Published: 2026-08-13 · Updated: 2026-08-18 · Language: en
- Canonical page: https://hysenlabs.com/projects/pangloss-vim-javascript

## Two arrow glyphs are set to the same character

The concealing section lists twelve variables mapping language tokens to display characters: a function symbol, a null, this, a return arrow, undefined, the not-a-number symbol, prototype, a static dot, super, an arrow, a no-argument arrow, and an arrow for a named parameter. The last two are assigned the same character, so `g:javascript_conceal_noarg_arrow_function` and `g:javascript_conceal_underscore_arrow_function` are visually indistinguishable when concealment is on. That may well be deliberate, since both are arrows with nothing else to tell them apart, but it is not explained. One more detail in the same list: the not-a-number variable spells its middle word in capitals in an otherwise all-lowercase naming scheme, and this section, unlike the syntax toggles, states no default values at all.

```vim
augroup javascript_folding
    au!
    au FileType javascript setlocal foldmethod=syntax
augroup END
```

## Folding is the one option the file warns you about

Code folding for JavaScript is enabled by folding on the syntax file's own fold regions, set per buffer when the filetype turns on, inside an augroup you have to paste into your own configuration. The warning attached to it is the strongest sentence in the file: this can have a dramatic effect on performance, and in some terminals it may cause hangs during pasting. The suggested alternative is a different folding method, with indent named as one, which is the trade the file offers rather than a recommendation to leave folding off. Two things make this option unusual in its own file. It is the only feature not exposed as a configuration variable, so it is opt-in by pasting rather than by setting a flag, and it is the only one with a documented failure mode.

## NGDoc highlighting needs the JSDoc option enabled first

Three global variables turn on optional syntax plugins, each written as a let assignment and each documented with a default value of zero, so none of them is active until you change it. The first enables JSDoc highlighting. The second enables additional highlighting for NGDocs and says it requires the JSDoc plugin to be enabled as well, which makes it a dependent option rather than an independent one and means the documented order matters. The third enables Flow type highlighting. That is the entire configuration surface for the syntax file, and it is worth noticing what is not in it: there is no variable for the indentation behaviour, because that is delegated entirely to Vim's own settings.

## Indentation is delegated to ten Vim help topics

The indentation section is a list of ten help references and nothing else: the colon and equals forms of the indent options, the star and paren forms, the wide and wide-ignore versions, the uppercase variants, the two block-opening forms, and the indentkeys option. No option is explained, no value is suggested, and the list is the entire documentation of how the indent script indents. That is the mechanism: rather than exposing settings of its own, the script drives Vim's built-in indent options, so the behaviour is documented in Vim's own help and tuned the same way. A reader arriving from a language server or a syntax plugin will find this the least familiar part of the bundle, since the tuning surface is a set of editor flags rather than a plugin configuration file.

## Two install paths, one marked as being for Vim 8

Installation is two clone commands. The first clones into the native package directory that exists in Vim 8 and later, and the file marks it with a note saying since Vim 8, which is also the only hint about which command to use on a modern Vim. The second clones into the older bundle directory used by the pathogen plugin, and the file adds that a package manager such as vim-plug would work instead. Neither command pins a tag or a branch, so both install whatever the default branch currently holds, which matters given that the newest tagged release is from 2016 and the most recent commit is from March 2025. The file's own homepage is a listing on the Vim script website rather than a documentation site.

## A hotfix 37 minutes after the release, then eight years of commits

The version history is short and lopsided. A release labelled with a hotfix suffix and the version before it were both published on 8 November 2016, the hotfix a little over half an hour after the release it corrects, and the release before that, labelled as a refactoring of the indent script, is from October 2016. After that the tags stop, while commits continue: the last push to the default branch is dated 21 March 2025. So the published versions and the working code are eight years apart, and there is no tag a user could install to get a specific dated state without naming a commit. The repository also has no workflow directory in its top level, so whatever checks exist on changes are not visible from the tree.

## The licence is a pointer into Vim's own help

The licence section is one sentence: distributed under the same terms as Vim itself, with a pointer to a help topic rather than to a file. That is a coherent choice for a Vim runtime bundle, and the repository layout follows the same logic, holding a filetype detection directory, a syntax directory, an indent directory, a directory of files applied after the syntax step, a compiler directory and an extras directory, plus an issue template and no workflow configuration. What is not in the tree is any licence text. So a reader who wants to know the terms has to open Vim's help, and a reader redistributing a derived bundle has nothing in this repository to point at.

## Conclusion

This bundle fits someone who wants Vim to handle JavaScript without reaching for a full language plugin, and who is willing to read the help topics the indenting script points at. Four things to know before adopting it. Folding by syntax is the one option the file warns against, on the grounds that it can hang during pasting in some terminals, and it is the only feature it asks you to think twice about. Enabling the NGDoc highlighting does nothing unless the JSDoc highlighting is on first. Two of the conceal variables share the same glyph, so a no-argument arrow and an arrow with a named parameter look identical. And the newest tagged version is from 2016 while commits continued into March 2025, so plan to read the current source rather than to install a release.

## FAQ

### Is Vim better than VS Code for JavaScript?

This repository does not compare editors, and it does not mention any language server. What it ships is a runtime bundle supplying JavaScript syntax highlighting and indentation inside Vim, configured by three global variables for documentation and type-comment highlighting, with folding by syntax offered as a snippet to paste and indentation delegated to Vim's own indent options.

### Is Vim difficult to use?

That question is not what this file addresses, and the configuration it documents would not answer it either way. What is documented is where the bundle goes in a Vim runtime directory, the handful of variables that turn on optional highlighting, the conceal glyph variables, and a list of Vim help topics that explain the indent options the script drives.

### How do I learn the vim-javascript options?

From this file and from Vim's own help. It lists the variables with their default values, where the NGDoc option additionally needs the JSDoc option enabled, the conceal glyph variables, and then a list of indent option help topics without explanation, which are the topics to read for the indentation behaviour.

## Sources

- [Official documentation](http://www.vim.org/scripts/script.php?script_id=4452)
- [Official README](https://github.com/pangloss/vim-javascript#readme)
- [Project repository](https://github.com/pangloss/vim-javascript)
- [Release notes](https://github.com/pangloss/vim-javascript/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/pangloss-vim-javascript
