From 988b472d902e6116353fc2ae605bed32a37e6391 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 3 Dec 2023 15:58:27 +0100 Subject: feat(treesitter): highlight help files by default (#26347) --- runtime/ftplugin/help.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua index 4cc3386167..bf3408c2d9 100644 --- a/runtime/ftplugin/help.lua +++ b/runtime/ftplugin/help.lua @@ -1,3 +1,7 @@ +-- use treesitter over syntax (for highlighted code blocks) +vim.treesitter.start() + +-- add custom highlights for list in `:h highlight-groups` if vim.endswith(vim.fs.normalize(vim.api.nvim_buf_get_name(0)), '/doc/syntax.txt') then require('vim.vimhelp').highlight_groups() end -- cgit From f64e4b43e1191ff30d902730f752875aa55682ce Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 6 Dec 2023 08:51:09 +0100 Subject: vim-patch:6863084d3bd0 runtime(fortran): update syntax and ftplugins closes: vim/vim#13629 https://github.com/vim/vim/commit/6863084d3bd044700973e6180ccb1a044566ec46 Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com> --- runtime/ftplugin/fortran.vim | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/fortran.vim b/runtime/ftplugin/fortran.vim index 8f5b243b82..a057db9a4b 100644 --- a/runtime/ftplugin/fortran.vim +++ b/runtime/ftplugin/fortran.vim @@ -1,7 +1,8 @@ " Vim settings file " Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66) -" Version: (v53) 2021 April 06 (updated 2022 May 22) -" Maintainer: Ajit J. Thakkar ; +" Version: (v54) 2023 December 5 +" Maintainers: Ajit J. Thakkar ; +" Joshua Hollett " Usage: For instructions, do :help fortran-plugin from Vim " Credits: " Version 0.1 was created in September 2000 by Ajit Thakkar. @@ -39,7 +40,7 @@ if !exists("b:fortran_fixed_source") " Fixed-form file extension defaults let b:fortran_fixed_source = 1 else - " Modern fortran still allows both fixed and free source form + " Modern fortran compilers still allow both fixed and free source form " Assume fixed source form unless signs of free source form " are detected in the first five columns of the first s:lmax lines. " Detection becomes more accurate and time-consuming if more lines @@ -70,14 +71,14 @@ if (b:fortran_fixed_source == 1) " but some vendor extensions allow longer lines if exists("fortran_extended_line_length") setlocal tw=132 - elseif exists("fortran_cardimage_line_length") - setlocal tw=80 else - setlocal tw=72 + " The use of columns 73-80 for sequence numbers is obsolete + " so almost all compilers allow a textwidth of 80 + setlocal tw=80 " If you need to add "&" on continued lines so that the code is " compatible with both free and fixed format, then you should do so - " in column 73 and uncomment the next line - " setlocal tw=73 + " in column 81 and uncomment the next line + " setlocal tw=81 endif else setlocal comments=:! -- cgit From 02e85822304b7a03210a424d8168c3c7fa764cde Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 11 Dec 2023 17:48:23 +0100 Subject: vim-patch:5a68cdf14915 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runtime(sbt): do not set b:did_ftplugin before sourcing scala ftplugin(vim/vim#13657) The `b:did_ftplugin` guard was set and prevented us from actually sourcing `ftplugin/scala.vim`. Since the latter script also sets the guard properly, we can simply remove the guard here. https://github.com/vim/vim/commit/5a68cdf14915f20a1a6889cd0a76d29ecd374f24 Co-authored-by: Karl Yngve Lervåg --- runtime/ftplugin/sbt.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/sbt.vim b/runtime/ftplugin/sbt.vim index 309d30e503..bf2c7a657a 100644 --- a/runtime/ftplugin/sbt.vim +++ b/runtime/ftplugin/sbt.vim @@ -9,7 +9,6 @@ if exists('b:did_ftplugin') || &cp finish endif -let b:did_ftplugin = 1 - runtime! ftplugin/scala.vim +let b:did_ftplugin = 1 -- cgit From bf382df84f2d8900a91de368c6bfce6b950e4b7f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 16 Dec 2023 14:32:19 +0100 Subject: vim-patch:0f61943eb776 runtime(logtalk): Update Logtalk runtime files for the latest language spec (vim/vim#13697) https://github.com/vim/vim/commit/0f61943eb7769777a281e0f8b8ba4c5f46d13e84 Co-authored-by: Paulo Moura --- runtime/ftplugin/logtalk.dict | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/logtalk.dict b/runtime/ftplugin/logtalk.dict index 3fcdfc6f6a..0d076b7b3e 100644 --- a/runtime/ftplugin/logtalk.dict +++ b/runtime/ftplugin/logtalk.dict @@ -18,11 +18,8 @@ atan2 atom atomic atom_chars -atom_chars -atom_codes atom_codes atom_concat -atom_concat atom_length at_end_of_stream bagof @@ -32,6 +29,7 @@ call callable calls catch +catchall_catch category category_property ceiling @@ -45,9 +43,9 @@ coinduction coinductive compare complements -complements complements_object compound +conditionals conforms_to_protocol context context_switching_calls @@ -87,6 +85,7 @@ end_object end_protocol engines ensure_loaded +error evaluation_error events existence_error @@ -152,12 +151,13 @@ nonvar number numbervars number_chars -number_chars -number_codes number_codes object object_property once +one +one_or_error +one_or_more op open optimize @@ -226,6 +226,7 @@ term_variables this threaded threaded_call +threaded_cancel threaded_engine threaded_engine_create threaded_engine_destroy @@ -250,6 +251,7 @@ type_error undefined_predicates underscore_variables unify_with_occurs_check +uninstantiation_error unknown_entities unknown_predicates uses @@ -260,3 +262,8 @@ write writeq write_canonical xor +zero +zero_or_error +zero_or_more +zero_or_one +zero_or_one_or_error -- cgit From cc6a257c8cad8051b6f7e9287249293ab0a929d9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 18 Dec 2023 16:49:44 +0100 Subject: docs: apply current colorscheme to default highlight groups Problem: Not all default highlight groups show their actual colors. Solution: Refactor `vimhelp.lua` and apply it to all relevant lists (UI groups, syntax groups, treesitter groups, LSP groups, diagnostic groups). --- runtime/ftplugin/help.lua | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua index bf3408c2d9..67c417b1be 100644 --- a/runtime/ftplugin/help.lua +++ b/runtime/ftplugin/help.lua @@ -2,6 +2,27 @@ vim.treesitter.start() -- add custom highlights for list in `:h highlight-groups` -if vim.endswith(vim.fs.normalize(vim.api.nvim_buf_get_name(0)), '/doc/syntax.txt') then - require('vim.vimhelp').highlight_groups() +local bufname = vim.fs.normalize(vim.api.nvim_buf_get_name(0)) +if vim.endswith(bufname, '/doc/syntax.txt') then + require('vim.vimhelp').highlight_groups({ + { start = [[\*group-name\*]], stop = '^======', match = '^(%w+)\t' }, + { start = [[\*highlight-groups\*]], stop = '^======', match = '^(%w+)\t' }, + }) +elseif vim.endswith(bufname, '/doc/treesitter.txt') then + require('vim.vimhelp').highlight_groups({ + { + start = [[\*treesitter-highlight-groups\*]], + stop = [[\*treesitter-highlight-spell\*]], + match = '^@[%w%p]+', + }, + }) +elseif vim.endswith(bufname, '/doc/diagnostic.txt') then + require('vim.vimhelp').highlight_groups({ + { start = [[\*diagnostic-highlights\*]], stop = '^======', match = '^(%w+)' }, + }) +elseif vim.endswith(bufname, '/doc/lsp.txt') then + require('vim.vimhelp').highlight_groups({ + { start = [[\*lsp-highlight\*]], stop = '^------', match = '^(%w+)' }, + { start = [[\*lsp-semantic-highlight\*]], stop = '^======', match = '^@[%w%p]+' }, + }) end -- cgit From 2a173c0669764ff35023e5e3566eb4eeebf11a72 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 21 Dec 2023 17:17:17 +0100 Subject: vim-patch:18ab6c3392ef runtime(erlang): add support for matchit plugin (vim/vim#13713) This commit updates the Erlang runtime files to be in sync with the `vim-erlang-runtime` repository. In particular, it adds the following commit (with some cleanup and simplification afterwards): https://github.com/vim-erlang/vim-erlang-runtime/commit/6ea8b85bc9c93b94c68ec53489a74f5687d898b0 https://github.com/vim/vim/commit/18ab6c3392ef83abf078042e233d085fe80b6c06 Co-authored-by: Csaba Hoch --- runtime/ftplugin/erlang.vim | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/erlang.vim b/runtime/ftplugin/erlang.vim index 31fa0c3213..1cb57f4c85 100644 --- a/runtime/ftplugin/erlang.vim +++ b/runtime/ftplugin/erlang.vim @@ -5,7 +5,8 @@ " Contributors: Ricardo Catalinas Jiménez " Eduardo Lopez (http://github.com/tapichu) " Arvid Bjurklint (http://github.com/slarwise) -" Last Update: 2021-Nov-22 +" Paweł Zacharek (http://github.com/subc2) +" Last Update: 2023-Dec-20 " License: Vim license " URL: https://github.com/vim-erlang/vim-erlang-runtime @@ -57,7 +58,7 @@ setlocal suffixesadd=.erl,.hrl let &l:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")' let &l:define = '^\s*-\%(define\|record\|type\|opaque\)' -let s:erlang_fun_begin = '^\a\w*(.*$' +let s:erlang_fun_begin = '^\l[A-Za-z0-9_@]*(.*$' let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$' if !exists('*GetErlangFold') @@ -95,9 +96,22 @@ if !exists('*ErlangFoldText') endfunction endif +" The following lines enable the macros/matchit.vim plugin for extended +" matching with the % key. +let b:match_ignorecase = 0 +let b:match_words = + \ '\<\%(begin\|case\|fun\|if\|maybe\|receive\|try\)\>' . + \ ':\<\%(after\|catch\|else\|of\)\>' . + \ ':\,' . + \ '^\l[A-Za-z0-9_@]*' . + \ ':^\%(\%(\t\| \{' . shiftwidth() . + \ '}\)\%([^\t\ %][^%]*\)\?\)\?;\s*\%(%.*\)\?$\|\.[\t\ %]\|\.$' +let b:match_skip = 's:comment\|string\|erlangmodifier\|erlangquotedatom' + let b:undo_ftplugin = "setlocal keywordprg< foldmethod< foldexpr< foldtext<" \ . " comments< commentstring< formatoptions< suffixesadd< include<" \ . " define<" + \ . " | unlet b:match_ignorecase b:match_words b:match_skip" let &cpo = s:cpo_save unlet s:cpo_save -- cgit From 7121241e5cecbd741795aec37a3cb1203c8e9f34 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 23 Dec 2023 11:38:18 +0100 Subject: vim-patch:ea9964a36f94 Runtime(fortran): updates to indent, syntax and ftplugin (vim/vim#13752) * runtime update fortran.vim Add folding for newer features of Fortran * Runtime Update fortran.vim Add indent support for newer features of Fortran * Runtime Update fortran.vim Add newer features of Fortran to matchit patterns https://github.com/vim/vim/commit/ea9964a36f948c1266d43dd8b3890c6f3bdd243d Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com> --- runtime/ftplugin/fortran.vim | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/fortran.vim b/runtime/ftplugin/fortran.vim index a057db9a4b..d714a4ac4f 100644 --- a/runtime/ftplugin/fortran.vim +++ b/runtime/ftplugin/fortran.vim @@ -1,6 +1,6 @@ " Vim settings file -" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66) -" Version: (v54) 2023 December 5 +" Language: Fortran 2023 (and Fortran 2018, 2008, 2003, 95, 90, 77, 66) +" Version: (v55) 2023 December 22 " Maintainers: Ajit J. Thakkar ; " Joshua Hollett " Usage: For instructions, do :help fortran-plugin from Vim @@ -110,7 +110,9 @@ if !exists("b:match_words") let b:match_ignorecase = 1 let b:match_words = \ '(:),' . - \ '\:' . s:notselect. '\:\,' . + \ s:notend .'\:' . s:notselect. '\:\,' . + \ s:notend .'\:' . s:notselect. '\:\,' . + \ s:notend .'\:' . s:notselect. '\:\,' . \ s:notelse . '\:' . \ s:nothash . '\:' . s:nothash . '\,'. \ 'do\s\+\(\d\+\):\%(^\s*\)\@<=\1\s,'. @@ -119,6 +121,9 @@ if !exists("b:match_words") \ s:notend . '\,'. \ s:notend . '\:\,'. \ s:notend . '\:\,'. + \ s:notend . '\:\,'. + \ s:notend . '\:\,'. + \ s:notend . '\:\,'. \ s:notend . '\:\,'. \ s:notend . '\:\,'. \ s:notend . '\:\,'. -- cgit From ecbfff73065b912775182702d051e7438587db75 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 27 Dec 2023 19:06:20 +0100 Subject: vim-patch:7e2741100737 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runtime(elixir): fix indentation (vim/vim#13771) https://github.com/vim/vim/commit/7e27411007378e005339ef37503697ae7e183da1 Co-authored-by: George Guimarães --- runtime/ftplugin/elixir.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/elixir.vim b/runtime/ftplugin/elixir.vim index 50f63673dc..29be4fa1ee 100644 --- a/runtime/ftplugin/elixir.vim +++ b/runtime/ftplugin/elixir.vim @@ -1,7 +1,7 @@ " Elixir filetype plugin " Language: Elixir " Maintainer: Mitchell Hanberg -" Last Change: 2022 Sep 20 +" Last Change: 2023 Dec 26 if exists("b:did_ftplugin") finish @@ -27,6 +27,12 @@ setlocal shiftwidth=2 softtabstop=2 expandtab iskeyword+=!,? setlocal comments=:# setlocal commentstring=#\ %s +setlocal indentkeys=0#,!^F,o,O +" Enable keys for blocks +setlocal indentkeys+=0=after,0=catch,0=do,0=else,0=end,0=rescue +" Enable keys that are usually the first keys in a line +setlocal indentkeys+=0->,0\|>,0},0],0),> + let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms<' let &cpo = s:save_cpo -- cgit From 320c77fa528e96aac0931383160fa9ce3f7a3eec Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 27 Dec 2023 19:34:28 +0100 Subject: vim-patch:d1cea036467c runtime(elixir): missing undo_ftplugin for indentkeys fixup after vim/vim#13771 https://github.com/vim/vim/commit/d1cea036467ca55d7698378679a1e32c9f056d59 Co-authored-by: Christian Brabandt --- runtime/ftplugin/elixir.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/elixir.vim b/runtime/ftplugin/elixir.vim index 29be4fa1ee..d067f472b7 100644 --- a/runtime/ftplugin/elixir.vim +++ b/runtime/ftplugin/elixir.vim @@ -1,7 +1,7 @@ " Elixir filetype plugin " Language: Elixir " Maintainer: Mitchell Hanberg -" Last Change: 2023 Dec 26 +" Last Change: 2023 Dec 27 if exists("b:did_ftplugin") finish @@ -33,7 +33,7 @@ setlocal indentkeys+=0=after,0=catch,0=do,0=else,0=end,0=rescue " Enable keys that are usually the first keys in a line setlocal indentkeys+=0->,0\|>,0},0],0),> -let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms<' +let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< indk<' let &cpo = s:save_cpo unlet s:save_cpo -- cgit From ffb97af88785d8bf5b10ea82d1406f4d6aa6f799 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 29 Dec 2023 00:27:40 +0100 Subject: vim-patch:48ddc6a6f86f runtime(git): Add small ftplugin https://github.com/vim/vim/commit/48ddc6a6f86f1f42bdb49d308d72c15b0e90ce5a Co-authored-by: Tim Pope --- runtime/ftplugin/git.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 runtime/ftplugin/git.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/git.vim b/runtime/ftplugin/git.vim new file mode 100644 index 0000000000..7fcce53056 --- /dev/null +++ b/runtime/ftplugin/git.vim @@ -0,0 +1,15 @@ +" Vim filetype plugin +" Language: generic git output +" Maintainer: Tim Pope +" Last Change: 2023 Mar 26 + +" Only do this when not done yet for this buffer +if (exists("b:did_ftplugin")) + finish +endif + +let b:did_ftplugin = 1 + +setlocal nomodeline + +let b:undo_ftplugin = "setl modeline<" -- cgit From 419f0387276f6b1b72ad2cb56366f31d3ad6265e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 29 Dec 2023 00:28:54 +0100 Subject: vim-patch:fda02d03c0cf runtime(gitcommit): Updates to ftplugin and syntax https://github.com/vim/vim/commit/fda02d03c0cfe017e465c58b3baf8b3106287578 Co-authored-by: Tim Pope --- runtime/ftplugin/gitcommit.vim | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/gitcommit.vim b/runtime/ftplugin/gitcommit.vim index 9342799b56..3749328595 100644 --- a/runtime/ftplugin/gitcommit.vim +++ b/runtime/ftplugin/gitcommit.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: git commit file " Maintainer: Tim Pope -" Last Change: 2022 Jan 05 +" Last Change: 2023 Dec 28 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) @@ -12,7 +12,7 @@ let b:did_ftplugin = 1 setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72 setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n -setlocal formatlistpat+=\\\|^\\s*[-*+]\\s\\+ +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}]\\s\\+\\\|^\\s*[-*+]\\s\\+ setlocal include=^+++ setlocal includeexpr=substitute(v:fname,'^[bi]/','','') @@ -42,6 +42,11 @@ function! s:diffcomplete(A, L, P) abort return args endfunction +function! s:setupdiff() abort + command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(0, ) + setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git +endfunction + function! s:gitdiffcached(bang, ...) abort let name = tempname() if a:0 @@ -50,8 +55,6 @@ function! s:gitdiffcached(bang, ...) abort let extra = "-p --stat=".&columns endif call system("git diff --cached --no-color --no-ext-diff ".extra." > ".shellescape(name)) - exe "pedit " . fnameescape(name) - wincmd P - command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(0, ) - setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git + exe 'pedit +call\ s:setupdiff()' fnameescape(name) + silent! wincmd P endfunction -- cgit From 7709597a1d79e053587cb01f2a7d7c0f3e72d9ab Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 29 Dec 2023 00:29:16 +0100 Subject: vim-patch:a907c9199216 runtime(sass): Provide sass_recommended_style option https://github.com/vim/vim/commit/a907c91992167e41da41008d4370e434e324cbf2 Co-authored-by: Tim Pope --- runtime/ftplugin/sass.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/sass.vim b/runtime/ftplugin/sass.vim index 9ce446137a..e650be9312 100644 --- a/runtime/ftplugin/sass.vim +++ b/runtime/ftplugin/sass.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Sass " Maintainer: Tim Pope -" Last Change: 2019 Dec 05 +" Last Change: 2023 Dec 28 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -23,6 +23,11 @@ if &filetype =~# '\' let b:undo_ftplugin .= ' isk<' endif +if get(g:, 'sass_recommended_style', 1) + setlocal shiftwidth=2 softtabstop=2 expandtab + let b:undo_ftplugin .= ' sw< sts< et<' +endif + let &l:define = '^\C\v\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@=' let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\=' -- cgit From 51c22b9321ac22293e6bec898fe9027e8100703e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 29 Dec 2023 00:29:38 +0100 Subject: vim-patch:244f01658f9c runtime(markdown): Fix folding of code blocks https://github.com/vim/vim/commit/244f01658f9c60c71a776a2162c28ea93e102f12 Co-authored-by: Tim Pope --- runtime/ftplugin/markdown.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/markdown.vim b/runtime/ftplugin/markdown.vim index 2b963f139d..022dd0d601 100644 --- a/runtime/ftplugin/markdown.vim +++ b/runtime/ftplugin/markdown.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Markdown " Maintainer: Tim Pope -" Last Change: 2022 Oct 13 +" Last Change: 2023 Dec 28 if exists("b:did_ftplugin") finish @@ -35,7 +35,7 @@ if !exists("g:no_plugin_maps") && !exists("g:no_markdown_maps") endif function! s:NotCodeBlock(lnum) abort - return synIDattr(synID(a:lnum, 1, 1), 'name') !=# 'markdownCode' + return synIDattr(synID(a:lnum, 1, 1), 'name') !=# 'markdownCodeBlock' endfunction function! MarkdownFold() abort -- cgit From f69658bc355e130fc2845a8e0edc8baa4f256329 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 1 Jan 2024 15:37:07 +0100 Subject: feat(treesitter): highlight Lua files by default (#26824) --- runtime/ftplugin/lua.lua | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 runtime/ftplugin/lua.lua (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/lua.lua b/runtime/ftplugin/lua.lua new file mode 100644 index 0000000000..98f218e36e --- /dev/null +++ b/runtime/ftplugin/lua.lua @@ -0,0 +1,2 @@ +-- use treesitter over syntax +vim.treesitter.start() -- cgit From 99f1530a4f607b80f21135440e267460485b318a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 1 Jan 2024 19:33:16 +0100 Subject: vim-patch:d08059ab48b8 runtime(ruby): Update ftplugin and omni-complete (vim/vim#13805) https://github.com/vim/vim/commit/d08059ab48b822a25060b8a486085371ddeebcf7 Co-authored-by: dkearns --- runtime/ftplugin/ruby.vim | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index b61c1765d9..b07ed53188 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -2,8 +2,7 @@ " Language: Ruby " Maintainer: Tim Pope " URL: https://github.com/vim-ruby/vim-ruby -" Release Coordinator: Doug Kearns -" Last Change: 2023 Sep 1st +" Last Change: 2023 Dec 31 if (exists("b:did_ftplugin")) finish @@ -60,35 +59,38 @@ if !exists('g:ruby_version_paths') let g:ruby_version_paths = {} endif +let s:path_split = has('win32') ? ';' : ':' + function! s:query_path(root) abort - " Disabled by default for security reasons. - if !get(g:, 'ruby_exec', get(g:, 'plugin_exec', 0)) - return [] + " Disabled by default for security reasons. + if !get(g:, 'ruby_exec', get(g:, 'plugin_exec', 0)) || empty(a:root) + return map(split($RUBYLIB, s:path_split), 'v:val ==# "." ? "" : v:val') endif let code = "print $:.join %q{,}" - if &shell =~# 'sh' && empty(&shellxquote) - let prefix = 'env PATH='.shellescape($PATH).' ' - else - let prefix = '' - endif if &shellxquote == "'" - let path_check = prefix.'ruby --disable-gems -e "' . code . '"' + let args = ' --disable-gems -e "' . code . '"' else - let path_check = prefix."ruby --disable-gems -e '" . code . "'" + let args = " --disable-gems -e '" . code . "'" endif - let cd = haslocaldir() ? 'lcd' : 'cd' + let cd = haslocaldir() ? 'lcd' : exists(':tcd') && haslocaldir(-1) ? 'tcd' : 'cd' let cwd = fnameescape(getcwd()) try exe cd fnameescape(a:root) - let s:tmp_cwd = getcwd() - if (fnamemodify(exepath('ruby'), ':p:h') ==# cwd - \ && (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) == -1 || s:tmp_cwd == '.')) - let path = [] + for dir in split($PATH, s:path_split) + if dir !=# '.' && executable(dir . '/ruby') == 1 + let exepath = dir . '/ruby' + break + endif + endfor + if exists('l:exepath') + let path = split(system(exepath . args),',') + if v:shell_error + let path = [] + endif else - let path = split(system(path_check),',') + let path = [] endif - unlet! s:tmp_cwd exe cd cwd return path finally @@ -129,10 +131,8 @@ else if !exists('g:ruby_default_path') if has("ruby") && has("win32") ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) ) - elseif executable('ruby') && !empty($HOME) - let g:ruby_default_path = s:query_path($HOME) else - let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val') + let g:ruby_default_path = s:query_path($HOME) endif endif let s:ruby_paths = g:ruby_default_path -- cgit From 7ed69660237bd052d11af454503a986c22c507a7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 15 Jan 2024 11:12:32 +0100 Subject: vim-patch:93197fde0f1d runtime(ftplugin): Use "*" browsefilter pattern to match "All Files" Problem: The "*.*" browsefilter pattern only matches all files on Windows (Daryl Lee) Solution: Use "*" to filter on all platforms but keep "*.*" as the label text on Windows. (Fixes vim/vim#12685, Doug Kearns) The *.* browsefilter pattern used to match "All Files" on Windows is a legacy of the DOS 8.3 filename wildcard matching algorithm. For reasons of backward compatibility this still works on Windows to match all files, even those without an extension. However, this pattern only matches filenames containing a dot on other platforms. This often makes files without an extension difficult to access from the file dialog, e.g., "Makefile" On Windows it is still standard practice to use "*.*" for the filter label so ftplugins should use "All Files (*.*)" on Windows and "All Files (*)" on other platforms. This matches Vim's default browsefilter values. This commit also normalises the browsefilter conditional test to check for the Win32 and GTK GUI features and an unset b:browsefilter. closes: vim/vim#12759 https://github.com/vim/vim/commit/93197fde0f1db09b1e495cf3eb14a8f42c318b80 Co-authored-by: Doug Kearns --- runtime/ftplugin/aap.vim | 9 +++++++-- runtime/ftplugin/abap.vim | 15 ++++++++++----- runtime/ftplugin/abaqus.vim | 9 +++++++-- runtime/ftplugin/ant.vim | 15 ++++++++++----- runtime/ftplugin/aspvbs.vim | 15 ++++++++++----- runtime/ftplugin/awk.vim | 14 +++++++++----- runtime/ftplugin/basic.vim | 10 +++++++--- runtime/ftplugin/c.vim | 32 +++++++++++++++++--------------- runtime/ftplugin/clojure.vim | 9 +++++++-- runtime/ftplugin/cobol.vim | 9 +++++++-- runtime/ftplugin/config.vim | 15 ++++++++++----- runtime/ftplugin/cs.vim | 11 ++++++++--- runtime/ftplugin/csh.vim | 10 +++++++--- runtime/ftplugin/diff.vim | 9 +++++++-- runtime/ftplugin/dosbatch.vim | 12 +++++++++--- runtime/ftplugin/dtd.vim | 15 ++++++++++----- runtime/ftplugin/eiffel.vim | 10 +++++++--- runtime/ftplugin/eruby.vim | 11 ++++++++--- runtime/ftplugin/expect.vim | 10 +++++++--- runtime/ftplugin/falcon.vim | 13 +++++++++---- runtime/ftplugin/forth.vim | 9 +++++++-- runtime/ftplugin/fortran.vim | 10 ++++++++-- runtime/ftplugin/fpcmake.vim | 12 ++++++++---- runtime/ftplugin/freebasic.vim | 10 +++++++--- runtime/ftplugin/haml.vim | 15 ++++++++++----- runtime/ftplugin/html.vim | 12 ++++++++---- runtime/ftplugin/icon.vim | 16 ++++++++++------ runtime/ftplugin/ishd.vim | 10 +++++++--- runtime/ftplugin/j.vim | 7 ++++++- runtime/ftplugin/java.vim | 15 ++++++++++----- runtime/ftplugin/javascript.vim | 8 ++++++-- runtime/ftplugin/json5.vim | 10 +++++++--- runtime/ftplugin/jsp.vim | 15 ++++++++++----- runtime/ftplugin/kotlin.vim | 10 +++++++--- runtime/ftplugin/kwt.vim | 15 ++++++++++----- runtime/ftplugin/lua.vim | 10 +++++++--- runtime/ftplugin/lynx.vim | 10 +++++++--- runtime/ftplugin/m3build.vim | 10 +++++++--- runtime/ftplugin/m3quake.vim | 10 +++++++--- runtime/ftplugin/meson.vim | 9 +++++++-- runtime/ftplugin/modula2.vim | 10 +++++++--- runtime/ftplugin/modula3.vim | 10 +++++++--- runtime/ftplugin/msmessages.vim | 13 +++++++++---- runtime/ftplugin/occam.vim | 17 +++++++++++------ runtime/ftplugin/octave.vim | 10 +++++++--- runtime/ftplugin/pascal.vim | 10 +++++++--- runtime/ftplugin/perl.vim | 9 +++++++-- runtime/ftplugin/php.vim | 10 +++++++--- runtime/ftplugin/pod.vim | 10 ++++++++-- runtime/ftplugin/poke.vim | 16 ++++++++++------ runtime/ftplugin/postscr.vim | 15 ++++++++++----- runtime/ftplugin/ps1.vim | 13 +++++++++---- runtime/ftplugin/ps1xml.vim | 13 +++++++++---- runtime/ftplugin/pyrex.vim | 13 +++++++++---- runtime/ftplugin/python.vim | 9 +++++++-- runtime/ftplugin/qml.vim | 12 +++++++++--- runtime/ftplugin/r.vim | 9 +++++++-- runtime/ftplugin/racket.vim | 9 +++++++-- runtime/ftplugin/readline.vim | 10 +++++++--- runtime/ftplugin/registry.vim | 15 ++++++++++----- runtime/ftplugin/rhelp.vim | 9 +++++++-- runtime/ftplugin/rmd.vim | 9 +++++++-- runtime/ftplugin/rnoweb.vim | 9 +++++++-- runtime/ftplugin/routeros.vim | 9 +++++++-- runtime/ftplugin/rrst.vim | 9 +++++++-- runtime/ftplugin/ruby.vim | 9 +++++++-- runtime/ftplugin/sed.vim | 10 +++++++--- runtime/ftplugin/sgml.vim | 15 ++++++++++----- runtime/ftplugin/sh.vim | 14 +++++++++----- runtime/ftplugin/solution.vim | 10 +++++++--- runtime/ftplugin/sql.vim | 13 +++++++++---- runtime/ftplugin/svg.vim | 15 ++++++++++----- runtime/ftplugin/tcl.vim | 13 +++++++++---- runtime/ftplugin/tcsh.vim | 10 +++++++--- runtime/ftplugin/tidy.vim | 16 ++++++++++------ runtime/ftplugin/typescript.vim | 15 ++++++++++----- runtime/ftplugin/vb.vim | 10 +++++++--- runtime/ftplugin/verilog.vim | 13 +++++++++---- runtime/ftplugin/vhdl.vim | 14 ++++++++------ runtime/ftplugin/wget.vim | 10 +++++++--- runtime/ftplugin/wget2.vim | 10 +++++++--- runtime/ftplugin/xhtml.vim | 15 ++++++++++----- runtime/ftplugin/xml.vim | 9 +++++++-- runtime/ftplugin/xsd.vim | 15 ++++++++++----- runtime/ftplugin/xslt.vim | 2 +- 85 files changed, 689 insertions(+), 303 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/aap.vim b/runtime/ftplugin/aap.vim index df839c99ae..cd7e2a425e 100644 --- a/runtime/ftplugin/aap.vim +++ b/runtime/ftplugin/aap.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Aap recipe " Maintainer: The Vim Project -" Last Change: 2023 Aug 10 +" Last Change: 2024 Jan 14 " Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer @@ -28,6 +28,11 @@ setlocal commentstring=#\ %s setlocal expandtab if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "Aap Recipe Files (*.aap)\t*.aap\nAll Files (*.*)\t*.*\n" + let b:browsefilter = "Aap Recipe Files (*.aap)\t*.aap\n" + if has("win32") + let b:browsefilter ..= "All Files (*.*)\t*\n" + else + let b:browsefilter ..= "All Files (*)\t*\n" + endif let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif diff --git a/runtime/ftplugin/abap.vim b/runtime/ftplugin/abap.vim index 61db8093fb..8b2040e5aa 100644 --- a/runtime/ftplugin/abap.vim +++ b/runtime/ftplugin/abap.vim @@ -3,7 +3,8 @@ " Author: Steven Oliver " Copyright: Copyright (c) 2013 Steven Oliver " License: You may redistribute this under the same terms as Vim itself -" Last Change: 2023 Aug 28 by Vim Project (undo_ftplugin) +" Last Change: 2023 Aug 28 by Vim Project (undo_ftplugin) +" 2024 Jan 14 by Vim Project (browsefilter) " -------------------------------------------------------------------------- " Only do this when not done yet for this buffer @@ -21,10 +22,14 @@ setlocal suffixesadd=.abap let b:undo_ftplugin = "setl sts< sua< sw<" " Windows allows you to filter the open file dialog -if has("gui_win32") && !exists("b:browsefilter") - let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" . - \ "All Files (*.*)\t*.*\n" - let b:undo_ftplugin .= " | unlet! b:browsefilter" +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" + if has("win32") + let b:browsefilter ..= "All Files (*.*)\t*\n" + else + let b:browsefilter ..= "All Files (*)\t*\n" + endif + let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/abaqus.vim b/runtime/ftplugin/abaqus.vim index 5931cd921d..c16e7b032e 100644 --- a/runtime/ftplugin/abaqus.vim +++ b/runtime/ftplugin/abaqus.vim @@ -2,6 +2,7 @@ " Language: Abaqus finite element input file (www.abaqus.com) " Maintainer: Carl Osterwisch " Last Change: 2022 Oct 08 +" 2024 Jan 14 by Vim Project (browsefilter) " Only do this when not done yet for this buffer if exists("b:did_ftplugin") | finish | endif @@ -49,8 +50,12 @@ endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Abaqus Input Files (*.inp *.inc)\t*.inp;*.inc\n" . \ "Abaqus Results (*.dat)\t*.dat\n" . - \ "Abaqus Messages (*.pre *.msg *.sta)\t*.pre;*.msg;*.sta\n" . - \ "All Files (*.*)\t*.*\n" + \ "Abaqus Messages (*.pre, *.msg, *.sta)\t*.pre;*.msg;*.sta\n" + if has("win32") + let b:browsefilter .= "All Files (*.*)\t*\n" + else + let b:browsefilter .= "All Files (*)\t*\n" + endif let b:undo_ftplugin .= "|unlet! b:browsefilter" endif diff --git a/runtime/ftplugin/ant.vim b/runtime/ftplugin/ant.vim index aee07ca4b9..65e01a1a76 100644 --- a/runtime/ftplugin/ant.vim +++ b/runtime/ftplugin/ant.vim @@ -1,10 +1,11 @@ " Vim filetype plugin file -" Language: ant +" Language: ant " " This runtime file is looking for a new maintainer. " " Former maintainer: Dan Sharp -" Last Changed: 20 Jan 2009 +" Last Change: 2009 Jan 20 +" 2024 Jan 14 by Vim Project (browsefilter) if exists("b:did_ftplugin") | finish | endif @@ -15,8 +16,12 @@ set cpo-=C " Define some defaults in case the included ftplugins don't set them. let s:undo_ftplugin = "" -let s:browsefilter = "XML Files (*.xml)\t*.xml\n" . - \ "All Files (*.*)\t*.*\n" +let s:browsefilter = "XML Files (*.xml)\t*.xml\n" +if has("win32") + let s:browsefilter .= "All Files (*.*)\t*\n" +else + let s:browsefilter .= "All Files (*)\t*\n" +endif runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim let b:did_ftplugin = 1 @@ -30,7 +35,7 @@ if exists("b:browsefilter") endif " Change the :browse e filter to primarily show Ant-related files. -if has("gui_win32") +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Build Files (build.xml)\tbuild.xml\n" . \ "Java Files (*.java)\t*.java\n" . \ "Properties Files (*.prop*)\t*.prop*\n" . diff --git a/runtime/ftplugin/aspvbs.vim b/runtime/ftplugin/aspvbs.vim index 70a130d287..6979bb8f84 100644 --- a/runtime/ftplugin/aspvbs.vim +++ b/runtime/ftplugin/aspvbs.vim @@ -1,10 +1,11 @@ " Vim filetype plugin file -" Language: aspvbs +" Language: aspvbs " " This runtime file is looking for a new maintainer. " " Former maintainer: Dan Sharp -" Last Changed: 20 Jan 2009 +" Last Change: 2009 Jan 20 +" 2024 Jan 14 by Vim Project (browsefilter) if exists("b:did_ftplugin") | finish | endif @@ -15,8 +16,12 @@ set cpo-=C " Define some defaults in case the included ftplugins don't set them. let s:undo_ftplugin = "" -let s:browsefilter = "HTML Files (*.html, *.htm)\t*.htm*\n" . - \ "All Files (*.*)\t*.*\n" +let s:browsefilter = "HTML Files (*.html, *.htm)\t*.htm*\n" +if has("win32") + let s:browsefilter .= "All Files (*.*)\t*\n" +else + let s:browsefilter .= "All Files (*)\t*\n" +endif let s:match_words = "" runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim @@ -51,7 +56,7 @@ if exists("loaded_matchit") endif " Change the :browse e filter to primarily show ASP-related files. -if has("gui_win32") +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter="ASP Files (*.asp)\t*.asp\n" . s:browsefilter endif diff --git a/runtime/ftplugin/awk.vim b/runtime/ftplugin/awk.vim index 40fe304cf4..bcd772350a 100644 --- a/runtime/ftplugin/awk.vim +++ b/runtime/ftplugin/awk.vim @@ -2,7 +2,7 @@ " Language: awk, nawk, gawk, mawk " Maintainer: Doug Kearns " Previous Maintainer: Antonio Colombo -" Last Change: 2020 Sep 28 +" Last Change: 2024 Jan 14 " This plugin was prepared by Mark Sikora " This plugin was updated as proposed by Doug Kearns @@ -25,8 +25,7 @@ setlocal formatoptions-=t formatoptions+=croql setlocal define=function setlocal suffixesadd+=.awk -let b:undo_ftplugin = "setl fo< com< cms< def< sua<" . - \ " | unlet! b:browsefilter" +let b:undo_ftplugin = "setl fo< com< cms< def< sua<" " TODO: set this in scripts.vim? if exists("g:awk_is_gawk") @@ -49,8 +48,13 @@ if exists("g:awk_is_gawk") endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "Awk Source Files (*.awk,*.gawk)\t*.awk;*.gawk\n" . - \ "All Files (*.*)\t*.*\n" + let b:browsefilter = "Awk Source Files (*.awk, *.gawk)\t*.awk;*.gawk\n" + if has("win32") + let b:browsefilter .= "All Files (*.*)\t*\n" + else + let b:browsefilter .= "All Files (*)\t*\n" + endif + let b:undo_ftplugin .= " | unlet! b:browsefilter" endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/basic.vim b/runtime/ftplugin/basic.vim index 4399fbf3ad..32f713b43e 100644 --- a/runtime/ftplugin/basic.vim +++ b/runtime/ftplugin/basic.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: BASIC (QuickBASIC 4.5) " Maintainer: Doug Kearns -" Last Change: 2022 Jun 22 +" Last Change: 2024 Jan 14 if exists("b:did_ftplugin") finish @@ -45,8 +45,12 @@ endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" .. - \ "BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n" .. - \ "All Files (*.*)\t*.*\n" + \ "BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n" + if has("win32") + let b:browsefilter ..= "All Files (*.*)\t*\n" + else + let b:browsefilter ..= "All Files (*)\t*\n" + endif let b:basic_set_browsefilter = 1 let b:undo_ftplugin ..= " | unlet! b:browsefilter b:basic_set_browsefilter" endif diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index 83fb9ead68..716b454675 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: C " Maintainer: The Vim Project -" Last Change: 2023 Aug 10 +" Last Change: 2023 Aug 22 " Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer @@ -43,24 +43,26 @@ if !exists("b:match_words") let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words" endif -" Win32 can filter files in the browse dialog +" Win32 and GTK can filter files in the browse dialog if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") if &ft == "cpp" - let b:browsefilter = "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" . - \ "C Header Files (*.h)\t*.h\n" . - \ "C Source Files (*.c)\t*.c\n" . - \ "All Files (*.*)\t*.*\n" + let b:browsefilter = "C++ Source Files (*.cpp, *.c++)\t*.cpp;*.c++\n" .. + \ "C Header Files (*.h)\t*.h\n" .. + \ "C Source Files (*.c)\t*.c\n" elseif &ft == "ch" - let b:browsefilter = "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" . - \ "C Header Files (*.h)\t*.h\n" . - \ "C Source Files (*.c)\t*.c\n" . - \ "All Files (*.*)\t*.*\n" + let b:browsefilter = "Ch Source Files (*.ch, *.chf)\t*.ch;*.chf\n" .. + \ "C Header Files (*.h)\t*.h\n" .. + \ "C Source Files (*.c)\t*.c\n" else - let b:browsefilter = "C Source Files (*.c)\t*.c\n" . - \ "C Header Files (*.h)\t*.h\n" . - \ "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" . - \ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" . - \ "All Files (*.*)\t*.*\n" + let b:browsefilter = "C Source Files (*.c)\t*.c\n" .. + \ "C Header Files (*.h)\t*.h\n" .. + \ "Ch Source Files (*.ch, *.chf)\t*.ch;*.chf\n" .. + \ "C++ Source Files (*.cpp, *.c++)\t*.cpp;*.c++\n" + endif + if has("win32") + let b:browsefilter ..= "All Files (*.*)\t*\n" + else + let b:browsefilter ..= "All Files (*)\t*\n" endif let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif diff --git a/runtime/ftplugin/clojure.vim b/runtime/ftplugin/clojure.vim index c922d75699..4da7554d85 100644 --- a/runtime/ftplugin/clojure.vim +++ b/runtime/ftplugin/clojure.vim @@ -6,6 +6,7 @@ " URL: https://github.com/clojure-vim/clojure.vim " License: Vim (see :h license) " Last Change: 2022-03-24 +" 2024 Jan 14 by Vim Project (browsefilter) if exists("b:did_ftplugin") finish @@ -66,10 +67,14 @@ endif " Filter files in the browse dialog if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "All Files\t*\n" . - \ "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" . + let b:browsefilter = "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" . \ "EDN Files\t*.edn\n" . \ "Java Files\t*.java\n" + if has("win32") + let b:browsefilter .= "All Files (*.*)\t*\n" + else + let b:browsefilter .= "All Files (*)\t*\n" + endif let b:undo_ftplugin .= ' | unlet! b:browsefilter' endif diff --git a/runtime/ftplugin/cobol.vim b/runtime/ftplugin/cobol.vim index ec1e95456d..5e52702fd5 100644 --- a/runtime/ftplugin/cobol.vim +++ b/runtime/ftplugin/cobol.vim @@ -3,6 +3,7 @@ " Maintainer: Ankit Jain " (formerly Tim Pope ) " Last Update: By Ankit Jain (add gtk support) on 15.08.2020 +" 2024 Jan 14 by Vim Project (browsefilter) " Insert mode mappings: " Normal mode mappings: < > << >> [[ ]] [] ][ @@ -39,8 +40,12 @@ endif " add gtk support if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "COBOL Source Files (*.cbl, *.cob)\t*.cbl;*.cob;*.lib\n". - \ "All Files (*.*)\t*.*\n" + let b:browsefilter = "COBOL Source Files (*.cbl, *.cob)\t*.cbl;*.cob;*.lib\n" + if has("win32") + let b:browsefilter .= "All Files (*.*)\t*\n" + else + let b:browsefilter .= "All Files (*)\t*\n" + endif endif let b:undo_ftplugin = "setlocal com< cms< fo< et< tw<" . diff --git a/runtime/ftplugin/config.vim b/runtime/ftplugin/config.vim index 73136cbc66..595fc657b9 100644 --- a/runtime/ftplugin/config.vim +++ b/runtime/ftplugin/config.vim @@ -1,10 +1,11 @@ " Vim filetype plugin file -" Language: config +" Language: config " " This runtime file is looking for a new maintainer. " " Former maintainer: Dan Sharp -" Last Changed: 20 Jan 2009 +" Last Change: 2009 Jan 20 +" 2024 Jan 14 by Vim Project (browsefilter) if exists("b:did_ftplugin") | finish | endif @@ -15,8 +16,12 @@ set cpo-=C " Define some defaults in case the included ftplugins don't set them. let s:undo_ftplugin = "" -let s:browsefilter = "Bourne Shell Files (*.sh)\t*.sh\n" . - \ "All Files (*.*)\t*.*\n" +let s:browsefilter = "Bourne Shell Files (*.sh)\t*.sh\n" +if has("win32") + let s:browsefilter .= "All Files (*.*)\t*\n" +else + let s:browsefilter .= "All Files (*)\t*\n" +endif let s:match_words = "" runtime! ftplugin/sh.vim ftplugin/sh_*.vim ftplugin/sh/*.vim @@ -31,7 +36,7 @@ if exists("b:browsefilter") endif " Change the :browse e filter to primarily show configure-related files. -if has("gui_win32") +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter="Configure Scripts (configure.*, config.*)\tconfigure*;config.*\n" . \ s:browsefilter endif diff --git a/runtime/ftplugin/cs.vim b/runtime/ftplugin/cs.vim index 0734d11d22..ada71315e1 100644 --- a/runtime/ftplugin/cs.vim +++ b/runtime/ftplugin/cs.vim @@ -3,6 +3,7 @@ " Maintainer: Nick Jensen " Former Maintainer: Johannes Zellner " Last Change: 2022-11-16 +" 2024 Jan 14 by Vim Project (browsefilter) " License: Vim (see :h license) " Repository: https://github.com/nickspoons/vim-cs @@ -31,10 +32,14 @@ if exists('loaded_matchit') && !exists('b:match_words') endif if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter') - let b:browsefilter = "C# Source Files (*.cs *.csx)\t*.cs;*.csx\n" . + let b:browsefilter = "C# Source Files (*.cs, *.csx)\t*.cs;*.csx\n" . \ "C# Project Files (*.csproj)\t*.csproj\n" . - \ "Visual Studio Solution Files (*.sln)\t*.sln\n" . - \ "All Files (*.*)\t*.*\n" + \ "Visual Studio Solution Files (*.sln)\t*.sln\n" + if has("win32") + let b:browsefilter ..= "All Files (*.*)\t*\n" + else + let b:browsefilter ..= "All Files (*)\t*\n" + endif let b:undo_ftplugin .= ' | unlet! b:browsefilter' endif diff --git a/runtime/ftplugin/csh.vim b/runtime/ftplugin/csh.vim index 2feec57bb2..a22bee3279 100644 --- a/runtime/ftplugin/csh.vim +++ b/runtime/ftplugin/csh.vim @@ -3,7 +3,7 @@ " Maintainer: Doug Kearns " Previous Maintainer: Dan Sharp " Contributor: Johannes Zellner -" Last Change: 2023 Oct 09 +" Last Change: 2024 Jan 14 if exists("b:did_ftplugin") finish @@ -44,8 +44,12 @@ if exists("loaded_matchit") && !exists("b:match_words") endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "csh Scripts (*.csh)\t*.csh\n" .. - \ "All Files (*.*)\t*.*\n" + let b:browsefilter = "csh Scripts (*.csh)\t*.csh\n" + if has("win32") + let b:browsefilter ..= "All Files (*.*)\t*\n" + else + let b:browsefilter ..= "All Files (*)\t*\n" + endif let b:csh_set_browsefilter = 1 let b:undo_ftplugin ..= " | unlet! b:browsefilter b:csh_set_browsefilter" endif diff --git a/runtime/ftplugin/diff.vim b/runtime/ftplugin/diff.vim index f2a0820be9..2daa48aeb4 100644 --- a/runtime/ftplugin/diff.vim +++ b/runtime/ftplugin/diff.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Diff " Maintainer: The Vim Project -" Last Change: 2023 Aug 10 +" Last Change: 2023 Aug 22 " Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer @@ -19,6 +19,11 @@ setlocal nomodeline let &l:commentstring = "# %s" if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "Diff Files (*.diff)\t*.diff\nPatch Files (*.patch)\t*.h\nAll Files (*.*)\t*.*\n" + let b:browsefilter = "Diff Files (*.diff)\t*.diff\nPatch Files (*.patch)\t*.h\n" + if has("win32") + let b:browsefilter ..= "All Files (*.*)\t*\n" + else + let b:browsefilter ..= "All Files (*)\t*\n" + endif let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif diff --git a/runtime/ftplugin/dosbatch.vim b/runtime/ftplugin/dosbatch.vim index f02f26b1fd..5001cf68bd 100644 --- a/runtime/ftplugin/dosbatch.vim +++ b/runtime/ftplugin/dosbatch.vim @@ -2,6 +2,7 @@ " Language: MS-DOS/Windows .bat files " Maintainer: Mike Williams " Last Change: 12th February 2023 +" 2024 Jan 14 by Vim Project (browsefilter) " " Options Flags: " dosbatch_colons_comment - any value to treat :: as comment line @@ -37,12 +38,17 @@ if executable('help.exe') endif " Define patterns for the browse file filter -if has("gui_win32") && !exists("b:browsefilter") - let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\nAll Files (*.*)\t*.*\n" +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\n" + if has("win32") + let b:browsefilter ..= "All Files (*.*)\t*\n" + else + let b:browsefilter ..= "All Files (*)\t*\n" + endif endif let b:undo_ftplugin = "setlocal comments< formatoptions< keywordprg<" - \ . "| unlet! b:browsefiler" + \ . "| unlet! b:browsefilter" let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/dtd.vim b/runtime/ftplugin/dtd.vim index a046118c70..bea8c5c18a 100644 --- a/runtime/ftplugin/dtd.vim +++ b/runtime/ftplugin/dtd.vim @@ -1,10 +1,11 @@ " Vim filetype plugin file -" Language: dtd +" Language: dtd " " This runtime file is looking for a new maintainer. " " Former maintainer: Dan Sharp -" Last Changed: 20 Jan 2009 +" Last Change: 2009 Jan 20 +" 2024 Jan 14 by Vim Project (browsefilter) if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 @@ -27,10 +28,14 @@ if exists("loaded_matchit") endif " Change the :browse e filter to primarily show Java-related files. -if has("gui_win32") +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter="DTD Files (*.dtd)\t*.dtd\n" . - \ "XML Files (*.xml)\t*.xml\n" . - \ "All Files (*.*)\t*.*\n" + \ "XML Files (*.xml)\t*.xml\n" + if has("win32") + let b:browsefilter .= "All Files (*.*)\t*\n" + else + let b:browsefilter .= "All Files (*)\t*\n" + endif endif " Undo the stuff we changed. diff --git a/runtime/ftplugin/eiffel.vim b/runtime/ftplugin/eiffel.vim index 216fdde162..e193110cde 100644 --- a/runtime/ftplugin/eiffel.vim +++ b/runtime/ftplugin/eiffel.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Eiffel " Maintainer: Doug Kearns -" Last Change: 2010 Aug 29 +" Last Change: 2024 Jan 14 if (exists("b:did_ftplugin")) finish @@ -18,8 +18,12 @@ setlocal formatoptions-=t formatoptions+=croql if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Eiffel Source Files (*.e)\t*.e\n" . - \ "Eiffel Control Files (*.ecf, *.ace, *.xace)\t*.ecf;*.ace;*.xace\n" . - \ "All Files (*.*)\t*.*\n" + \ "Eiffel Control Files (*.ecf, *.ace, *.xace)\t*.ecf;*.ace;*.xace\n" + if has("win32") + let b:browsefilter .= "All Files (*.*)\t*\n" + else + let b:browsefilter .= "All Files (*)\t*\n" + endif endif if exists("loaded_matchit") && !exists("b:match_words") diff --git a/runtime/ftplugin/eruby.vim b/runtime/ftplugin/eruby.vim index 893fa58d32..b5c4665d24 100644 --- a/runtime/ftplugin/eruby.vim +++ b/runtime/ftplugin/eruby.vim @@ -4,6 +4,7 @@ " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns " Last Change: 2022 May 15 +" 2024 Jan 14 by Vim Project (browsefilter) " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -15,7 +16,11 @@ set cpo-=C " Define some defaults in case the included ftplugins don't set them. let s:undo_ftplugin = "" -let s:browsefilter = "All Files (*.*)\t*.*\n" +if has("win32") + let s:browsefilter = "All Files (*.*)\t*\n" +else + let s:browsefilter = "All Files (*)\t*\n" +endif let s:match_words = "" if !exists("g:eruby_default_subtype") @@ -109,8 +114,8 @@ exe 'cmap