summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-09-10 10:30:32 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-09-10 10:30:32 +0200
commitfb7cf8a9ab782d67db5aa71bffac67e63fcc0c4c (patch)
tree9b41186c43daaacf5b6d1cee71f8bde4dbc8edf2
parent19a69cf77d521d6f3856d2f5c1a2faa678b937ba (diff)
downloadvim-polyglot-fb7cf8a9ab782d67db5aa71bffac67e63fcc0c4c.tar.gz
vim-polyglot-fb7cf8a9ab782d67db5aa71bffac67e63fcc0c4c.zip
Update
-rw-r--r--after/ftplugin/javascript.vim44
-rw-r--r--after/ftplugin/javascriptreact.vim2
-rw-r--r--after/ftplugin/jsx.vim35
-rw-r--r--after/indent/javascript.vim30
-rw-r--r--after/indent/javascriptreact.vim2
-rw-r--r--after/indent/jsx.vim33
-rw-r--r--after/syntax/javascript.vim56
-rw-r--r--after/syntax/javascriptreact.vim2
-rw-r--r--after/syntax/jsx.vim59
-rw-r--r--after/syntax/reason/graphql.vim2
-rw-r--r--autoload/go/config.vim8
-rw-r--r--doc/graphql.txt3
-rw-r--r--doc/vim-go.txt20
-rw-r--r--doc/vim-jsx-pretty-doc.txt1
-rw-r--r--ftdetect/polyglot.vim8
-rw-r--r--packages.yaml1
-rw-r--r--scripts/test_filetypes.vim2
-rw-r--r--syntax/go.vim4
18 files changed, 183 insertions, 129 deletions
diff --git a/after/ftplugin/javascript.vim b/after/ftplugin/javascript.vim
index a590e11d..8ff3938a 100644
--- a/after/ftplugin/javascript.vim
+++ b/after/ftplugin/javascript.vim
@@ -1,3 +1,12 @@
+if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
+
+if get(g:, 'vim_jsx_pretty_disable_js', 0)
+ finish
+endif
+
+source <sfile>:h/jsx.vim
+
+endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
" Vim filetype plugin file
@@ -14,38 +23,3 @@ else
endif
endif
-if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
-
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-" Vim ftplugin file
-"
-" Language: javascript.jsx
-" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
-"
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-" modified from html.vim
-" For matchit plugin
-if exists("loaded_matchit")
- let b:match_ignorecase = 0
- let b:match_words = '(:),\[:\],{:},<:>,' .
- \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
-endif
-
-" For andymass/vim-matchup plugin
-if exists("loaded_matchup")
- setlocal matchpairs=(:),{:},[:],<:>
- let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
- let b:match_skip = 's:comment\|string'
-endif
-
-let b:jsx_pretty_old_cms = &l:commentstring
-
-augroup jsx_comment
- autocmd! CursorMoved <buffer>
- autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:jsx_pretty_old_cms)
-augroup end
-
-setlocal suffixesadd+=.jsx
-
-endif
diff --git a/after/ftplugin/javascriptreact.vim b/after/ftplugin/javascriptreact.vim
index ab847072..265415d0 100644
--- a/after/ftplugin/javascriptreact.vim
+++ b/after/ftplugin/javascriptreact.vim
@@ -1,5 +1,5 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
-source <sfile>:h/javascript.vim
+source <sfile>:h/jsx.vim
endif
diff --git a/after/ftplugin/jsx.vim b/after/ftplugin/jsx.vim
new file mode 100644
index 00000000..94f90c13
--- /dev/null
+++ b/after/ftplugin/jsx.vim
@@ -0,0 +1,35 @@
+if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Vim ftplugin file
+"
+" Language: javascript.jsx
+" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" modified from html.vim
+" For matchit plugin
+if exists("loaded_matchit")
+ let b:match_ignorecase = 0
+ let b:match_words = '(:),\[:\],{:},<:>,' .
+ \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
+endif
+
+" For andymass/vim-matchup plugin
+if exists("loaded_matchup")
+ setlocal matchpairs=(:),{:},[:],<:>
+ let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
+ let b:match_skip = 's:comment\|string'
+endif
+
+let b:jsx_pretty_old_cms = &l:commentstring
+
+augroup jsx_comment
+ autocmd! CursorMoved <buffer>
+ autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:jsx_pretty_old_cms)
+augroup end
+
+setlocal suffixesadd+=.jsx
+
+endif
diff --git a/after/indent/javascript.vim b/after/indent/javascript.vim
index dd280edb..0add1da1 100644
--- a/after/indent/javascript.vim
+++ b/after/indent/javascript.vim
@@ -47,34 +47,10 @@ endfunction
endif
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-" Vim indent file
-"
-" Language: javascript.jsx
-" Maintainer: MaxMellon <maxmellon1994@gmail.com>
-"
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-if exists('b:did_indent')
- let s:did_indent = b:did_indent
- unlet b:did_indent
-endif
-
-let s:keepcpo = &cpo
-set cpo&vim
-
-if exists('s:did_indent')
- let b:did_indent = s:did_indent
+if get(g:, 'vim_jsx_pretty_disable_js', 0)
+ finish
endif
-setlocal indentexpr=GetJsxIndent()
-setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
-
-function! GetJsxIndent()
- return jsx_pretty#indent#get(function('GetJavascriptIndent'))
-endfunction
-
-let &cpo = s:keepcpo
-unlet s:keepcpo
+source <sfile>:h/jsx.vim
endif
diff --git a/after/indent/javascriptreact.vim b/after/indent/javascriptreact.vim
index ab847072..265415d0 100644
--- a/after/indent/javascriptreact.vim
+++ b/after/indent/javascriptreact.vim
@@ -1,5 +1,5 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
-source <sfile>:h/javascript.vim
+source <sfile>:h/jsx.vim
endif
diff --git a/after/indent/jsx.vim b/after/indent/jsx.vim
new file mode 100644
index 00000000..fcd7b5ad
--- /dev/null
+++ b/after/indent/jsx.vim
@@ -0,0 +1,33 @@
+if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Vim indent file
+"
+" Language: javascript.jsx
+" Maintainer: MaxMellon <maxmellon1994@gmail.com>
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+if exists('b:did_indent')
+ let s:did_indent = b:did_indent
+ unlet b:did_indent
+endif
+
+let s:keepcpo = &cpo
+set cpo&vim
+
+if exists('s:did_indent')
+ let b:did_indent = s:did_indent
+endif
+
+setlocal indentexpr=GetJsxIndent()
+setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
+
+function! GetJsxIndent()
+ return jsx_pretty#indent#get(function('GetJavascriptIndent'))
+endfunction
+
+let &cpo = s:keepcpo
+unlet s:keepcpo
+
+endif
diff --git a/after/syntax/javascript.vim b/after/syntax/javascript.vim
index 00c4b079..2992e942 100644
--- a/after/syntax/javascript.vim
+++ b/after/syntax/javascript.vim
@@ -1,59 +1,9 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-" Vim syntax file
-"
-" Language: javascript.jsx
-" Maintainer: MaxMellon <maxmellon1994@gmail.com>
-"
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-let s:jsx_cpo = &cpo
-set cpo&vim
-
-syntax case match
-
-if exists('b:current_syntax')
- let s:current_syntax = b:current_syntax
- unlet b:current_syntax
-endif
-
-if exists('s:current_syntax')
- let b:current_syntax = s:current_syntax
-endif
-
-if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
- syntax cluster jsExpression add=jsxRegion
-elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
- " refine the javascript line comment
- syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
- syntax cluster javascriptValue add=jsxRegion
- syntax cluster javascriptNoReserved add=jsxElement,jsxTag
-else " build-in javascript syntax
- " refine the javascript line comment
- syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
-
- " refine the template string syntax
- syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr
-
- " add a javaScriptBlock group for build-in syntax
- syntax region javaScriptBlock
- \ matchgroup=javaScriptBraces
- \ start="{"
- \ end="}"
- \ contained
- \ extend
- \ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
- \ fold
-
- syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
+if get(g:, 'vim_jsx_pretty_disable_js', 0)
+ finish
endif
-runtime syntax/jsx_pretty.vim
-
-let b:current_syntax = 'javascript.jsx'
-
-let &cpo = s:jsx_cpo
-unlet s:jsx_cpo
+source <sfile>:h/jsx.vim
endif
diff --git a/after/syntax/javascriptreact.vim b/after/syntax/javascriptreact.vim
index ab847072..265415d0 100644
--- a/after/syntax/javascriptreact.vim
+++ b/after/syntax/javascriptreact.vim
@@ -1,5 +1,5 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
-source <sfile>:h/javascript.vim
+source <sfile>:h/jsx.vim
endif
diff --git a/after/syntax/jsx.vim b/after/syntax/jsx.vim
new file mode 100644
index 00000000..00c4b079
--- /dev/null
+++ b/after/syntax/jsx.vim
@@ -0,0 +1,59 @@
+if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Vim syntax file
+"
+" Language: javascript.jsx
+" Maintainer: MaxMellon <maxmellon1994@gmail.com>
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+let s:jsx_cpo = &cpo
+set cpo&vim
+
+syntax case match
+
+if exists('b:current_syntax')
+ let s:current_syntax = b:current_syntax
+ unlet b:current_syntax
+endif
+
+if exists('s:current_syntax')
+ let b:current_syntax = s:current_syntax
+endif
+
+if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
+ syntax cluster jsExpression add=jsxRegion
+elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
+ " refine the javascript line comment
+ syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
+ syntax cluster javascriptValue add=jsxRegion
+ syntax cluster javascriptNoReserved add=jsxElement,jsxTag
+else " build-in javascript syntax
+ " refine the javascript line comment
+ syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
+
+ " refine the template string syntax
+ syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr
+
+ " add a javaScriptBlock group for build-in syntax
+ syntax region javaScriptBlock
+ \ matchgroup=javaScriptBraces
+ \ start="{"
+ \ end="}"
+ \ contained
+ \ extend
+ \ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
+ \ fold
+
+ syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
+endif
+
+runtime syntax/jsx_pretty.vim
+
+let b:current_syntax = 'javascript.jsx'
+
+let &cpo = s:jsx_cpo
+unlet s:jsx_cpo
+
+endif
diff --git a/after/syntax/reason/graphql.vim b/after/syntax/reason/graphql.vim
index 44a5c846..4f4ba44c 100644
--- a/after/syntax/reason/graphql.vim
+++ b/after/syntax/reason/graphql.vim
@@ -32,6 +32,6 @@ if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
-syntax region graphqlMultilineString matchgroup=reasonMultilineString start=+graphql\_s*\zs{|+ end=+|}+ contains=@GraphQLSyntax,reasonEscape,reasonEscapeUnicode,reasonEscapeError,reasonStringContinuation keepend
+syntax region graphqlExtensionPoint matchgroup=Noise start=+\[%graphql\_s*{|+lc=10 end=+|}\_s*]+he=s+1 contains=@GraphQLSyntax keepend
endif
diff --git a/autoload/go/config.vim b/autoload/go/config.vim
index 956da220..55bc1902 100644
--- a/autoload/go/config.vim
+++ b/autoload/go/config.vim
@@ -552,6 +552,14 @@ function! go#config#GoplsLocal() abort
return get(g:, 'go_gopls_local', v:null)
endfunction
+function! go#config#GoplsGofumpt() abort
+ return get(g:, 'go_gopls_gofumpt', v:null)
+endfunction
+
+function! go#config#GoplsSettings() abort
+ return get(g:, 'go_gopls_settings', v:null)
+endfunction
+
function! go#config#GoplsEnabled() abort
return get(g:, 'go_gopls_enabled', 1)
endfunction
diff --git a/doc/graphql.txt b/doc/graphql.txt
index 3f41deaa..868c74d8 100644
--- a/doc/graphql.txt
+++ b/doc/graphql.txt
@@ -46,8 +46,7 @@ the list of recognized template tag names.
REASONML *graphql-reasonml*
GraphQL syntax support inside of ReasonML template strings using graphql-ppx
-is available when vim-reasonml (https://github.com/jordwalke/vim-reasonml) is
-also installed.
+is available.
------------------------------------------------------------------------------
vim:tw=78:ft=help:norl:
diff --git a/doc/vim-go.txt b/doc/vim-go.txt
index e00dec9b..b92ab5b9 100644
--- a/doc/vim-go.txt
+++ b/doc/vim-go.txt
@@ -802,7 +802,7 @@ CTRL-t
You can define a constant value instead of the default field based value.
For example the following command will add ``valid:"1"`` to all fields.
>
- :GoAddTags valid=1
+ :GoAddTags valid:1
<
*:GoRemoveTags*
:[range]GoRemoveTags [key],[option] [key1],[option1] ...
@@ -1876,6 +1876,24 @@ is `v:null`.
let g:go_gopls_local = v:null
<
+ *'g:go_gopls_gofumpt'*
+
+Specifies whether `gopls` should use `gofumpt` for formatting. When it is
+`v:null`, `gopls`' default will be used. By default it is `v:null`.
+>
+ let g:go_gopls_gofumpt = v:null
+<
+
+ *'g:go_gopls_settings'*
+
+Specifies `gopls` workspace settings for `gopls` that are not yet officially
+supported by vim-go. Any value in the dictionary will be overridden by values
+provided in the specific options supported by vim-go (e.g.
+g:go_gopls_staticcheck) or settings statically configured by vim-go to ensure
+expected behavior. By default it is `v:null`.
+>
+ let g:go_gopls_settings = v:null
+<
*'g:go_diagnostics_enabled'*
Specifies whether `gopls` diagnostics are enabled. Only the diagnostics for
diff --git a/doc/vim-jsx-pretty-doc.txt b/doc/vim-jsx-pretty-doc.txt
index a561e475..cc170976 100644
--- a/doc/vim-jsx-pretty-doc.txt
+++ b/doc/vim-jsx-pretty-doc.txt
@@ -46,6 +46,7 @@ CONFIG *vim-jsx-pretty-config*
|---------------------------------------|---------|----------------------|
| g:vim_jsx_pretty_enable_jsx_highlight | 1 | jsx highlight flag |
| g:vim_jsx_pretty_colorful_config | 0 | colorful config flag |
+ | g:vim_jsx_pretty_disable_js | 0 | js toggle flag |
<
- *g:vim_jsx_pretty_enable_jsx_highlight*
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim
index 432b5e01..e49a966d 100644
--- a/ftdetect/polyglot.vim
+++ b/ftdetect/polyglot.vim
@@ -851,6 +851,10 @@ if !has_key(s:disabled_packages, 'ion')
au BufNewFile,BufRead ~/.config/ion/initrc setf ion
endif
+if !has_key(s:disabled_packages, 'jsx')
+ au BufNewFile,BufRead *.jsx setf javascriptreact
+endif
+
if !has_key(s:disabled_packages, 'javascript')
au BufNewFile,BufRead *._js setf javascript
au BufNewFile,BufRead *.bones setf javascript
@@ -939,10 +943,6 @@ if !has_key(s:disabled_packages, 'jst')
au BufNewFile,BufRead *.jst setf jst
endif
-if !has_key(s:disabled_packages, 'jsx')
- au BufNewFile,BufRead *.jsx setf javascriptreact
-endif
-
if !has_key(s:disabled_packages, 'julia')
au BufNewFile,BufRead *.jl setf julia
endif
diff --git a/packages.yaml b/packages.yaml
index 3ddc5776..dfb17252 100644
--- a/packages.yaml
+++ b/packages.yaml
@@ -921,6 +921,7 @@ filetypes:
---
name: jsx
remote: MaxMEllon/vim-jsx-pretty
+after: javascript
filetypes:
- name: javascriptreact
linguist: JSX
diff --git a/scripts/test_filetypes.vim b/scripts/test_filetypes.vim
index 42e683d1..e7ae6511 100644
--- a/scripts/test_filetypes.vim
+++ b/scripts/test_filetypes.vim
@@ -109,6 +109,7 @@ call TestFiletype('idris')
call TestFiletype('idris2')
call TestFiletype('lidris2')
call TestFiletype('ion')
+call TestFiletype('javascriptreact')
call TestFiletype('javascript')
call TestFiletype('flow')
call TestFiletype('Jenkinsfile')
@@ -118,7 +119,6 @@ call TestFiletype('json5')
call TestFiletype('json')
call TestFiletype('jsonnet')
call TestFiletype('jst')
-call TestFiletype('javascriptreact')
call TestFiletype('julia')
call TestFiletype('kotlin')
call TestFiletype('ledger')
diff --git a/syntax/go.vim b/syntax/go.vim
index 93d6fbc4..73f28037 100644
--- a/syntax/go.vim
+++ b/syntax/go.vim
@@ -424,8 +424,8 @@ function! s:hi()
" :GoDebug commands
if go#config#HighlightDebug()
- hi GoDebugBreakpoint term=standout ctermbg=117 ctermfg=0 guibg=#BAD4F5 guifg=Black
- hi GoDebugCurrent term=reverse ctermbg=12 ctermfg=7 guibg=DarkBlue guifg=White
+ hi def GoDebugBreakpoint term=standout ctermbg=117 ctermfg=0 guibg=#BAD4F5 guifg=Black
+ hi def GoDebugCurrent term=reverse ctermbg=12 ctermfg=7 guibg=DarkBlue guifg=White
endif
endfunction