Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Vastly improved Javascript indentation and syntax support in Vim.

NotificationsYou must be signed in to change notification settings

pangloss/vim-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript bundle for vim, this bundle provides syntax highlighting andimproved 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 withpathogen

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

alternatively, use a package manager likevim-plug

Configuration Variables

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


let g:javascript_plugin_jsdoc = 1

Enables syntax highlighting forJSDocs.

Default Value: 0


let g:javascript_plugin_ngdoc = 1

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

Default Value: 0


let g:javascript_plugin_flow = 1

Enables syntax highlighting forFlow.

Default Value: 0


augroupjavascript_foldingau!auFileTypejavascriptsetlocalfoldmethod=syntaxaugroupEND

Enables code folding for javascript based on our syntax file.

Please note this can have a dramatic effect on performance. In some terminalsthis may cause hangs during pasting. If you are affected by this, usinga different foldmethod (such as indent) may provide a better experience.

Concealing Characters

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

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 styleguides (read the code) and in your pull request explain the reason for theproposed change and how it is valuable. All p.r.'s will be reviewed by amaintainer(s) then, hopefully, merged.

Thank you!

License

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

About

Vastly improved Javascript indentation and syntax support in Vim.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors100


[8]ページ先頭

©2009-2025 Movatter.jp