diff --git a/README.md b/README.md index 1ad4078c..617df9f1 100644 --- a/README.md +++ b/README.md @@ -1,68 +1,75 @@ # vim-javascript v0.10.0 -JavaScript bundle for vim, this bundle provides syntax and indent plugins. +JavaScript bundle for vim, this bundle provides syntax highlighting and +improved indentation. -## A Quick Note on Regexes -Vim 7.4 was released recently, and unfortunately broke how this plugin -handles regexes. There was no real easy way for us to fix this unless we -completely rewrote how regexes work. +## Installation -Good News: There was a recent update to Vim 7.4 that fixes this issue. +### Install with [Vundle](https://github.com/gmarik/vundle) -Make sure you are at least using Vim 7.4, with patches 1-7. +Add to vimrc: -If you are stuck on an older version of Vim 7.4 with no way to update, -then simply perform the following commands to fix your current buffer: + Plugin 'pangloss/vim-javascript' -``` -:set regexpengine=1 -:syntax enable -``` +And install it: -## Installation + :so ~/.vimrc + :PluginInstall -### Install with [Vundle](https://github.com/gmarik/vundle) +### Install with [vim-plug](https://github.com/junegunn/vim-plug) Add to vimrc: - Plugin 'pangloss/vim-javascript' + Plug 'pangloss/vim-javascript' And install it: :so ~/.vimrc - :PluginInstall + :PlugInstall ### Install with [pathogen](https://github.com/tpope/vim-pathogen) cd ~/.vim/bundle git clone https://github.com/pangloss/vim-javascript.git -## Configuration + +## Configuration Variables The following variables control certain syntax highlighting features. You can add them to your `.vimrc` to enable/disable their features. -#### javascript_enable_domhtmlcss +``` +let g:javascript_enable_domhtmlcss = 1 +``` Enables HTML/CSS syntax highlighting in your JavaScript file. Default Value: 0 -#### b:javascript_fold +----------------- -Enables JavaScript code folding. +``` +let g:javascript_ignore_javaScriptdoc = 1 +``` -Default Value: 1 +Disables JSDoc syntax highlighting +Default Value: 0 -#### javascript_ignore_javaScriptdoc +----------------- -Disables JSDoc syntax highlighting +``` +set foldmethod=syntax +``` + +Enables code folding based on our syntax file. + +Please note this can have a dramatic effect on performance and because it is a +global vim option, we do not set it ourselves. -Default Value: 0 -#### Concealing Characters +## Concealing Characters You can customize concealing characters by defining one or more of the following variables: @@ -78,6 +85,7 @@ variables: let g:javascript_conceal_super = "Ω" let g:javascript_conceal_arrow_function = "⇒" + ## Contributing This project uses the [git @@ -88,10 +96,24 @@ the price of admission is 1 pull request. 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. -## Bug report + +## Bug Reports Report a bug on [GitHub Issues](https://github.com/pangloss/vim-javascript/issues). + +## A Quick Note on Regexes + +Vim 7.4 with patches LESS than 1-7 exhibits a bug that broke how we handle +javascript regexes. Please update to a newer version or run the following +commands to fix: + +``` +:set regexpengine=1 +:syntax enable +``` + + ## License Distributed under the same terms as Vim itself. See `:help license`. diff --git a/syntax/javascript.vim b/syntax/javascript.vim index 10d15689..9a6933e3 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -16,12 +16,6 @@ if !exists('g:javascript_conceal') let g:javascript_conceal = 0 endif -"" Drop fold if it is set but VIM doesn't support it. -let b:javascript_fold='true' -if version < 600 " Don't support the old version - unlet! b:javascript_fold -endif - "" dollar sign is permittd anywhere in an identifier setlocal iskeyword+=$