• Stars
    star
    3,781
  • Rank 11,212 (Top 0.3 %)
  • Language
    Vim Script
  • Created almost 15 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Vastly improved Javascript indentation and syntax support in Vim.

vim-javascript

JavaScript bundle for vim, this bundle provides syntax highlighting and improved indentation.

Installation

Install with native package manager

  git clone https://github.com/pangloss/vim-javascript.git ~/.vim/pack/vim-javascript/start/vim-javascript

since Vim 8.

Install with pathogen

  git clone https://github.com/pangloss/vim-javascript.git ~/.vim/bundle/vim-javascript

alternatively, use a package manager like vim-plug

Configuration Variables

The following variables control certain syntax highlighting plugins. You can add them to your .vimrc to enable their features.


let g:javascript_plugin_jsdoc = 1

Enables syntax highlighting for JSDocs.

Default Value: 0


let g:javascript_plugin_ngdoc = 1

Enables some additional syntax highlighting for NGDocs. Requires JSDoc plugin to be enabled as well.

Default Value: 0


let g:javascript_plugin_flow = 1

Enables syntax highlighting for Flow.

Default Value: 0


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

Enables code folding for javascript based on our syntax file.

Please note this can have a dramatic effect on performance.

Concealing Characters

You can customize concealing characters, if your font provides the glyph you want, by defining one or more of the following variables:

let g:javascript_conceal_function             = "ฦ’"
let g:javascript_conceal_null                 = "รธ"
let g:javascript_conceal_this                 = "@"
let g:javascript_conceal_return               = "โ‡š"
let g:javascript_conceal_undefined            = "ยฟ"
let g:javascript_conceal_NaN                  = "โ„•"
let g:javascript_conceal_prototype            = "ยถ"
let g:javascript_conceal_static               = "โ€ข"
let g:javascript_conceal_super                = "ฮฉ"
let g:javascript_conceal_arrow_function       = "โ‡’"
let g:javascript_conceal_noarg_arrow_function = "๐Ÿž…"
let g:javascript_conceal_underscore_arrow_function = "๐Ÿž…"

You can enable concealing within VIM with:

set conceallevel=1

OR if you wish to toggle concealing you may wish to bind a command such as the following which will map <LEADER>l (leader is usually the \ key) to toggling conceal mode:

map <leader>l :exec &conceallevel ? "set conceallevel=0" : "set conceallevel=1"<CR>

Indentation Specific

  • :h cino-:
  • :h cino-=
  • :h cino-star
  • :h cino-(
  • :h cino-w
  • :h cino-W
  • :h cino-U
  • :h cino-m
  • :h cino-M
  • :h 'indentkeys'

Contributing

Please follow the general code style guides (read the code) and in your pull request explain the reason for the proposed change and how it is valuable. All p.r.'s will be reviewed by a maintainer(s) then, hopefully, merged.

Thank you!

License

Distributed under the same terms as Vim itself. See :help license.

More Repositories

1

clang

Don't use it!
JavaScript
229
star
2

pacer

My original graph database DSL machine
Ruby
176
star
3

pattern

Pattern lets you transform data structures in amazing ways.
Clojure
107
star
4

pure-conditioning

A simple, fast, purely functional condition / restart system for Clojure.
Clojure
52
star
5

fermor

Fast, powerful, general-purpose graph traversal and modelling tools plus a performant immutable in-memory graph database.
Clojure
43
star
6

ruby_picasa

Provides a super easy to use object layer for authenticating and accessing Picasa through their API.
Ruby
29
star
7

vim-erlang

This repo has been superseded by the one at http://github.com/oscarh/vimerl which is maintained by the original author. Move along, nothing more to see here!
Vim Script
23
star
8

pacer-neo4j

Neo4J adapter for Pacer
Ruby
20
star
9

transducers

Various handy transducers
Clojure
16
star
10

system.check

Test stateful systems using test.check
Clojure
10
star
11

onlisp-in-clojure

Working through the examples in On Lisp, translating them to idiomatic Clojure.
Clojure
9
star
12

objectify_xml

A smart, simple DSL that turns even complex namespaced XML into beautiful Ruby objects.
Ruby
6
star
13

synergize

Extend core and browser Javascript object *instances* with ClojureScript core protocols
Clojure
5
star
14

pacer-bloomfilter

BloomFilter plugin for Pacer
Ruby
5
star
15

vim-simplefold

Fork of SimpleFold.vim by Mauricio Fernandez. Space-optimized, configurable code folding for vim.
Vim Script
4
star
16

nested_exceptions

Nested exceptions for all rubies
Ruby
4
star
17

iphone_testify

Help set up an iPhone project for Google toolbox for Mac testing
Objective-C
3
star
18

automatic_resources

Automatically do the right thing with nested resources.
Ruby
3
star
19

pacer-dex

Dex adapter for Pacer
Ruby
3
star
20

pacer-agent

This project has been superseded by pacer-parallel.
Ruby
3
star
21

genera

Clojure
3
star
22

beehive

Bee Colony Algorithm in Ruby
Ruby
2
star
23

pacer-neo4j-algo

Pacer Neo4J integration to allow Pacer to support all of Neo4j's awesome native features, traversals, etc.
Ruby
2
star
24

pacer-parallel

Parallelize your Pacer routes
Java
2
star
25

vim-sanity

Vim Script
1
star
26

template_parser

Ruby
1
star
27

clj-graph-stream

A general purpose graph traversal library for Clojure
Clojure
1
star