Skip to content

Commit db7bb8b

Browse files
committed
Update
1 parent aae85fe commit db7bb8b

23 files changed

+478
-112
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
111111
- [idris](https://github.com/idris-hackers/idris-vim) (Idris syntax highlighting for idr and lidr files)
112112
- [ion](https://github.com/vmchale/ion-vim) (Syntax highlighting for ion files)
113113
- [javascript-sql](https://github.com/statico/vim-javascript-sql)
114-
- [javascript](https://github.com/pangloss/vim-javascript) (JavaScript syntax highlighting for js, bones, cjs, es, es6 and 18 more files)
114+
- [javascript](https://github.com/pangloss/vim-javascript) (JavaScript syntax highlighting for js, bones, cjs, es, es6 and 20 more files)
115115
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (Syntax highlighting for jenkinsfile and Jenkinsfile files)
116116
- [jq](https://github.com/vito-c/jq.vim) (JSONiq syntax highlighting for jq files)
117117
- [json5](https://github.com/GutenYe/json5.vim) (JSON5 syntax highlighting for json5 files)

autoload/clojurecomplete.vim

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

autoload/fish.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ function! fish#Indent()
7171
let l:prevline = getline(l:prevlnum)
7272
let l:previndent = indent(l:prevlnum)
7373
if s:IsContinuedLine(v:lnum)
74-
" It is customary to increment indentation of continued lines by three
75-
" or a custom value defined by the user if available.
7674
let l:previndent = indent(v:lnum - 1)
7775
if s:IsContinuedLine(v:lnum - 1)
7876
return l:previndent
@@ -81,7 +79,7 @@ function! fish#Indent()
8179
elseif exists('g:indent_cont')
8280
return l:previndent + g:indent_cont
8381
else
84-
return l:previndent + 3
82+
return l:previndent + l:shiftwidth
8583
endif
8684
endif
8785
if l:prevline =~# '\v^\s*%(begin|if|else|while|for|function|case|switch)>'

autoload/polyglot/init.vim

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ let did_load_filetypes = 1
169169

170170
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
171171

172+
if !has_key(g:polyglot_is_disabled, 'bicep')
173+
au BufNewFile,BufRead *.bicep setf bicep
174+
endif
175+
172176
if !has_key(g:polyglot_is_disabled, 'org')
173177
au BufNewFile,BufRead *.org setf org
174178
endif
@@ -1328,10 +1332,6 @@ if !has_key(g:polyglot_is_disabled, 'hex')
13281332
au BufNewFile,BufRead *.h32,*.hex setf hex
13291333
endif
13301334

1331-
if !has_key(g:polyglot_is_disabled, 'hercules')
1332-
au BufNewFile,BufRead *.errsum,*.ev,*.sum,*.vc setf hercules
1333-
endif
1334-
13351335
if !has_key(g:polyglot_is_disabled, 'hastepreproc')
13361336
au BufNewFile,BufRead *.htpp setf hastepreproc
13371337
endif
@@ -1783,7 +1783,7 @@ if !has_key(g:polyglot_is_disabled, 'odin')
17831783
endif
17841784

17851785
if !has_key(g:polyglot_is_disabled, 'dosini')
1786-
au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*/etc/pacman.conf,*/etc/yum.conf,{.,}editorconfig,{.,}flake8,{.,}npmrc,buildozer.spec setf dosini
1786+
au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}editorconfig,{.,}flake8,{.,}npmrc,buildozer.spec setf dosini
17871787
au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini')
17881788
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
17891789
endif
@@ -2157,7 +2157,7 @@ if !has_key(g:polyglot_is_disabled, 'mako')
21572157
endif
21582158

21592159
if !has_key(g:polyglot_is_disabled, 'm4')
2160-
au BufNewFile,BufRead *.at,*.m4 setf m4
2160+
au BufNewFile,BufRead *.at,*.m4,*.mc setf m4
21612161
endif
21622162

21632163
if !has_key(g:polyglot_is_disabled, 'lua')
@@ -2320,16 +2320,22 @@ endif
23202320

23212321
if !has_key(g:polyglot_is_disabled, 'javascript')
23222322
au! BufNewFile,BufRead,BufWritePost *.frag call polyglot#detect#Frag()
2323-
au BufNewFile,BufRead *._js,*.bones,*.cjs,*.es,*.es6,*.gs,*.jake,*.javascript,*.js,*.jsb,*.jscad,*.jsfl,*.jsm,*.jss,*.jsx,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile setf javascript
2323+
au BufNewFile,BufRead *._js,*.bones,*.cjs,*.es,*.es6,*.gs,*.jake,*.javascript,*.js,*.jsb,*.jscad,*.jsfl,*.jslib,*.jsm,*.jspre,*.jss,*.jsx,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile setf javascript
23242324
au BufNewFile,BufRead *.flow setf flow
23252325
endif
23262326

23272327
if !has_key(g:polyglot_is_disabled, 'go')
23282328
au BufNewFile,BufRead *.go setf go
23292329
au BufNewFile,BufRead go.mod setf gomod
2330+
au BufNewFile,BufRead go.sum setf gosum
2331+
au BufNewFile,BufRead go.work setf gowork
23302332
au BufNewFile,BufRead *.tmpl setf gohtmltmpl
23312333
endif
23322334

2335+
if !has_key(g:polyglot_is_disabled, 'hercules')
2336+
au BufNewFile,BufRead *.errsum,*.ev,*.sum,*.vc setf hercules
2337+
endif
2338+
23332339
if !has_key(g:polyglot_is_disabled, 'gnuplot')
23342340
au BufNewFile,BufRead *.gnu,*.gnuplot,*.gp,*.gpi,*.p,*.plot,*.plt setf gnuplot
23352341
endif

autoload/polyglot/sleuth.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ let s:globs = {
4848
\ 'bc': '*.bc',
4949
\ 'bdf': '*.bdf',
5050
\ 'bib': '*.bib',
51+
\ 'bicep': '*.bicep',
5152
\ 'bindzone': 'named.root',
5253
\ 'blade': '*.blade,*.blade.php',
5354
\ 'blank': '*.bl',
@@ -129,7 +130,7 @@ let s:globs = {
129130
\ 'dnsmasq': '',
130131
\ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*',
131132
\ 'dosbatch': '*.bat,*.sys',
132-
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,.flake8,buildozer.spec,.editorconfig,.npmrc,php.ini-*',
133+
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.flake8,buildozer.spec,.editorconfig,.npmrc,php.ini-*',
133134
\ 'dot': '*.dot,*.gv',
134135
\ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*',
135136
\ 'dsdl': '*.sdl',
@@ -197,6 +198,8 @@ let s:globs = {
197198
\ 'go': '*.go',
198199
\ 'gohtmltmpl': '*.tmpl',
199200
\ 'gomod': 'go.mod',
201+
\ 'gosum': 'go.sum',
202+
\ 'gowork': 'go.work',
200203
\ 'gp': '*.gp,.gprc',
201204
\ 'gpg': '',
202205
\ 'grads': '*.gs',
@@ -253,7 +256,7 @@ let s:globs = {
253256
\ 'jam': '*.jpl,*.jpr,Prl*.*,JAM*.*',
254257
\ 'java': '*.java,*.jav',
255258
\ 'javacc': '*.jj,*.jjt',
256-
\ 'javascript': '*.js,*._js,*.bones,*.cjs,*.es,*.es6,*.frag,*.gs,*.jake,*.javascript,*.jsb,*.jscad,*.jsfl,*.jsm,*.jss,*.jsx,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile',
259+
\ 'javascript': '*.js,*._js,*.bones,*.cjs,*.es,*.es6,*.frag,*.gs,*.jake,*.javascript,*.jsb,*.jscad,*.jsfl,*.jslib,*.jsm,*.jspre,*.jss,*.jsx,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile',
257260
\ 'javascriptreact': '*.jsx',
258261
\ 'jess': '*.clp',
259262
\ 'jgraph': '*.jgr',
@@ -309,7 +312,7 @@ let s:globs = {
309312
\ 'lss': '*.lss',
310313
\ 'lua': '*.lua,*.fcgi,*.nse,*.p8,*.pd_lua,*.rbxs,*.rockspec,*.wlua,.luacheckrc',
311314
\ 'lynx': 'lynx.cfg',
312-
\ 'm4': '*.m4,*.at',
315+
\ 'm4': '*.m4,*.mc,*.at',
313316
\ 'mail': '*.eml,snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},neomutt-*-\w\+,neomutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,{neo,}mutt[[:alnum:]._-]\\\{6\},reportbug-*',
314317
\ 'mailaliases': '',
315318
\ 'mailcap': '.mailcap,mailcap',

extras/filetype.vim

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,20 +2506,17 @@ endif
25062506
" Function called for testing all functions defined here. These are
25072507
" script-local, thus need to be executed here.
25082508
" Returns a string with error messages (hopefully empty).
2509-
" Check if function exists first. See https://github.com/vim/vim/issues/9890
2510-
if !exists("*TestFiletypeFuncs")
2511-
func! TestFiletypeFuncs(testlist)
2512-
let output = ''
2513-
for f in a:testlist
2514-
try
2515-
exe f
2516-
catch
2517-
let output = output . "\n" . f . ": " . v:exception
2518-
endtry
2519-
endfor
2520-
return output
2521-
endfunc
2522-
endif
2509+
func! TestFiletypeFuncs(testlist)
2510+
let output = ''
2511+
for f in a:testlist
2512+
try
2513+
exe f
2514+
catch
2515+
let output = output . "\n" . f . ": " . v:exception
2516+
endtry
2517+
endfor
2518+
return output
2519+
endfunc
25232520

25242521
" Restore 'cpoptions'
25252522
let &cpo = s:cpo_save

ftplugin/bicep.vim

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bicep', 'ftplugin/bicep.vim')
2+
finish
3+
endif
4+
5+
" bicep.vim - basic bicep integration
6+
" Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com>
7+
8+
if exists('b:did_ftplugin') || v:version < 700 || &compatible
9+
finish
10+
endif
11+
let b:did_ftplugin = 1
12+
13+
let s:cpo_save = &cpoptions
14+
set cpoptions&vim
15+
16+
" Set the commentstring
17+
setlocal commentstring=//%s
18+
let b:undo_ftplugin = ' commentstring<'
19+
20+
let &cpoptions = s:cpo_save
21+
unlet s:cpo_save

ftplugin/rst.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if !exists('g:rst_fold_enabled')
2222
let g:rst_fold_enabled = 0
2323
endif
2424

25-
let b:undo_ftplugin = "setl com< cms< et< fo<"
25+
let b:undo_ftplugin = "setlocal comments< commentstring< expandtab< formatoptions<"
2626

2727
setlocal comments=fb:.. commentstring=..\ %s expandtab
2828
setlocal formatoptions+=tcroql
@@ -36,6 +36,7 @@ setlocal formatoptions+=tcroql
3636

3737
if exists("g:rst_style") && g:rst_style != 0
3838
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
39+
let b:undo_ftplugin .= " | setlocal softtabstop< shiftwidth< tabstop<"
3940
endif
4041

4142
if g:rst_fold_enabled != 0 && has('patch-7.3.867') " Introduced the TextChanged event.
@@ -45,6 +46,7 @@ if g:rst_fold_enabled != 0 && has('patch-7.3.867') " Introduced the TextChanged
4546
augroup RstFold
4647
autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache
4748
augroup END
49+
let b:undo_ftplugin .= " | setlocal foldexpr< foldmethod< foldtext<"
4850
endif
4951

5052
let &cpo = s:cpo_save

ftplugin/ruby.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ endif
5656
" TODO:
5757
"setlocal define=^\\s*def
5858

59-
setlocal comments=:#
59+
setlocal comments=b:#
6060
setlocal commentstring=#\ %s
6161

6262
if !exists('g:ruby_version_paths')

indent/bicep.vim

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bicep', 'indent/bicep.vim')
2+
finish
3+
endif
4+
5+
" Only load this file if no other indent file was loaded
6+
if exists('b:did_indent')
7+
finish
8+
endif
9+
let b:did_indent = 1
10+
11+
let s:cpo_save = &cpoptions
12+
set cpoptions&vim
13+
14+
setlocal nolisp
15+
setlocal autoindent shiftwidth=2 tabstop=2 softtabstop=2 expandtab
16+
setlocal indentexpr=BicepIndent(v:lnum)
17+
setlocal indentkeys+=<:>,0=},0=),0=*/
18+
let b:undo_indent = 'setlocal lisp< autoindent< shiftwidth< tabstop< softtabstop<'
19+
\ . ' expandtab< indentexpr< indentkeys<'
20+
21+
let &cpoptions = s:cpo_save
22+
unlet s:cpo_save
23+
24+
if exists('*BicepIndent')
25+
finish
26+
endif
27+
28+
let s:cpo_save = &cpoptions
29+
set cpoptions&vim
30+
31+
function! BicepIndent(lnum)
32+
" Beginning of the file should have no indent
33+
if a:lnum == 0
34+
return 0
35+
endif
36+
37+
" Usual case is to continue at the same indent as the previous non-blank line.
38+
let prevlnum = prevnonblank(a:lnum-1)
39+
let thisindent = indent(prevlnum)
40+
41+
" If that previous line is a non-comment ending in [ { (, increase the
42+
" indent level.
43+
let prevline = getline(prevlnum)
44+
if prevline !~# '^\s*//' && prevline =~# '[\[{\(]\s*$'
45+
let thisindent += &shiftwidth
46+
endif
47+
48+
" If the current line ends a block, decrease the indent level.
49+
let thisline = getline(a:lnum)
50+
if thisline =~# '^\s*[\)}\]]'
51+
let thisindent -= &shiftwidth
52+
endif
53+
54+
" If the previous line starts a block comment /*, increase by one
55+
if prevline =~# '/\*'
56+
let thisindent += 2
57+
endif
58+
59+
" If the this line ends a block comment */, decrease by one
60+
if thisline =~# '\*/'
61+
let thisindent -= 2
62+
endif
63+
64+
return thisindent
65+
endfunction
66+
67+
let &cpoptions = s:cpo_save
68+
unlet s:cpo_save

0 commit comments

Comments
 (0)