diff options
106 files changed, 2478 insertions, 1330 deletions
diff --git a/.github/CODEOWNERS b/.github/MAINTAINERS index ac41ed5678..36b352ffbf 100644 --- a/.github/CODEOWNERS +++ b/.github/MAINTAINERS @@ -161,6 +161,7 @@ runtime/ftplugin/j.vim @glts runtime/ftplugin/java.vim @zzzyxwvut runtime/ftplugin/javascript.vim @dkearns runtime/ftplugin/javascriptreact.vim @dkearns +runtime/ftplugin/jj.vim @gpanders runtime/ftplugin/json.vim @dbarnett runtime/ftplugin/json5.vim @dkearns runtime/ftplugin/jsonc.vim @izhakjakov @@ -406,6 +407,7 @@ runtime/syntax/j.vim @glts runtime/syntax/jargon.vim @h3xx runtime/syntax/java.vim @zzzyxwvut runtime/syntax/javascript.vim @fleiner +runtime/syntax/jj.vim @gpanders runtime/syntax/json.vim @vito-c runtime/syntax/jsonc.vim @izhakjakov runtime/syntax/julia.vim @carlobaldassi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0720cb1699..99bfcfa2c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,17 +46,30 @@ Or open [the todo file][todo list] on GitHub to see the latest version. # Syntax, indent and other runtime files The latest version of these files can be obtained from the repository. -They are usually not updated with numbered patches. +They are usually not updated with numbered patches. However, they may +or may not work with older Vim releases (since they may contain new features). If you find a problem with one of these files or have a suggestion for improvement, please first try to contact the maintainer directly. -Look in the header of the file for the name and email address. +Look in the header of the file for the name, email address, github handle and/or +upstream repository. You may also check the [MAINTAINERS][11] file. The maintainer will take care of issues and send updates to the Vim project for distribution with Vim. If the maintainer does not respond, contact the [vim-dev][0] mailing list. +## Contributing new runtime files + +If you want to contribute new runtime files for Vim or Neovim, please create a +PR with your changes against this repository here. For new filetypes, do not forget: +* to add a new [filetype test][12] (keep it similar to the other filetype tests). +* all configuration switches should be documented + (check [filetype.txt][13] and/or [syntax.txt][14] for filetype and syntax plugins) +* add yourself as Maintainer to the top of file (again, keep the header similar to + other runtime files) +* add yourself to the [MAINTAINERS][11] file. + # Translations Translating messages and runtime files is very much appreciated! These things @@ -96,3 +109,7 @@ mailing list. For other questions please use the [Vi Stack Exchange][8] website, [8]: https://vi.stackexchange.com [9]: http://www.vim.org/maillist.php#vim-use [10]: https://github.com/vim/vim/discussions +[11]: https://github.com/vim/vim/blob/master/.github/MAINTAINERS +[12]: https://github.com/vim/vim/blob/master/src/testdir/test_filetype.vim +[13]: https://github.com/vim/vim/blob/master/runtime/doc/filetype.txt +[14]: https://github.com/vim/vim/blob/master/runtime/doc/syntax.txt @@ -5,7 +5,7 @@ SRC_ALL = \ .cirrus.yml \ .gitattributes \ - .github/CODEOWNERS \ + .github/MAINTAINERS \ .github/ISSUE_TEMPLATE/bug_report.yml \ .github/ISSUE_TEMPLATE/feature_request.md \ .github/workflows/ci.yml \ @@ -18,7 +18,7 @@ or one of the [Maillists](https://www.vim.org/community.php). ## What is Vim? Vim is a greatly improved version of the good old UNIX editor -[Vi](https://en.wikipedia.org/wiki/Vi). Many new +[Vi](https://en.wikipedia.org/wiki/Vi_(text_editor)). Many new features have been added: multi-level undo, syntax highlighting, command line history, on-line help, spell checking, filename completion, block operations, script language, etc. There is also a Graphical User Interface (GUI) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 4e7d517931..dd4fd30636 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -406,14 +406,18 @@ export def FTidl() setf idl enddef -# Distinguish between "default", Prolog and Cproto prototype file. +# Distinguish between "default", Prolog, zsh module's C and Cproto prototype file. export def ProtoCheck(default: string) + # zsh modules use '#include "*.pro"' + # https://github.com/zsh-users/zsh/blob/63f086d167960a27ecdbcb762179e2c2bf8a29f5/Src/Modules/example.c#L31 + if getline(1) =~ '/* Generated automatically */' + setf c # Cproto files have a comment in the first line and a function prototype in # the second line, it always ends in ";". Indent files may also have # comments, thus we can't match comments to see the difference. # IDL files can have a single ';' in the second line, require at least one # chacter before the ';'. - if getline(2) =~ '.;$' + elseif getline(2) =~ '.;$' setf cpp else # recognize Prolog by specific text in the first non-empty line diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index e2152b0dfc..4c95d2c715 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -9,6 +9,9 @@ " 2024 Feb 19 by Vim Project: (announce adoption) " 2024 Feb 29 by Vim Project: handle symlinks in tree mode correctly " 2024 Apr 03 by Vim Project: detect filetypes for remote edited files +" 2024 May 08 by Vim Project: cleanup legacy Win9X checks +" 2024 May 09 by Vim Project: remove hard-coded private.ppk +" 2024 May 10 by Vim Project: recursively delete directories by default " Former Maintainer: Charles E Campbell " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 @@ -280,14 +283,8 @@ call s:NetrwInit("g:netrw_rcp_cmd" , "rcp") call s:NetrwInit("g:netrw_rsync_cmd", "rsync") call s:NetrwInit("g:netrw_rsync_sep", "/") if !exists("g:netrw_scp_cmd") - if executable("scp") - call s:NetrwInit("g:netrw_scp_cmd" , "scp -q") - elseif executable("pscp") - if (has("win32") || has("win95") || has("win64") || has("win16")) && filereadable('c:\private.ppk') - call s:NetrwInit("g:netrw_scp_cmd", 'pscp -i c:\private.ppk') - else - call s:NetrwInit("g:netrw_scp_cmd", 'pscp -q') - endif + if executable("pscp") + call s:NetrwInit("g:netrw_scp_cmd", 'pscp -q') else call s:NetrwInit("g:netrw_scp_cmd" , "scp -q") endif @@ -296,7 +293,7 @@ endif call s:NetrwInit("g:netrw_sftp_cmd" , "sftp") call s:NetrwInit("g:netrw_ssh_cmd" , "ssh") -if (has("win32") || has("win95") || has("win64") || has("win16")) +if has("win32") \ && exists("g:netrw_use_nt_rcp") \ && g:netrw_use_nt_rcp \ && executable( $SystemRoot .'/system32/rcp.exe') @@ -311,12 +308,8 @@ endif " Default values for netrw's global variables {{{2 " Cygwin Detection ------- {{{3 if !exists("g:netrw_cygwin") - if has("win32") || has("win95") || has("win64") || has("win16") - if has("win32unix") && &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$' - let g:netrw_cygwin= 1 - else - let g:netrw_cygwin= 0 - endif + if has("win32unix") && &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$' + let g:netrw_cygwin= 1 else let g:netrw_cygwin= 0 endif @@ -372,10 +365,6 @@ endif call s:NetrwInit("g:netrw_keepdir",1) if !exists("g:netrw_list_cmd") if g:netrw_scp_cmd =~ '^pscp' && executable("pscp") - if (has("win32") || has("win95") || has("win64") || has("win16")) && filereadable("c:\\private.ppk") - " provide a pscp-based listing command - let g:netrw_scp_cmd ="pscp -i C:\\private.ppk" - endif if exists("g:netrw_list_cmd_options") let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME: ".g:netrw_list_cmd_options else @@ -403,7 +392,7 @@ if !exists("g:netrw_localcmdshell") let g:netrw_localcmdshell= "" endif if !exists("g:netrw_localcopycmd") - if has("win32") || has("win95") || has("win64") || has("win16") + if has("win32") if g:netrw_cygwin let g:netrw_localcopycmd= "cp" else @@ -417,7 +406,7 @@ if !exists("g:netrw_localcopycmd") endif endif if !exists("g:netrw_localcopydircmd") - if has("win32") || has("win95") || has("win64") || has("win16") + if has("win32") if g:netrw_cygwin let g:netrw_localcopydircmd = "cp" let g:netrw_localcopydircmdopt= " -R" @@ -439,7 +428,7 @@ if exists("g:netrw_local_mkdir") let g:netrw_localmkdir= g:netrw_local_mkdir call netrw#ErrorMsg(s:NOTE,"g:netrw_local_mkdir is deprecated in favor of g:netrw_localmkdir",87) endif -if has("win32") || has("win95") || has("win64") || has("win16") +if has("win32") if g:netrw_cygwin call s:NetrwInit("g:netrw_localmkdir","mkdir") else @@ -455,7 +444,7 @@ if exists("g:netrw_local_movecmd") call netrw#ErrorMsg(s:NOTE,"g:netrw_local_movecmd is deprecated in favor of g:netrw_localmovecmd",88) endif if !exists("g:netrw_localmovecmd") - if has("win32") || has("win95") || has("win64") || has("win16") + if has("win32") if g:netrw_cygwin let g:netrw_localmovecmd= "mv" else @@ -488,7 +477,7 @@ call s:NetrwInit("g:netrw_mousemaps" , (exists("+mouse") && &mouse =~# '[anh call s:NetrwInit("g:netrw_retmap" , 0) if has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin) call s:NetrwInit("g:netrw_chgperm" , "chmod PERM FILENAME") -elseif has("win32") || has("win95") || has("win64") || has("win16") +elseif has("win32") call s:NetrwInit("g:netrw_chgperm" , "cacls FILENAME /e /p PERM") else call s:NetrwInit("g:netrw_chgperm" , "chmod PERM FILENAME") @@ -547,14 +536,13 @@ if !exists("g:netrw_xstrlen") endif endif call s:NetrwInit("g:NetrwTopLvlMenu","Netrw.") -call s:NetrwInit("g:netrw_win95ftp",1) call s:NetrwInit("g:netrw_winsize",50) call s:NetrwInit("g:netrw_wiw",1) if g:netrw_winsize > 100|let g:netrw_winsize= 100|endif " --------------------------------------------------------------------- " Default values for netrw's script variables: {{{2 call s:NetrwInit("g:netrw_fname_escape",' ?&;%') -if has("win32") || has("win95") || has("win64") || has("win16") +if has("win32") call s:NetrwInit("g:netrw_glob_escape",'*?`{[]$') else call s:NetrwInit("g:netrw_glob_escape",'*[]?`{~$\') @@ -686,7 +674,7 @@ fun! netrw#Explore(indx,dosplit,style,...) " record current directory let curdir = simplify(b:netrw_curdir) let curfiledir = substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e') - if !exists("g:netrw_cygwin") && (has("win32") || has("win95") || has("win64") || has("win16")) + if !exists("g:netrw_cygwin") && has("win32") let curdir= substitute(curdir,'\','/','g') endif " call Decho("curdir<".curdir |