From cac57a7ac5853e5eb0299f308b3f2b99d4b1fa81 Mon Sep 17 00:00:00 2001 From: lhdjply Date: Tue, 15 Apr 2025 11:02:16 +0800 Subject: [PATCH] feat: update vim to 2:9.1.1385-1deepin1 Signed-off-by: lhdjply --- .editorconfig | 8 + .git-blame-ignore-revs | 10 + .gitignore | 5 + .hgignore | 18 +- CONTRIBUTING.md | 28 +- Filelist | 38 +- Makefile | 1 + ci/appveyor.bat | 6 +- ci/ddebs.list | 3 + ci/hlgroups.ignore | 66 + ci/hlgroups.make | 18 + ci/if_feat_check.vim | 15 + ci/if_ver-1.vim | 4 +- ci/if_ver-2.vim | 6 +- ci/pinned-pkgs | 69 + ci/setup-sway.sh | 7 + ci/unlisted.make | 2 +- debian/changelog | 29 +- ...-popups-inconsistently-shifted-to-th.patch | 16 +- ...re-LaTeX-commands-for-tex-filetype-d.patch | 4 +- ...etype-using-the-contents-of-the-file.patch | 4 +- ...ision-to-disable-modelines-by-defaul.patch | 4 +- ...vimrc.tiny-when-Vim-is-invoked-as-vi.patch | 12 +- debian/upstream/metadata | 7 + lang/LICENSE.pt_br.txt | 81 + lang/README.pt_br.txt | 131 + nsis/gvim.nsi | 6 +- nsis/lang/README.txt | 29 + nsis/lang/portuguesebr.nsi | 291 ++ runtime/autoload/dist/ft.vim | 109 +- runtime/autoload/dist/man.vim | 90 +- runtime/autoload/dist/script.vim | 7 +- runtime/autoload/dist/vim.vim | 4 +- runtime/autoload/dist/vimindent.vim | 6 +- runtime/autoload/getscript.vim | 177 +- runtime/autoload/htmlfold.vim | 192 + runtime/autoload/python.vim | 2 + runtime/autoload/rustfmt.vim | 7 +- runtime/autoload/tar.vim | 146 +- runtime/autoload/tutor.vim | 22 + runtime/autoload/vimball.vim | 24 +- runtime/autoload/zip.vim | 6 + runtime/compiler/context.vim | 2 + runtime/compiler/gleam_build.vim | 25 + runtime/compiler/javac.vim | 2 + runtime/compiler/powershell.vim | 3 + runtime/compiler/svelte-check.vim | 21 + runtime/compiler/tex.vim | 2 + runtime/compiler/tsc.vim | 5 +- runtime/compiler/typst.vim | 4 +- runtime/defaults.vim | 1 + runtime/doc/Makefile | 5 + runtime/doc/autocmd.txt | 44 +- runtime/doc/builtin.txt | 346 +- runtime/doc/change.txt | 15 +- runtime/doc/cmdline.txt | 6 +- runtime/doc/develop.txt | 100 +- runtime/doc/diff.txt | 32 +- runtime/doc/editing.txt | 7 +- runtime/doc/eval.txt | 375 +- runtime/doc/filetype.txt | 105 +- runtime/doc/helphelp.txt | 24 +- runtime/doc/if_perl.txt | 4 +- runtime/doc/if_pyth.txt | 27 +- runtime/doc/index.txt | 4 +- runtime/doc/insert.txt | 14 +- runtime/doc/motion.txt | 8 +- runtime/doc/options.txt | 378 +- runtime/doc/pattern.txt | 9 +- runtime/doc/pi_getscript.txt | 28 +- runtime/doc/pi_gzip.txt | 3 +- runtime/doc/pi_netrw.txt | 3653 ++++++++++++++- runtime/doc/pi_tar.txt | 11 +- runtime/doc/pi_zip.txt | 16 +- runtime/doc/popup.txt | 6 +- runtime/doc/quickfix.txt | 25 +- runtime/doc/quickref.txt | 4 +- runtime/doc/starting.txt | 20 +- runtime/doc/syntax.txt | 124 +- runtime/doc/tags | 90 +- runtime/doc/tagsrch.txt | 35 +- runtime/doc/terminal.txt | 12 +- runtime/doc/testing.txt | 9 +- runtime/doc/todo.txt | 49 +- runtime/doc/usr_05.txt | 45 +- runtime/doc/usr_41.txt | 57 +- runtime/doc/usr_52.txt | 17 +- runtime/doc/usr_90.txt | 52 +- runtime/doc/various.txt | 6 +- runtime/doc/version9.txt | 144 +- runtime/doc/vi_diff.txt | 7 +- runtime/doc/vim9.txt | 53 +- runtime/doc/vim9class.txt | 52 +- runtime/doc/windows.txt | 6 +- runtime/filetype.vim | 97 +- runtime/ftplugin/abnf.vim | 17 + runtime/ftplugin/cs.vim | 8 +- runtime/ftplugin/dax.vim | 16 + runtime/ftplugin/dnsmasq.vim | 11 + runtime/ftplugin/dockerfile.vim | 5 +- runtime/ftplugin/dosini.vim | 5 +- runtime/ftplugin/fstab.vim | 13 +- runtime/ftplugin/gleam.vim | 27 +- runtime/ftplugin/go.vim | 35 +- runtime/ftplugin/groff.vim | 15 + runtime/ftplugin/heex.vim | 7 + runtime/ftplugin/help.vim | 28 +- runtime/ftplugin/html.vim | 50 +- runtime/ftplugin/java.vim | 32 +- runtime/ftplugin/lf.vim | 22 + runtime/ftplugin/lprolog.vim | 10 +- runtime/ftplugin/lua.vim | 126 +- runtime/ftplugin/m17ndb.vim | 17 + runtime/ftplugin/mail.vim | 7 +- runtime/ftplugin/man.vim | 19 +- runtime/ftplugin/mbsync.vim | 13 + runtime/ftplugin/mediawiki.vim | 7 + runtime/ftplugin/mojo.vim | 7 + runtime/ftplugin/nix.vim | 6 +- runtime/ftplugin/nroff.vim | 20 +- runtime/ftplugin/plsql.vim | 17 + runtime/ftplugin/pq.vim | 16 + runtime/ftplugin/remind.vim | 14 + runtime/ftplugin/rust.vim | 16 +- runtime/ftplugin/sh.vim | 4 +- runtime/ftplugin/sieve.vim | 13 +- runtime/ftplugin/spajson.vim | 14 + runtime/ftplugin/svelte.vim | 33 +- runtime/ftplugin/tera.vim | 37 + runtime/ftplugin/tutor.vim | 27 +- runtime/ftplugin/vim.vim | 109 +- runtime/ftplugin/yaml.vim | 24 +- runtime/indent/Makefile | 11 +- runtime/indent/cucumber.vim | 6 + runtime/indent/html.vim | 6 +- runtime/indent/javascript.vim | 4 +- runtime/indent/m17ndb.vim | 14 + runtime/indent/make.vim | 15 +- runtime/indent/sh.vim | 57 +- runtime/indent/spajson.vim | 6 + runtime/indent/testdir/README.txt | 3 + runtime/indent/testdir/bitbake.in | 2 + runtime/indent/testdir/bitbake.ok | 2 + runtime/indent/testdir/html.in | 1 + runtime/indent/testdir/html.ok | 1 + runtime/indent/testdir/make.in | 20 + runtime/indent/testdir/make.ok | 20 + runtime/indent/testdir/python.in | 2 + runtime/indent/testdir/python.ok | 2 + runtime/indent/testdir/runtest.vim | 13 - runtime/indent/testdir/tools/tracer.vim | 166 + runtime/indent/testdir/vim.in | 2 + runtime/indent/testdir/vim.ok | 2 + runtime/indent/testdir/vim9.in | 6 +- runtime/indent/testdir/vim9.ok | 6 +- runtime/keymap/brazilian_portuguese-abnt.vim | 71 + .../keymap/brazilian_portuguese-compact.vim | 72 + runtime/keymap/russian-jcukenwin.vim | 2 + runtime/keymap/ukrainian-enhanced.vim | 87 + runtime/lang/menu_it_it.latin1.vim | 243 +- runtime/makemenu.vim | 3 +- runtime/optwin.vim | 17 +- .../dist/opt/comment/autoload/comment.vim | 98 +- runtime/pack/dist/opt/comment/doc/comment.txt | 17 +- runtime/pack/dist/opt/comment/doc/tags | 4 + .../pack/dist/opt/comment/plugin/comment.vim | 8 +- .../opt/editorconfig/plugin/editorconfig.vim | 2 +- .../dist/opt/helptoc/autoload/helptoc.vim | 529 ++- runtime/pack/dist/opt/helptoc/doc/helptoc.txt | 349 ++ runtime/pack/dist/opt/helptoc/doc/tags | 16 + .../pack/dist/opt/hlyank/plugin/hlyank.vim | 39 + .../pack/dist/opt/netrw/autoload/netrw.vim | 726 +-- .../pack/dist/opt/netrw/autoload/netrw/fs.vim | 191 + .../netrw/autoload/netrw/{own.vim => msg.vim} | 37 +- .../pack/dist/opt/netrw/autoload/netrw/os.vim | 48 + .../dist/opt/netrw/autoload/netrwSettings.vim | 2 +- runtime/pack/dist/opt/netrw/doc/netrw.txt | 15 +- .../dist/opt/netrw/plugin/netrwPlugin.vim | 2 +- .../dist/opt/nohlsearch/plugin/nohlsearch.vim | 14 +- runtime/plugin/gzip.vim | 8 +- runtime/plugin/matchparen.vim | 59 +- runtime/plugin/openPlugin.vim | 12 +- runtime/plugin/tarPlugin.vim | 1 + runtime/plugin/tutor.vim | 6 + runtime/plugin/vimballPlugin.vim | 8 +- runtime/plugin/zipPlugin.vim | 4 +- runtime/synmenu.vim | 43 +- runtime/syntax/Makefile | 37 +- runtime/syntax/abnf.vim | 33 + runtime/syntax/asy.vim | 6 + runtime/syntax/cfg.vim | 2 +- runtime/syntax/confini.vim | 6 + runtime/syntax/cs.vim | 33 +- runtime/syntax/dax.vim | 151 + runtime/syntax/generator/gen_syntax_vim.vim | 73 +- runtime/syntax/generator/vim.vim.base | 912 +++- runtime/syntax/gleam.vim | 97 + runtime/syntax/groovy.vim | 3 +- runtime/syntax/html.vim | 4 +- runtime/syntax/hyprlang.vim | 7 +- runtime/syntax/java.vim | 44 +- runtime/syntax/jjdescription.vim | 3 +- runtime/syntax/jq.vim | 7 + runtime/syntax/lf.vim | 404 +- runtime/syntax/lua.vim | 3 +- runtime/syntax/m17ndb.vim | 28 + runtime/syntax/make.vim | 54 +- runtime/syntax/mbsync.vim | 218 + runtime/syntax/modula2.vim | 7 + runtime/syntax/nroff.vim | 14 +- runtime/syntax/odin.vim | 11 +- runtime/syntax/omnimark.vim | 933 +++- runtime/syntax/pacmanlog.vim | 7 + runtime/syntax/plsql.vim | 3 +- runtime/syntax/pov.vim | 6 +- runtime/syntax/pq.vim | 337 ++ runtime/syntax/prql.vim | 178 + runtime/syntax/rasi.vim | 6 + runtime/syntax/sh.vim | 121 +- runtime/syntax/shared/debversions.vim | 6 +- runtime/syntax/solidity.vim | 14 +- runtime/syntax/spajson.vim | 50 + runtime/syntax/spec.vim | 3 +- runtime/syntax/tera.vim | 94 + runtime/syntax/testdir/README.txt | 24 +- .../testdir/dumps/c_character_constant_00.vim | 2 + .../testdir/dumps/c_character_constant_01.vim | 2 + .../testdir/dumps/c_character_constant_02.vim | 2 + .../testdir/dumps/c_string_literal_00.vim | 2 + .../testdir/dumps/c_string_literal_01.vim | 2 + .../testdir/dumps/c_string_literal_02.vim | 2 + .../testdir/dumps/c_string_literal_03.vim | 2 + .../testdir/dumps/html_fold_expr_00.dump | 20 + .../testdir/dumps/html_fold_expr_01.dump | 20 + .../testdir/dumps/html_fold_expr_02.dump | 20 + .../testdir/dumps/html_fold_expr_03.dump | 20 + .../testdir/dumps/html_fold_expr_04.dump | 20 + .../testdir/dumps/html_fold_expr_05.dump | 20 + .../testdir/dumps/html_fold_expr_06.dump | 20 + .../testdir/dumps/html_fold_syntax_00.dump | 20 + .../testdir/dumps/html_fold_syntax_01.dump | 20 + .../testdir/dumps/html_fold_syntax_02.dump | 20 + .../testdir/dumps/html_fold_syntax_03.dump | 20 + .../testdir/dumps/html_fold_syntax_04.dump | 20 + .../testdir/dumps/html_fold_syntax_05.dump | 20 + .../testdir/dumps/html_fold_syntax_06.dump | 20 + .../testdir/dumps/java_comments_html_00.dump | 8 +- .../dumps/java_comments_markdown_00.dump | 4 +- .../dumps/java_comments_markdown_07.dump | 6 +- .../testdir/dumps/java_previews_455_00.dump | 2 +- runtime/syntax/testdir/dumps/sh_13_00.dump | 20 + runtime/syntax/testdir/dumps/sh_14_00.dump | 20 + .../syntax/testdir/dumps/sh_ksh_array_00.dump | 20 + .../syntax/testdir/dumps/sh_ksh_array_01.dump | 20 + .../syntax/testdir/dumps/sh_quoting_00.dump | 20 + runtime/syntax/testdir/dumps/tera_00.dump | 20 + runtime/syntax/testdir/dumps/tera_01.dump | 20 + runtime/syntax/testdir/dumps/tera_02.dump | 20 + runtime/syntax/testdir/dumps/tera_03.dump | 20 + runtime/syntax/testdir/dumps/tera_04.dump | 20 + runtime/syntax/testdir/dumps/tera_05.dump | 20 + runtime/syntax/testdir/dumps/tera_06.dump | 20 + runtime/syntax/testdir/dumps/tera_07.dump | 20 + runtime/syntax/testdir/dumps/tera_08.dump | 20 + runtime/syntax/testdir/dumps/tera_09.dump | 20 + .../syntax/testdir/dumps/vim9_comment_00.dump | 2 +- .../syntax/testdir/dumps/vim9_comment_01.dump | 10 +- .../syntax/testdir/dumps/vim9_comment_02.dump | 12 +- .../syntax/testdir/dumps/vim9_comment_03.dump | 32 +- .../syntax/testdir/dumps/vim9_comment_04.dump | 20 + .../syntax/testdir/dumps/vim9_comment_05.dump | 20 + .../testdir/dumps/vim9_constructor_00.dump | 20 + .../testdir/dumps/vim9_def_variables_00.dump | 4 +- .../testdir/dumps/vim9_def_variables_01.dump | 4 +- .../testdir/dumps/vim9_def_variables_02.dump | 2 +- .../testdir/dumps/vim9_def_variables_03.dump | 10 +- .../testdir/dumps/vim9_def_variables_04.dump | 14 +- .../testdir/dumps/vim9_def_variables_05.dump | 14 +- .../testdir/dumps/vim9_def_variables_06.dump | 24 +- .../testdir/dumps/vim9_def_variables_07.dump | 28 +- .../testdir/dumps/vim9_def_variables_08.dump | 14 +- .../testdir/dumps/vim9_def_variables_09.dump | 26 +- .../testdir/dumps/vim9_def_variables_10.dump | 16 +- .../testdir/dumps/vim9_def_variables_11.dump | 34 +- .../testdir/dumps/vim9_def_variables_12.dump | 20 + .../dumps/vim9_ex_comment_strings_00.dump | 4 +- .../dumps/vim9_ex_comment_strings_01.dump | 6 +- .../testdir/dumps/vim9_ex_enum2_00.dump | 20 + .../testdir/dumps/vim9_ex_enum2_01.dump | 20 + .../syntax/testdir/dumps/vim9_ex_enum_00.dump | 20 + .../syntax/testdir/dumps/vim9_ex_enum_01.dump | 20 + .../syntax/testdir/dumps/vim9_ex_enum_02.dump | 20 + .../syntax/testdir/dumps/vim9_ex_enum_03.dump | 20 + .../syntax/testdir/dumps/vim9_ex_enum_04.dump | 20 + .../syntax/testdir/dumps/vim9_ex_enum_05.dump | 20 + .../syntax/testdir/dumps/vim9_ex_enum_06.dump | 20 + .../testdir/dumps/vim9_ex_enum_fold_00.dump | 4 +- .../testdir/dumps/vim9_ex_enum_fold_01.dump | 20 +- .../testdir/dumps/vim9_ex_enum_fold_02.dump | 38 +- .../dumps/vim9_ex_interface_fold_01.dump | 2 +- .../dumps/vim9_ex_interface_fold_02.dump | 2 +- ...eymap_01.vim => vim9_ex_loadkeymap_01.vim} | 0 .../dumps/vim9_ex_no_comment_strings_00.dump | 4 +- .../dumps/vim9_ex_no_comment_strings_01.dump | 6 +- .../syntax/testdir/dumps/vim9_expr_00.dump | 24 +- .../syntax/testdir/dumps/vim9_expr_01.dump | 38 +- .../syntax/testdir/dumps/vim9_expr_02.dump | 34 +- .../syntax/testdir/dumps/vim9_expr_03.dump | 34 +- .../syntax/testdir/dumps/vim9_expr_04.dump | 32 +- .../syntax/testdir/dumps/vim9_expr_05.dump | 34 +- .../syntax/testdir/dumps/vim9_expr_06.dump | 36 +- .../syntax/testdir/dumps/vim9_expr_07.dump | 20 + .../syntax/testdir/dumps/vim9_expr_08.dump | 20 + .../syntax/testdir/dumps/vim9_expr_09.dump | 20 + .../syntax/testdir/dumps/vim9_expr_10.dump | 20 + .../testdir/dumps/vim9_function_calls_00.dump | 20 + .../syntax/testdir/dumps/vim9_lambda_00.dump | 18 +- .../syntax/testdir/dumps/vim9_lambda_01.dump | 28 +- .../syntax/testdir/dumps/vim9_lambda_02.dump | 30 +- .../syntax/testdir/dumps/vim9_lambda_03.dump | 28 +- .../syntax/testdir/dumps/vim9_lambda_04.dump | 30 +- .../syntax/testdir/dumps/vim9_lambda_05.dump | 32 +- .../syntax/testdir/dumps/vim9_lambda_06.dump | 34 +- .../syntax/testdir/dumps/vim9_lambda_07.dump | 20 + .../syntax/testdir/dumps/vim9_lambda_08.dump | 20 + .../syntax/testdir/dumps/vim9_lambda_09.dump | 20 + .../dumps/vim9_super_this_keywords2_02.dump | 22 +- .../dumps/vim9_super_this_keywords2_03.dump | 8 +- .../syntax/testdir/dumps/vim9_tuple_00.dump | 20 + .../syntax/testdir/dumps/vim9_tuple_01.dump | 20 + .../testdir/dumps/vim9_variables_00.dump | 2 +- .../testdir/dumps/vim9_variables_01.dump | 4 +- .../testdir/dumps/vim9_variables_02.dump | 4 +- .../testdir/dumps/vim9_variables_03.dump | 34 +- .../testdir/dumps/vim9_variables_04.dump | 34 +- .../testdir/dumps/vim9_variables_05.dump | 32 +- .../testdir/dumps/vim9_variables_06.dump | 34 +- .../testdir/dumps/vim9_variables_07.dump | 40 +- .../testdir/dumps/vim9_variables_08.dump | 36 +- .../testdir/dumps/vim9_variables_09.dump | 34 +- .../testdir/dumps/vim9_variables_10.dump | 38 +- .../testdir/dumps/vim9_variables_11.dump | 38 +- .../testdir/dumps/vim9_variables_12.dump | 20 + .../testdir/dumps/vim9_variables_13.dump | 20 + .../syntax/testdir/dumps/vim_comment_00.dump | 4 +- .../syntax/testdir/dumps/vim_comment_01.dump | 8 +- .../syntax/testdir/dumps/vim_comment_02.dump | 12 +- .../syntax/testdir/dumps/vim_comment_03.dump | 16 +- .../syntax/testdir/dumps/vim_comment_04.dump | 20 + .../testdir/dumps/vim_ex_augroup_00.dump | 40 +- .../testdir/dumps/vim_ex_augroup_01.dump | 20 + .../testdir/dumps/vim_ex_augroup_02.dump | 20 + .../testdir/dumps/vim_ex_augroup_03.dump | 20 + .../testdir/dumps/vim_ex_autocmd_00.dump | 20 + .../testdir/dumps/vim_ex_autocmd_01.dump | 20 + .../testdir/dumps/vim_ex_autocmd_02.dump | 20 + .../testdir/dumps/vim_ex_autocmd_03.dump | 20 + .../testdir/dumps/vim_ex_autocmd_04.dump | 20 + .../testdir/dumps/vim_ex_autocmd_05.dump | 20 + .../testdir/dumps/vim_ex_autocmd_06.dump | 20 + .../testdir/dumps/vim_ex_autocmd_07.dump | 20 + .../testdir/dumps/vim_ex_autocmd_08.dump | 20 + .../testdir/dumps/vim_ex_autocmd_09.dump | 20 + .../testdir/dumps/vim_ex_autocmd_10.dump | 20 + .../testdir/dumps/vim_ex_autocmd_11.dump | 20 + .../testdir/dumps/vim_ex_autocmd_12.dump | 20 + .../testdir/dumps/vim_ex_autocmd_13.dump | 20 + .../testdir/dumps/vim_ex_autocmd_14.dump | 20 + .../testdir/dumps/vim_ex_autocmd_15.dump | 20 + .../testdir/dumps/vim_ex_autocmd_16.dump | 20 + .../testdir/dumps/vim_ex_command_00.dump | 18 +- .../testdir/dumps/vim_ex_command_01.dump | 26 +- .../testdir/dumps/vim_ex_command_02.dump | 38 +- .../testdir/dumps/vim_ex_command_03.dump | 30 +- .../testdir/dumps/vim_ex_command_04.dump | 38 +- .../testdir/dumps/vim_ex_command_05.dump | 20 + .../testdir/dumps/vim_ex_command_06.dump | 20 + .../testdir/dumps/vim_ex_command_07.dump | 20 + .../testdir/dumps/vim_ex_command_08.dump | 20 + .../dumps/vim_ex_comment_strings_00.dump | 8 +- .../dumps/vim_ex_comment_strings_01.dump | 6 +- .../syntax/testdir/dumps/vim_ex_def_04.dump | 2 +- .../syntax/testdir/dumps/vim_ex_def_05.dump | 2 +- .../syntax/testdir/dumps/vim_ex_def_06.dump | 2 +- .../testdir/dumps/vim_ex_def_fold_04.dump | 2 +- .../testdir/dumps/vim_ex_def_fold_06.dump | 2 +- .../testdir/dumps/vim_ex_def_fold_07.dump | 2 +- .../dumps/vim_ex_def_nested_fold_01.dump | 20 - .../dumps/vim_ex_def_return_type_00.dump | 20 + .../dumps/vim_ex_def_return_type_01.dump | 20 + .../dumps/vim_ex_def_return_type_02.dump | 20 + .../dumps/vim_ex_def_return_type_03.dump | 20 + .../testdir/dumps/vim_ex_filter_00.dump | 20 + .../testdir/dumps/vim_ex_function_01.dump | 2 +- .../testdir/dumps/vim_ex_function_02.dump | 2 +- .../testdir/dumps/vim_ex_function_03.dump | 2 +- .../testdir/dumps/vim_ex_function_04.dump | 2 +- .../testdir/dumps/vim_ex_function_05.dump | 2 +- .../testdir/dumps/vim_ex_function_06.dump | 2 +- .../testdir/dumps/vim_ex_function_07.dump | 2 +- .../testdir/dumps/vim_ex_function_08.dump | 2 +- .../testdir/dumps/vim_ex_function_09.dump | 18 +- .../testdir/dumps/vim_ex_function_10.dump | 20 +- .../testdir/dumps/vim_ex_function_11.dump | 32 +- .../testdir/dumps/vim_ex_function_12.dump | 20 + .../dumps/vim_ex_function_fold_01.dump | 2 +- .../dumps/vim_ex_function_fold_02.dump | 2 +- .../dumps/vim_ex_function_fold_04.dump | 2 +- .../dumps/vim_ex_function_fold_05.dump | 2 +- .../dumps/vim_ex_function_fold_06.dump | 2 +- .../dumps/vim_ex_function_fold_07.dump | 2 +- .../dumps/vim_ex_function_fold_08.dump | 2 +- .../dumps/vim_ex_function_fold_09.dump | 12 +- .../dumps/vim_ex_function_fold_10.dump | 28 +- .../dumps/vim_ex_function_fold_11.dump | 28 +- .../dumps/vim_ex_function_fold_12.dump | 20 +- .../dumps/vim_ex_function_fold_13.dump | 30 +- .../dumps/vim_ex_function_fold_14.dump | 24 +- .../dumps/vim_ex_function_fold_15.dump | 22 +- .../dumps/vim_ex_function_fold_16.dump | 20 + .../dumps/vim_ex_function_nested_fold_01.dump | 20 - .../dumps/vim_ex_function_nested_fold_02.dump | 20 - .../syntax/testdir/dumps/vim_ex_grep_00.dump | 20 + .../syntax/testdir/dumps/vim_ex_grep_01.dump | 20 + .../syntax/testdir/dumps/vim_ex_grep_02.dump | 20 + .../testdir/dumps/vim_ex_helpgrep_00.dump | 20 + .../testdir/dumps/vim_ex_highlight_00.dump | 2 +- .../testdir/dumps/vim_ex_highlight_01.dump | 16 +- .../testdir/dumps/vim_ex_highlight_02.dump | 2 +- .../testdir/dumps/vim_ex_highlight_03.dump | 4 +- .../testdir/dumps/vim_ex_let_heredoc_10.dump | 2 +- .../testdir/dumps/vim_ex_let_heredoc_11.dump | 4 +- ...keymap_04.vim => vim_ex_loadkeymap_01.vim} | 0 .../syntax/testdir/dumps/vim_ex_make_00.dump | 20 + .../syntax/testdir/dumps/vim_ex_make_01.dump | 20 + .../syntax/testdir/dumps/vim_ex_make_02.dump | 20 + .../syntax/testdir/dumps/vim_ex_map_00.dump | 22 +- .../syntax/testdir/dumps/vim_ex_map_01.dump | 32 +- .../syntax/testdir/dumps/vim_ex_map_02.dump | 32 +- .../syntax/testdir/dumps/vim_ex_map_03.dump | 24 +- .../syntax/testdir/dumps/vim_ex_map_04.dump | 32 +- .../syntax/testdir/dumps/vim_ex_map_05.dump | 32 +- .../syntax/testdir/dumps/vim_ex_map_06.dump | 34 +- .../syntax/testdir/dumps/vim_ex_match_01.dump | 2 +- .../dumps/vim_ex_no_comment_strings_00.dump | 8 +- .../dumps/vim_ex_no_comment_strings_01.dump | 6 +- .../syntax/testdir/dumps/vim_ex_redir_00.dump | 20 + .../syntax/testdir/dumps/vim_ex_redir_01.dump | 20 + .../syntax/testdir/dumps/vim_ex_redir_02.dump | 20 + .../syntax/testdir/dumps/vim_ex_set_01.dump | 2 +- .../syntax/testdir/dumps/vim_ex_set_02.dump | 2 +- .../syntax/testdir/dumps/vim_ex_set_03.dump | 2 +- .../syntax/testdir/dumps/vim_ex_set_04.dump | 2 +- .../syntax/testdir/dumps/vim_ex_set_05.dump | 22 +- .../syntax/testdir/dumps/vim_ex_set_06.dump | 20 + .../syntax/testdir/dumps/vim_ex_set_07.dump | 20 + .../dumps/vim_ex_set_backslash_00.dump | 20 + .../dumps/vim_ex_set_backslash_01.dump | 20 + .../dumps/vim_ex_set_backslash_02.dump | 20 + .../dumps/vim_ex_set_backslash_03.dump | 20 + .../dumps/vim_ex_set_backslash_04.dump | 20 + .../syntax/testdir/dumps/vim_ex_sort_00.dump | 20 + .../syntax/testdir/dumps/vim_ex_sort_01.dump | 20 + .../syntax/testdir/dumps/vim_ex_sort_02.dump | 20 + .../syntax/testdir/dumps/vim_ex_sort_03.dump | 20 + .../testdir/dumps/vim_ex_substitute_02.dump | 2 +- .../testdir/dumps/vim_ex_substitute_04.dump | 2 +- .../testdir/dumps/vim_ex_substitute_06.dump | 2 +- .../testdir/dumps/vim_ex_substitute_07.dump | 6 +- .../testdir/dumps/vim_ex_substitute_08.dump | 6 +- .../testdir/dumps/vim_ex_syntax_00.dump | 30 +- .../testdir/dumps/vim_ex_syntax_01.dump | 40 +- .../testdir/dumps/vim_ex_syntax_02.dump | 38 +- .../testdir/dumps/vim_ex_syntax_03.dump | 40 +- .../testdir/dumps/vim_ex_syntax_04.dump | 38 +- .../testdir/dumps/vim_ex_syntax_05.dump | 36 +- .../testdir/dumps/vim_ex_syntax_06.dump | 32 +- .../testdir/dumps/vim_ex_syntax_07.dump | 38 +- .../testdir/dumps/vim_ex_syntax_08.dump | 38 +- .../testdir/dumps/vim_ex_syntax_09.dump | 38 +- .../testdir/dumps/vim_ex_syntax_10.dump | 40 +- .../testdir/dumps/vim_ex_syntax_11.dump | 20 + .../testdir/dumps/vim_ex_syntax_12.dump | 20 + .../testdir/dumps/vim_ex_syntax_13.dump | 20 + .../testdir/dumps/vim_ex_syntax_14.dump | 20 + .../testdir/dumps/vim_ex_syntax_15.dump | 20 + .../testdir/dumps/vim_ex_vimgrep_00.dump | 20 + .../testdir/dumps/vim_ex_vimgrep_01.dump | 20 + .../testdir/dumps/vim_ex_vimgrep_02.dump | 20 + .../testdir/dumps/vim_ex_vimgrep_03.dump | 20 + .../testdir/dumps/vim_ex_vimgrep_04.dump | 20 + runtime/syntax/testdir/dumps/vim_expr_00.dump | 18 +- runtime/syntax/testdir/dumps/vim_expr_01.dump | 26 +- runtime/syntax/testdir/dumps/vim_expr_02.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_03.dump | 32 +- runtime/syntax/testdir/dumps/vim_expr_04.dump | 36 +- runtime/syntax/testdir/dumps/vim_expr_05.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_06.dump | 32 +- runtime/syntax/testdir/dumps/vim_expr_07.dump | 36 +- runtime/syntax/testdir/dumps/vim_expr_08.dump | 36 +- runtime/syntax/testdir/dumps/vim_expr_09.dump | 38 +- runtime/syntax/testdir/dumps/vim_expr_10.dump | 36 +- runtime/syntax/testdir/dumps/vim_expr_11.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_12.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_13.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_14.dump | 40 +- runtime/syntax/testdir/dumps/vim_expr_15.dump | 20 + runtime/syntax/testdir/dumps/vim_expr_16.dump | 20 + runtime/syntax/testdir/dumps/vim_expr_17.dump | 20 + runtime/syntax/testdir/dumps/vim_expr_18.dump | 20 + runtime/syntax/testdir/dumps/vim_expr_19.dump | 20 + runtime/syntax/testdir/dumps/vim_expr_20.dump | 20 + runtime/syntax/testdir/dumps/vim_expr_21.dump | 20 + runtime/syntax/testdir/dumps/vim_expr_22.dump | 20 + runtime/syntax/testdir/dumps/vim_expr_23.dump | 20 + .../testdir/dumps/vim_function_calls_00.dump | 20 + .../dumps/vim_function_variables_02.dump | 6 +- .../dumps/vim_function_variables_03.dump | 2 +- .../dumps/vim_function_variables_04.dump | 2 +- .../dumps/vim_function_variables_05.dump | 2 +- .../dumps/vim_function_variables_06.dump | 28 +- .../dumps/vim_function_variables_07.dump | 8 +- .../dumps/vim_function_variables_08.dump | 6 +- .../dumps/vim_function_variables_09.dump | 30 +- .../dumps/vim_function_variables_10.dump | 14 +- .../dumps/vim_function_variables_11.dump | 16 +- .../dumps/vim_function_variables_12.dump | 6 +- .../dumps/vim_function_variables_13.dump | 2 +- .../dumps/vim_function_variables_14.dump | 2 +- .../dumps/vim_function_variables_15.dump | 2 +- .../dumps/vim_function_variables_16.dump | 2 +- .../dumps/vim_function_variables_17.dump | 2 +- .../dumps/vim_function_variables_18.dump | 2 +- .../dumps/vim_function_variables_19.dump | 2 +- .../dumps/vim_function_variables_20.dump | 2 +- .../dumps/vim_function_variables_21.dump | 20 +- .../dumps/vim_function_variables_22.dump | 20 + .../dumps/vim_function_variables_23.dump | 20 + .../testdir/dumps/vim_key_notation_00.dump | 34 +- .../testdir/dumps/vim_key_notation_01.dump | 40 +- .../testdir/dumps/vim_key_notation_02.dump | 40 +- .../testdir/dumps/vim_key_notation_03.dump | 40 +- .../testdir/dumps/vim_key_notation_04.dump | 40 +- .../testdir/dumps/vim_key_notation_05.dump | 40 +- .../testdir/dumps/vim_key_notation_06.dump | 40 +- .../testdir/dumps/vim_key_notation_07.dump | 40 +- .../testdir/dumps/vim_key_notation_08.dump | 40 +- .../testdir/dumps/vim_key_notation_09.dump | 18 +- .../syntax/testdir/dumps/vim_lambda_00.dump | 20 +- .../syntax/testdir/dumps/vim_lambda_01.dump | 28 +- .../syntax/testdir/dumps/vim_lambda_02.dump | 28 +- .../syntax/testdir/dumps/vim_lambda_03.dump | 26 +- .../syntax/testdir/dumps/vim_lambda_04.dump | 32 +- .../syntax/testdir/dumps/vim_lambda_05.dump | 32 +- .../syntax/testdir/dumps/vim_lambda_06.dump | 26 +- .../syntax/testdir/dumps/vim_lambda_07.dump | 20 + .../dumps/vim_line_continuation_02.dump | 4 +- .../testdir/dumps/vim_nvim_variables_00.dump | 20 + .../vim_predefined_user_commands_00.dump | 20 + .../vim_predefined_user_commands_01.dump | 20 + .../testdir/dumps/vim_variables_02.dump | 6 +- .../testdir/dumps/vim_variables_03.dump | 2 +- .../testdir/dumps/vim_variables_04.dump | 2 +- .../testdir/dumps/vim_variables_05.dump | 2 +- .../testdir/dumps/vim_variables_06.dump | 30 +- .../testdir/dumps/vim_variables_07.dump | 6 +- .../testdir/dumps/vim_variables_08.dump | 8 +- .../testdir/dumps/vim_variables_09.dump | 28 +- .../testdir/dumps/vim_variables_10.dump | 14 +- .../testdir/dumps/vim_variables_11.dump | 18 +- .../testdir/dumps/vim_variables_12.dump | 4 +- .../testdir/dumps/vim_variables_13.dump | 2 +- .../testdir/dumps/vim_variables_14.dump | 2 +- .../testdir/dumps/vim_variables_15.dump | 2 +- .../testdir/dumps/vim_variables_16.dump | 2 +- .../testdir/dumps/vim_variables_17.dump | 2 +- .../testdir/dumps/vim_variables_18.dump | 2 +- .../testdir/dumps/vim_variables_19.dump | 2 +- .../testdir/dumps/vim_variables_20.dump | 2 +- .../testdir/dumps/vim_variables_21.dump | 22 +- .../testdir/dumps/vim_variables_22.dump | 20 + .../syntax/testdir/input/html_fold_expr.html | 105 + .../testdir/input/html_fold_syntax.html | 105 + .../testdir/input/java_comments_html.java | 6 +- .../testdir/input/java_comments_markdown.java | 4 +- .../testdir/input/java_previews_455.java | 2 +- .../testdir/input/setup/html_fold_expr.vim | 2 + .../testdir/input/setup/java_module_info.vim | 2 +- .../testdir/input/setup/vim9_ex_enum.vim | 1 + .../testdir/input/setup/vim9_ex_enum2.vim | 1 + .../testdir/input/setup/vim_ex_redir.vim | 2 + runtime/syntax/testdir/input/sh_13.sh | 9 + runtime/syntax/testdir/input/sh_14.sh | 8 + runtime/syntax/testdir/input/sh_ksh_array.sh | 21 + runtime/syntax/testdir/input/sh_quoting.sh | 4 + runtime/syntax/testdir/input/tera.tera | 165 + runtime/syntax/testdir/input/vim9_comment.vim | 28 + .../syntax/testdir/input/vim9_constructor.vim | 19 + .../testdir/input/vim9_def_variables.vim | 81 +- runtime/syntax/testdir/input/vim9_ex_enum.vim | 111 + .../syntax/testdir/input/vim9_ex_enum2.vim | 32 + .../testdir/input/vim9_ex_enum_fold.vim | 23 +- runtime/syntax/testdir/input/vim9_expr.vim | 67 +- .../testdir/input/vim9_function_calls.vim | 18 + runtime/syntax/testdir/input/vim9_lambda.vim | 48 +- runtime/syntax/testdir/input/vim9_shebang.vim | 0 runtime/syntax/testdir/input/vim9_tuple.vim | 26 + .../syntax/testdir/input/vim9_variables.vim | 97 +- runtime/syntax/testdir/input/vim_comment.vim | 4 + .../syntax/testdir/input/vim_ex_augroup.vim | 49 +- .../syntax/testdir/input/vim_ex_autocmd.vim | 264 ++ .../syntax/testdir/input/vim_ex_command.vim | 108 +- runtime/syntax/testdir/input/vim_ex_def.vim | 2 +- .../testdir/input/vim_ex_def_return_type.vim | 60 + .../syntax/testdir/input/vim_ex_filter.vim | 13 + .../syntax/testdir/input/vim_ex_function.vim | 16 +- .../testdir/input/vim_ex_function_fold.vim | 13 + runtime/syntax/testdir/input/vim_ex_grep.vim | 47 + .../syntax/testdir/input/vim_ex_helpgrep.vim | 11 + runtime/syntax/testdir/input/vim_ex_make.vim | 38 + runtime/syntax/testdir/input/vim_ex_map.vim | 28 +- runtime/syntax/testdir/input/vim_ex_redir.vim | 46 + runtime/syntax/testdir/input/vim_ex_set.vim | 31 + .../testdir/input/vim_ex_set_backslash.vim | 79 + runtime/syntax/testdir/input/vim_ex_sort.vim | 55 + .../testdir/input/vim_ex_substitute.vim | 1 - .../syntax/testdir/input/vim_ex_syntax.vim | 85 + .../syntax/testdir/input/vim_ex_vimgrep.vim | 69 + runtime/syntax/testdir/input/vim_expr.vim | 169 +- .../testdir/input/vim_function_calls.vim | 6 + .../testdir/input/vim_function_variables.vim | 121 +- .../syntax/testdir/input/vim_key_notation.vim | 322 +- runtime/syntax/testdir/input/vim_lambda.vim | 9 + .../testdir/input/vim_nvim_variables.vim | 9 + .../input/vim_predefined_user_commands.vim | 21 + runtime/syntax/testdir/input/vim_shebang.vim | 0 .../syntax/testdir/input/vim_variables.vim | 120 +- runtime/syntax/testdir/runtest.vim | 575 ++- runtime/syntax/testdir/tools/maketestdeps | 38 + .../testdir/tools/regenerate_screendumps.sh | 126 + runtime/syntax/tutor.vim | 9 + runtime/syntax/typst.vim | 11 +- runtime/syntax/vim.vim | 978 ++-- runtime/tutor/README.ru.utf-8.txt | 8 +- runtime/tutor/en/vim-01-beginner.tutor | 42 +- runtime/tutor/en/vim-01-beginner.tutor.json | 68 +- runtime/tutor/en/vim-02-beginner.tutor | 194 + runtime/tutor/en/vim-02-beginner.tutor.json | 10 + runtime/tutor/ru/vim-01-beginner.tutor | 1194 +++++ runtime/tutor/ru/vim-01-beginner.tutor.json | 45 + runtime/tutor/ru/vim-02-beginner.tutor | 231 + runtime/tutor/ru/vim-02-beginner.tutor.json | 10 + runtime/tutor/sr/vim-01-beginner.tutor | 12 +- runtime/tutor/sr/vim-02-beginner.tutor | 203 + runtime/tutor/sr/vim-02-beginner.tutor.json | 10 + runtime/tutor/tutor.tutor | 11 +- runtime/tutor/tutor1.gl | 1048 +++++ runtime/tutor/tutor1.gl.utf-8 | 1049 +++++ runtime/tutor/tutor1.ru | 20 +- runtime/tutor/tutor1.ru.cp1251 | 20 +- runtime/tutor/tutor1.ru.utf-8 | 20 +- runtime/tutor/tutor2.gl | 215 + runtime/tutor/tutor2.gl.utf-8 | 215 + runtime/tutor/tutor2.ru.utf-8 | 230 + src/Make_ami.mak | 1 + src/Make_cyg_ming.mak | 5 +- src/Make_mvc.mak | 10 +- src/Make_vms.mms | 5 + src/Makefile | 27 +- src/README.md | 6 +- src/auto/configure | 3934 ++++++++++------- src/autocmd.c | 31 +- src/buffer.c | 602 +-- src/bufwrite.c | 2 + src/change.c | 27 +- src/channel.c | 2 +- src/cindent.c | 32 +- src/clipboard.c | 2 +- src/cmdexpand.c | 215 +- src/dict.c | 4 +- src/diff.c | 851 +++- src/drawline.c | 64 +- src/drawscreen.c | 22 +- src/edit.c | 193 +- src/errors.h | 91 +- src/eval.c | 366 +- src/evalfunc.c | 593 ++- src/evalvars.c | 153 +- src/ex_cmdidxs.h | 38 +- src/ex_cmds.c | 7 +- src/ex_cmds.h | 3 + src/ex_cmds2.c | 2 +- src/ex_docmd.c | 43 +- src/ex_getln.c | 37 +- src/feature.h | 13 +- src/fileio.c | 15 +- src/filepath.c | 139 +- src/findfile.c | 800 ++-- src/float.c | 2 +- src/fold.c | 14 +- src/gc.c | 200 +- src/getchar.c | 12 +- src/globals.h | 32 +- src/gui.c | 63 +- src/gui_gtk_x11.c | 108 +- src/gui_haiku.cc | 3 +- src/gui_w32.c | 132 +- src/highlight.c | 427 +- src/if_py_both.h | 464 +- src/if_python.c | 36 +- src/if_python3.c | 38 +- src/if_ruby.c | 69 +- src/indent.c | 21 +- src/insexpand.c | 1424 +++++- src/job.c | 2 +- src/json.c | 37 + src/linematch.c | 12 +- src/list.c | 125 +- src/macros.h | 11 +- src/main.c | 89 +- src/match.c | 30 +- src/mbyte.c | 4 +- src/message.c | 29 +- src/message_test.c | 8 +- src/misc2.c | 530 ++- src/mouse.c | 10 - src/move.c | 16 +- src/netbeans.c | 2 +- src/normal.c | 25 +- src/ops.c | 32 +- src/option.c | 100 +- src/option.h | 14 + src/optiondefs.h | 35 +- src/optionstr.c | 214 +- src/os_haiku.h | 6 + src/os_mswin.c | 270 +- src/os_unix.c | 21 +- src/os_win32.c | 24 +- src/po/it.po | 59 +- src/po/ru.cp1251.po | 315 +- src/po/ru.po | 315 +- src/po/sr.po | 22 +- src/po/tr.po | 88 +- src/popupmenu.c | 495 ++- src/popupwin.c | 39 +- src/profiler.c | 2 +- src/proto.h | 2 + src/proto/autocmd.pro | 5 +- src/proto/buffer.pro | 1 - src/proto/change.pro | 2 +- src/proto/charset.pro | 2 +- src/proto/cmdexpand.pro | 5 +- src/proto/diff.pro | 8 +- src/proto/drawscreen.pro | 1 + src/proto/edit.pro | 4 +- src/proto/eval.pro | 3 +- src/proto/evalfunc.pro | 1 + src/proto/filepath.pro | 4 +- src/proto/findfile.pro | 4 +- src/proto/gc.pro | 11 +- src/proto/getchar.pro | 3 +- src/proto/highlight.pro | 1 + src/proto/insexpand.pro | 11 +- src/proto/list.pro | 2 + src/proto/mark.pro | 2 +- src/proto/mbyte.pro | 2 +- src/proto/move.pro | 2 +- src/proto/normal.pro | 2 +- src/proto/option.pro | 2 +- src/proto/optionstr.pro | 5 + src/proto/os_mswin.pro | 5 +- src/proto/os_unix.pro | 4 +- src/proto/popupwin.pro | 1 + src/proto/quickfix.pro | 3 + src/proto/search.pro | 5 +- src/proto/strings.pro | 1 - src/proto/tag.pro | 2 +- src/proto/term.pro | 2 +- src/proto/testing.pro | 1 + src/proto/tuple.pro | 34 + src/proto/typval.pro | 15 +- src/proto/undo.pro | 2 +- src/proto/userfunc.pro | 5 +- src/proto/vim9class.pro | 4 +- src/proto/vim9cmds.pro | 2 +- src/proto/vim9compile.pro | 2 - src/proto/vim9instr.pro | 4 +- src/proto/vim9type.pro | 3 + src/proto/window.pro | 7 +- src/quickfix.c | 426 +- src/regexp.c | 12 +- src/regexp_bt.c | 16 +- src/regexp_nfa.c | 10 +- src/register.c | 29 +- src/screen.c | 21 +- src/search.c | 178 +- src/session.c | 2 +- src/spell.c | 2 +- src/strings.c | 57 +- src/structs.h | 80 +- src/syntax.c | 2 +- src/tag.c | 7 +- src/term.c | 476 +- src/terminal.c | 74 +- src/termlib.c | 3 +- src/testdir/Make_all.mak | 7 + src/testdir/check.vim | 26 + src/testdir/dumps/Test_diff_inline_01.dump | 20 + src/testdir/dumps/Test_diff_inline_02.dump | 20 + src/testdir/dumps/Test_diff_inline_03.dump | 20 + src/testdir/dumps/Test_diff_inline_04.dump | 20 + src/testdir/dumps/Test_diff_inline_05.dump | 20 + src/testdir/dumps/Test_diff_inline_06.dump | 20 + src/testdir/dumps/Test_diff_inline_07.dump | 20 + src/testdir/dumps/Test_diff_inline_08.dump | 20 + src/testdir/dumps/Test_diff_inline_09.dump | 20 + src/testdir/dumps/Test_diff_inline_10.dump | 20 + src/testdir/dumps/Test_diff_inline_11.dump | 20 + src/testdir/dumps/Test_diff_inline_12.dump | 20 + src/testdir/dumps/Test_diff_inline_13.dump | 20 + src/testdir/dumps/Test_diff_inline_14.dump | 20 + src/testdir/dumps/Test_diff_inline_15.dump | 20 + .../dumps/Test_diff_inline_char_01.dump | 20 + .../dumps/Test_diff_inline_char_02.dump | 20 + .../Test_diff_inline_multibuffer_01.dump | 20 + .../Test_diff_inline_multibuffer_02.dump | 20 + .../Test_diff_inline_multibuffer_03.dump | 20 + .../Test_diff_inline_multibuffer_04.dump | 20 + .../Test_diff_inline_multibuffer_05.dump | 20 + .../Test_diff_inline_multibuffer_06.dump | 20 + .../Test_diff_inline_multibuffer_07.dump | 20 + .../dumps/Test_diff_inline_multiline_01.dump | 20 + .../dumps/Test_diff_inline_multiline_02.dump | 20 + .../dumps/Test_diff_inline_multiline_03.dump | 20 + .../dumps/Test_diff_inline_multiline_04.dump | 20 + .../dumps/Test_diff_inline_multiline_05.dump | 20 + .../dumps/Test_diff_inline_multiline_06.dump | 20 + .../dumps/Test_diff_inline_multiline_07.dump | 20 + .../dumps/Test_diff_inline_multiline_08.dump | 20 + .../dumps/Test_diff_inline_multiline_09.dump | 20 + .../dumps/Test_diff_inline_multiline_10.dump | 20 + .../dumps/Test_diff_inline_word_01.dump | 20 + .../dumps/Test_diff_inline_word_02.dump | 20 + .../dumps/Test_diff_inline_word_03.dump | 20 + .../dumps/Test_diff_overlapped_3.40.dump | 20 + .../dumps/Test_diff_overlapped_3.41.dump | 20 + .../dumps/Test_diff_overlapped_3.42.dump | 20 + .../dumps/Test_diff_overlapped_3.43.dump | 20 + .../dumps/Test_diff_overlapped_3.44.dump | 20 + ...fo_popupwin_clears_cmdline_on_hide_01.dump | 15 + ...fo_popupwin_clears_cmdline_on_hide_02.dump | 15 + .../dumps/Test_matchparen_sh_case_1.dump | 10 + .../dumps/Test_matchparen_sh_case_2.dump | 10 + .../dumps/Test_matchparen_winscrolled1.dump | 7 + .../dumps/Test_matchparen_winscrolled2.dump | 7 + ...t_mode_cleared_after_silent_message_1.dump | 10 + ...t_mode_cleared_after_silent_message_2.dump | 10 + .../dumps/Test_popupwin_notify_02.dump | 6 +- .../dumps/Test_prop_above_number_3.dump | 8 + .../Test_prop_multiple_lines_above_1.dump | 16 + ... => Test_pum_completefuzzycollect_01.dump} | 6 +- ... => Test_pum_completefuzzycollect_02.dump} | 6 +- ... => Test_pum_completefuzzycollect_03.dump} | 0 src/testdir/dumps/Test_pum_maxwidth_01.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_02.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_03.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_04.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_05.dump | 10 + src/testdir/dumps/Test_pum_maxwidth_06.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_07.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_08.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_09.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_10.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_11.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_12.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_13.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_14.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_15.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_16.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_17.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_18.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_19.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_20.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_21.dump | 8 + src/testdir/dumps/Test_pum_maxwidth_22.dump | 8 + .../Test_pum_with_special_characters_09.dump | 12 + .../Test_pum_with_special_characters_10.dump | 12 + .../Test_pum_with_special_characters_11.dump | 12 + .../Test_pum_with_special_characters_12.dump | 12 + .../Test_pum_with_special_characters_13.dump | 12 + .../Test_sign_number_without_signtext.dump | 5 + .../dumps/Test_switchwin_clear_pum_01.dump | 20 + .../dumps/Test_switchwin_clear_pum_02.dump | 20 + .../dumps/Test_tabnext_clear_pum_01.dump | 20 + .../dumps/Test_tabnext_clear_pum_02.dump | 20 + .../dumps/Test_wildmenu_input_func_1.dump | 8 + .../dumps/Test_wildmenu_input_func_2.dump | 8 + .../dumps/Test_wildmenu_input_func_3.dump | 8 + .../dumps/Test_wildmenu_input_func_4.dump | 8 + .../dumps/Test_wildmenu_input_func_5.dump | 8 + .../dumps/Test_wildmenu_input_func_6.dump | 8 + .../dumps/Test_wildmenu_input_func_7.dump | 8 + .../dumps/Test_wildmenu_input_func_8.dump | 8 + .../Test_wildmenu_pum_hl_match_nonf.dump | 10 + src/testdir/dumps/Test_wincolor_lcs.dump | 2 +- src/testdir/dumps/Test_xxd_color_0.dump | 3 +- src/testdir/dumps/Test_xxd_color_1.vim | 3 +- src/testdir/gen_opt_test.vim | 18 +- src/testdir/lsan-suppress.txt | 3 + src/testdir/runtest.vim | 2 + src/testdir/samples/poc.zip | Bin 0 -> 306 bytes src/testdir/screendump.vim | 4 + src/testdir/test_arglist.vim | 27 +- src/testdir/test_autocmd.vim | 410 +- src/testdir/test_balloon.vim | 4 +- src/testdir/test_blob.vim | 7 +- src/testdir/test_buffer.vim | 35 + src/testdir/test_clientserver.vim | 41 + src/testdir/test_cmdline.vim | 333 +- src/testdir/test_codestyle.vim | 25 + src/testdir/test_comments.vim | 24 +- src/testdir/test_compiler.vim | 27 +- src/testdir/test_conceal.vim | 6 + src/testdir/test_crash.vim | 1 + src/testdir/test_crypt.vim | 6 +- src/testdir/test_cursor_func.vim | 4 + src/testdir/test_delete.vim | 1 + src/testdir/test_diffmode.vim | 236 +- src/testdir/test_display.vim | 2 + src/testdir/test_edit.vim | 74 +- src/testdir/test_eval_stuff.vim | 6 +- src/testdir/test_expand_func.vim | 7 + src/testdir/test_expr.vim | 24 +- src/testdir/test_filetype.vim | 212 +- src/testdir/test_filter_map.vim | 1 + src/testdir/test_findfile.vim | 30 + src/testdir/test_format.vim | 12 +- src/testdir/test_functions.vim | 56 +- src/testdir/test_gf.vim | 32 + src/testdir/test_gui.vim | 8 +- src/testdir/test_help.vim | 17 + src/testdir/test_hlsearch.vim | 2 + src/testdir/test_indent.vim | 13 + src/testdir/test_ins_complete.vim | 1673 ++++++- src/testdir/test_lambda.vim | 2 +- src/testdir/test_let.vim | 22 +- src/testdir/test_listchars.vim | 50 + src/testdir/test_listdict.vim | 28 +- src/testdir/test_match.vim | 5 + src/testdir/test_matchfuzzy.vim | 25 + src/testdir/test_menu.vim | 1 + src/testdir/test_messages.vim | 27 + src/testdir/test_method.vim | 4 +- src/testdir/test_mksession.vim | 18 + src/testdir/test_move.vim | 1 + src/testdir/test_normal.vim | 44 + src/testdir/test_options.vim | 35 +- src/testdir/test_plugin_comment.vim | 726 +++ src/testdir/test_plugin_matchparen.vim | 62 + src/testdir/test_plugin_tutor.vim | 16 + src/testdir/test_plugin_zip.vim | 23 + src/testdir/test_popup.vim | 290 +- src/testdir/test_popupwin.vim | 45 +- src/testdir/test_popupwin_textprop.vim | 4 +- src/testdir/test_put.vim | 117 +- src/testdir/test_python2.vim | 210 +- src/testdir/test_python3.vim | 220 + src/testdir/test_quickfix.vim | 222 + src/testdir/test_registers.vim | 111 + src/testdir/test_search.vim | 34 +- src/testdir/test_shell.vim | 14 + src/testdir/test_signs.vim | 20 + src/testdir/test_source.vim | 4 +- src/testdir/test_startup.vim | 69 +- src/testdir/test_startup_utf8.vim | 27 + src/testdir/test_statusline.vim | 4 + src/testdir/test_substitute.vim | 1 + src/testdir/test_syntax.vim | 3 +- src/testdir/test_tabpage.vim | 1 + src/testdir/test_tagfunc.vim | 19 + src/testdir/test_tagjump.vim | 17 + src/testdir/test_termcodes.vim | 2 +- src/testdir/test_termencoding.vim | 1 + src/testdir/test_terminal.vim | 7 + src/testdir/test_terminal2.vim | 4 + src/testdir/test_terminal3.vim | 5 + src/testdir/test_textprop.vim | 94 + src/testdir/test_trycatch.vim | 12 +- src/testdir/test_tuple.vim | 2356 ++++++++++ src/testdir/test_undo.vim | 1 + src/testdir/test_user_func.vim | 37 +- src/testdir/test_usercommands.vim | 4 +- src/testdir/test_utf8.vim | 3 + src/testdir/test_vim9_assign.vim | 29 +- src/testdir/test_vim9_builtin.vim | 44 +- src/testdir/test_vim9_class.vim | 926 +++- src/testdir/test_vim9_cmd.vim | 85 +- src/testdir/test_vim9_disassemble.vim | 243 + src/testdir/test_vim9_expr.vim | 28 +- src/testdir/test_vim9_func.vim | 5 + src/testdir/test_vim9_import.vim | 202 + src/testdir/test_vim9_script.vim | 25 +- src/testdir/test_viminfo.vim | 26 + src/testdir/test_vimscript.vim | 11 + src/testdir/test_visual.vim | 44 + src/testdir/test_window_cmd.vim | 12 + src/testdir/test_xdg.vim | 38 +- src/testdir/test_xxd.vim | 1 + src/testdir/vim9.vim | 158 +- src/testing.c | 12 +- src/textformat.c | 25 +- src/textobject.c | 6 + src/time.c | 2 +- src/tuple.c | 1122 +++++ src/typval.c | 181 +- src/usercmd.c | 16 +- src/userfunc.c | 253 +- src/version.c | 544 +++ src/vim.h | 34 +- src/vim9.h | 10 + src/vim9class.c | 24 +- src/vim9cmds.c | 47 +- src/vim9compile.c | 188 +- src/vim9execute.c | 651 ++- src/vim9expr.c | 213 +- src/vim9instr.c | 153 +- src/vim9script.c | 41 +- src/vim9type.c | 894 +++- src/viminfo.c | 27 +- src/window.c | 76 +- src/xxd/xxd.c | 376 +- 1031 files changed, 52755 insertions(+), 11464 deletions(-) create mode 100644 ci/ddebs.list create mode 100644 ci/hlgroups.ignore create mode 100644 ci/hlgroups.make create mode 100644 ci/if_feat_check.vim create mode 100644 ci/pinned-pkgs create mode 100644 ci/setup-sway.sh create mode 100644 debian/upstream/metadata create mode 100644 lang/LICENSE.pt_br.txt create mode 100644 lang/README.pt_br.txt create mode 100644 nsis/lang/portuguesebr.nsi create mode 100644 runtime/autoload/htmlfold.vim create mode 100644 runtime/compiler/gleam_build.vim create mode 100644 runtime/compiler/svelte-check.vim mode change 120000 => 100644 runtime/doc/pi_netrw.txt create mode 100644 runtime/ftplugin/abnf.vim create mode 100644 runtime/ftplugin/dax.vim create mode 100644 runtime/ftplugin/dnsmasq.vim create mode 100644 runtime/ftplugin/groff.vim create mode 100644 runtime/ftplugin/lf.vim create mode 100644 runtime/ftplugin/m17ndb.vim create mode 100644 runtime/ftplugin/mbsync.vim create mode 100755 runtime/ftplugin/plsql.vim create mode 100644 runtime/ftplugin/pq.vim create mode 100644 runtime/ftplugin/remind.vim create mode 100644 runtime/ftplugin/spajson.vim create mode 100644 runtime/ftplugin/tera.vim create mode 100644 runtime/indent/m17ndb.vim create mode 100644 runtime/indent/spajson.vim create mode 100644 runtime/indent/testdir/make.in create mode 100644 runtime/indent/testdir/make.ok create mode 100644 runtime/indent/testdir/tools/tracer.vim create mode 100644 runtime/keymap/brazilian_portuguese-abnt.vim create mode 100644 runtime/keymap/brazilian_portuguese-compact.vim create mode 100644 runtime/keymap/ukrainian-enhanced.vim create mode 100644 runtime/pack/dist/opt/helptoc/doc/helptoc.txt create mode 100644 runtime/pack/dist/opt/helptoc/doc/tags create mode 100644 runtime/pack/dist/opt/hlyank/plugin/hlyank.vim create mode 100644 runtime/pack/dist/opt/netrw/autoload/netrw/fs.vim rename runtime/pack/dist/opt/netrw/autoload/netrw/{own.vim => msg.vim} (55%) create mode 100644 runtime/pack/dist/opt/netrw/autoload/netrw/os.vim create mode 100644 runtime/syntax/abnf.vim create mode 100644 runtime/syntax/dax.vim create mode 100644 runtime/syntax/gleam.vim create mode 100644 runtime/syntax/m17ndb.vim create mode 100644 runtime/syntax/mbsync.vim create mode 100644 runtime/syntax/pq.vim create mode 100644 runtime/syntax/prql.vim create mode 100644 runtime/syntax/spajson.vim create mode 100644 runtime/syntax/tera.vim create mode 100644 runtime/syntax/testdir/dumps/c_character_constant_00.vim create mode 100644 runtime/syntax/testdir/dumps/c_character_constant_01.vim create mode 100644 runtime/syntax/testdir/dumps/c_character_constant_02.vim create mode 100644 runtime/syntax/testdir/dumps/c_string_literal_00.vim create mode 100644 runtime/syntax/testdir/dumps/c_string_literal_01.vim create mode 100644 runtime/syntax/testdir/dumps/c_string_literal_02.vim create mode 100644 runtime/syntax/testdir/dumps/c_string_literal_03.vim create mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_00.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_01.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_02.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_03.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_04.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_05.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_06.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_00.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_01.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_02.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_03.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_04.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_05.dump create mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_06.dump create mode 100644 runtime/syntax/testdir/dumps/sh_13_00.dump create mode 100644 runtime/syntax/testdir/dumps/sh_14_00.dump create mode 100644 runtime/syntax/testdir/dumps/sh_ksh_array_00.dump create mode 100644 runtime/syntax/testdir/dumps/sh_ksh_array_01.dump create mode 100644 runtime/syntax/testdir/dumps/sh_quoting_00.dump create mode 100644 runtime/syntax/testdir/dumps/tera_00.dump create mode 100644 runtime/syntax/testdir/dumps/tera_01.dump create mode 100644 runtime/syntax/testdir/dumps/tera_02.dump create mode 100644 runtime/syntax/testdir/dumps/tera_03.dump create mode 100644 runtime/syntax/testdir/dumps/tera_04.dump create mode 100644 runtime/syntax/testdir/dumps/tera_05.dump create mode 100644 runtime/syntax/testdir/dumps/tera_06.dump create mode 100644 runtime/syntax/testdir/dumps/tera_07.dump create mode 100644 runtime/syntax/testdir/dumps/tera_08.dump create mode 100644 runtime/syntax/testdir/dumps/tera_09.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_comment_04.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_comment_05.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_constructor_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_def_variables_12.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum2_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum2_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_03.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_04.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_05.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_06.dump rename runtime/syntax/testdir/dumps/{vim9_keymap_01.vim => vim9_ex_loadkeymap_01.vim} (100%) create mode 100644 runtime/syntax/testdir/dumps/vim9_expr_07.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_expr_08.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_expr_09.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_expr_10.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_function_calls_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_lambda_07.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_lambda_08.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_lambda_09.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_tuple_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_tuple_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_variables_12.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_variables_13.dump create mode 100644 runtime/syntax/testdir/dumps/vim_comment_04.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_augroup_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_augroup_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_augroup_03.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_03.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_04.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_05.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_06.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_07.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_08.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_09.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_10.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_11.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_12.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_13.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_14.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_15.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_16.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_command_05.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_command_06.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_command_07.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_command_08.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_def_return_type_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_def_return_type_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_def_return_type_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_def_return_type_03.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_filter_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_function_12.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_function_fold_16.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_grep_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_grep_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_grep_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_helpgrep_00.dump rename runtime/syntax/testdir/dumps/{vim_keymap_04.vim => vim_ex_loadkeymap_01.vim} (100%) create mode 100644 runtime/syntax/testdir/dumps/vim_ex_make_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_make_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_make_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_redir_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_redir_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_redir_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_06.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_07.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_backslash_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_backslash_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_backslash_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_backslash_03.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_backslash_04.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_sort_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_sort_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_sort_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_sort_03.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_syntax_11.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_syntax_12.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_syntax_13.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_syntax_14.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_syntax_15.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_vimgrep_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_vimgrep_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_vimgrep_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_vimgrep_03.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_vimgrep_04.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_15.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_16.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_17.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_18.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_19.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_20.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_21.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_22.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_23.dump create mode 100644 runtime/syntax/testdir/dumps/vim_function_calls_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_function_variables_22.dump create mode 100644 runtime/syntax/testdir/dumps/vim_function_variables_23.dump create mode 100644 runtime/syntax/testdir/dumps/vim_lambda_07.dump create mode 100644 runtime/syntax/testdir/dumps/vim_nvim_variables_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_predefined_user_commands_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_predefined_user_commands_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_variables_22.dump create mode 100644 runtime/syntax/testdir/input/html_fold_expr.html create mode 100644 runtime/syntax/testdir/input/html_fold_syntax.html create mode 100644 runtime/syntax/testdir/input/setup/html_fold_expr.vim create mode 100644 runtime/syntax/testdir/input/setup/vim9_ex_enum.vim create mode 100644 runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim create mode 100644 runtime/syntax/testdir/input/setup/vim_ex_redir.vim create mode 100644 runtime/syntax/testdir/input/sh_13.sh create mode 100644 runtime/syntax/testdir/input/sh_14.sh create mode 100755 runtime/syntax/testdir/input/sh_ksh_array.sh create mode 100644 runtime/syntax/testdir/input/sh_quoting.sh create mode 100644 runtime/syntax/testdir/input/tera.tera create mode 100644 runtime/syntax/testdir/input/vim9_constructor.vim create mode 100644 runtime/syntax/testdir/input/vim9_ex_enum.vim create mode 100644 runtime/syntax/testdir/input/vim9_ex_enum2.vim create mode 100644 runtime/syntax/testdir/input/vim9_function_calls.vim mode change 100755 => 100644 runtime/syntax/testdir/input/vim9_shebang.vim create mode 100644 runtime/syntax/testdir/input/vim9_tuple.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_autocmd.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_def_return_type.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_filter.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_grep.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_helpgrep.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_make.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_redir.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_set_backslash.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_sort.vim create mode 100644 runtime/syntax/testdir/input/vim_ex_vimgrep.vim create mode 100644 runtime/syntax/testdir/input/vim_function_calls.vim create mode 100644 runtime/syntax/testdir/input/vim_nvim_variables.vim create mode 100644 runtime/syntax/testdir/input/vim_predefined_user_commands.vim mode change 100755 => 100644 runtime/syntax/testdir/input/vim_shebang.vim create mode 100755 runtime/syntax/testdir/tools/maketestdeps create mode 100755 runtime/syntax/testdir/tools/regenerate_screendumps.sh create mode 100644 runtime/tutor/en/vim-02-beginner.tutor create mode 100644 runtime/tutor/en/vim-02-beginner.tutor.json create mode 100644 runtime/tutor/ru/vim-01-beginner.tutor create mode 100644 runtime/tutor/ru/vim-01-beginner.tutor.json create mode 100644 runtime/tutor/ru/vim-02-beginner.tutor create mode 100644 runtime/tutor/ru/vim-02-beginner.tutor.json create mode 100644 runtime/tutor/sr/vim-02-beginner.tutor create mode 100644 runtime/tutor/sr/vim-02-beginner.tutor.json create mode 100644 runtime/tutor/tutor1.gl create mode 100644 runtime/tutor/tutor1.gl.utf-8 create mode 100644 runtime/tutor/tutor2.gl create mode 100644 runtime/tutor/tutor2.gl.utf-8 create mode 100644 runtime/tutor/tutor2.ru.utf-8 create mode 100644 src/proto/tuple.pro create mode 100644 src/testdir/dumps/Test_diff_inline_01.dump create mode 100644 src/testdir/dumps/Test_diff_inline_02.dump create mode 100644 src/testdir/dumps/Test_diff_inline_03.dump create mode 100644 src/testdir/dumps/Test_diff_inline_04.dump create mode 100644 src/testdir/dumps/Test_diff_inline_05.dump create mode 100644 src/testdir/dumps/Test_diff_inline_06.dump create mode 100644 src/testdir/dumps/Test_diff_inline_07.dump create mode 100644 src/testdir/dumps/Test_diff_inline_08.dump create mode 100644 src/testdir/dumps/Test_diff_inline_09.dump create mode 100644 src/testdir/dumps/Test_diff_inline_10.dump create mode 100644 src/testdir/dumps/Test_diff_inline_11.dump create mode 100644 src/testdir/dumps/Test_diff_inline_12.dump create mode 100644 src/testdir/dumps/Test_diff_inline_13.dump create mode 100644 src/testdir/dumps/Test_diff_inline_14.dump create mode 100644 src/testdir/dumps/Test_diff_inline_15.dump create mode 100644 src/testdir/dumps/Test_diff_inline_char_01.dump create mode 100644 src/testdir/dumps/Test_diff_inline_char_02.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_01.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_02.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_03.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_04.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_05.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_06.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_07.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multiline_01.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multiline_02.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multiline_03.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multiline_04.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multiline_05.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multiline_06.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multiline_07.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multiline_08.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multiline_09.dump create mode 100644 src/testdir/dumps/Test_diff_inline_multiline_10.dump create mode 100644 src/testdir/dumps/Test_diff_inline_word_01.dump create mode 100644 src/testdir/dumps/Test_diff_inline_word_02.dump create mode 100644 src/testdir/dumps/Test_diff_inline_word_03.dump create mode 100644 src/testdir/dumps/Test_diff_overlapped_3.40.dump create mode 100644 src/testdir/dumps/Test_diff_overlapped_3.41.dump create mode 100644 src/testdir/dumps/Test_diff_overlapped_3.42.dump create mode 100644 src/testdir/dumps/Test_diff_overlapped_3.43.dump create mode 100644 src/testdir/dumps/Test_diff_overlapped_3.44.dump create mode 100644 src/testdir/dumps/Test_info_popupwin_clears_cmdline_on_hide_01.dump create mode 100644 src/testdir/dumps/Test_info_popupwin_clears_cmdline_on_hide_02.dump create mode 100644 src/testdir/dumps/Test_matchparen_sh_case_1.dump create mode 100644 src/testdir/dumps/Test_matchparen_sh_case_2.dump create mode 100644 src/testdir/dumps/Test_matchparen_winscrolled1.dump create mode 100644 src/testdir/dumps/Test_matchparen_winscrolled2.dump create mode 100644 src/testdir/dumps/Test_mode_cleared_after_silent_message_1.dump create mode 100644 src/testdir/dumps/Test_mode_cleared_after_silent_message_2.dump create mode 100644 src/testdir/dumps/Test_prop_above_number_3.dump create mode 100644 src/testdir/dumps/Test_prop_multiple_lines_above_1.dump rename src/testdir/dumps/{Test_pum_highlights_10.dump => Test_pum_completefuzzycollect_01.dump} (53%) rename src/testdir/dumps/{Test_pum_highlights_11.dump => Test_pum_completefuzzycollect_02.dump} (53%) rename src/testdir/dumps/{Test_pum_highlights_15.dump => Test_pum_completefuzzycollect_03.dump} (100%) create mode 100644 src/testdir/dumps/Test_pum_maxwidth_01.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_02.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_03.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_04.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_05.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_06.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_07.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_08.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_09.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_10.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_11.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_12.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_13.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_14.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_15.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_16.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_17.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_18.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_19.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_20.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_21.dump create mode 100644 src/testdir/dumps/Test_pum_maxwidth_22.dump create mode 100644 src/testdir/dumps/Test_pum_with_special_characters_09.dump create mode 100644 src/testdir/dumps/Test_pum_with_special_characters_10.dump create mode 100644 src/testdir/dumps/Test_pum_with_special_characters_11.dump create mode 100644 src/testdir/dumps/Test_pum_with_special_characters_12.dump create mode 100644 src/testdir/dumps/Test_pum_with_special_characters_13.dump create mode 100644 src/testdir/dumps/Test_sign_number_without_signtext.dump create mode 100644 src/testdir/dumps/Test_switchwin_clear_pum_01.dump create mode 100644 src/testdir/dumps/Test_switchwin_clear_pum_02.dump create mode 100644 src/testdir/dumps/Test_tabnext_clear_pum_01.dump create mode 100644 src/testdir/dumps/Test_tabnext_clear_pum_02.dump create mode 100644 src/testdir/dumps/Test_wildmenu_input_func_1.dump create mode 100644 src/testdir/dumps/Test_wildmenu_input_func_2.dump create mode 100644 src/testdir/dumps/Test_wildmenu_input_func_3.dump create mode 100644 src/testdir/dumps/Test_wildmenu_input_func_4.dump create mode 100644 src/testdir/dumps/Test_wildmenu_input_func_5.dump create mode 100644 src/testdir/dumps/Test_wildmenu_input_func_6.dump create mode 100644 src/testdir/dumps/Test_wildmenu_input_func_7.dump create mode 100644 src/testdir/dumps/Test_wildmenu_input_func_8.dump create mode 100644 src/testdir/dumps/Test_wildmenu_pum_hl_match_nonf.dump create mode 100644 src/testdir/samples/poc.zip create mode 100644 src/testdir/test_plugin_comment.vim create mode 100644 src/testdir/test_plugin_tutor.vim create mode 100644 src/testdir/test_tuple.vim create mode 100644 src/tuple.c diff --git a/.editorconfig b/.editorconfig index 7dc0cfba..21d66600 100644 --- a/.editorconfig +++ b/.editorconfig @@ -20,6 +20,14 @@ indent_size = 2 # https://spec.commonmark.org/0.31.2/#hard-line-breaks trim_trailing_whitespace = false +[*.vim] +indent_style = space +indent_size = 2 + +[runtime/pack/dist/opt/{comment,nohlsearch}/**.vim] +indent_style = space +indent_size = 4 + [runtime/doc/**.txt] # It can mess up some documentation by trying to strip trailing whitespaces trim_trailing_whitespace = false diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4d064077..5f3160d6 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -13,3 +13,13 @@ # change indentation style of netrw plugin c363ca1ecd1f8db03663ef98dcf41eeacc3c22c7 c673b805ad80d0aef07e745d412a2bf298ba1c07 +# fix indentation style in insexpand.c v9.1.1352 +355db99d12a89f05765948b33eecd6d9733e16bb +# fix indentation styles in various files v9.1.1363 +c2a9000bc1b4a2cbcfeef55450c184b16906d910 +# indentation style in various files v9.1.1364 +562610cfa327c8ebff12a1700525e17a070d5e2c +# Patch v9.1.1371 +19e1dd6b6aeb96d64122332a8c3d17b9d5ca007b +# Patch v9.1.1372 +a4a00a7ad0cfa26685c057c11a09bec2c962346a diff --git a/.gitignore b/.gitignore index 0d38d901..aee4e994 100644 --- a/.gitignore +++ b/.gitignore @@ -96,6 +96,11 @@ src/json_test src/message_test src/kword_test +runtime/syntax/testdir/done/ +runtime/syntax/testdir/messages +runtime/syntax/testdir/testdeps.mk +runtime/syntax/testdir/vimcmd + # Generated by "make install" runtime/doc/doctags runtime/doc/tags-* diff --git a/.hgignore b/.hgignore index 5c9754e2..38388a53 100644 --- a/.hgignore +++ b/.hgignore @@ -98,21 +98,33 @@ src/json_test src/message_test src/kword_test +runtime/syntax/testdir/done/ +runtime/syntax/testdir/messages +runtime/syntax/testdir/testdeps.mk +runtime/syntax/testdir/vimcmd + # Generated by "make install" runtime/doc/doctags runtime/doc/tags-* +# Temporarily generated by "runtime/syntax/generator/make" +runtime/syntax/generator/generator.err +runtime/syntax/generator/sanity_check.err +runtime/syntax/generator/vim.vim.rc + # Generated by "make shadow". The directory names could be anything but we # restrict them to shadow (the default) or shadow-* src/shadow src/shadow-* src/runtime src/pixmaps +src/LICENSE +src/README.txt # other files possibly created by tools src/cscope.out # Linter/language server files -/.cache/clangd/ -/.ccls-cache/ -/compile_commands.json +.cache/clangd/ +.ccls-cache/ +compile_commands.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 17bb9b30..b1572775 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,6 +21,31 @@ Contributions will be distributed with Vim under the Vim license. Providing a change to be included implies that you agree with this and your contribution does not cause us trouble with trademarks or patents. There is no CLA to sign. +## Signing-off commits + +While not required, it's recommended to use **Signed-off commits** to ensure +transparency, accountability, and compliance with open-source best practices. +Signed-off commits follow the [Developer Certificate of Origin (DCO)][15], +which confirms that contributors have the right to submit their changes under +the project's license. This process adds a `Signed-off-by` line to commit +messages, verifying that the contributor agrees to the project's licensing +terms. To sign off a commit, simply use the -s flag when committing: + +```sh +git commit -s +``` + +This ensures that every contribution is properly documented and traceable, +aligning with industry standards used in projects like the Linux Kernel or +the git project. By making Signed-off commits a standard practice, we help +maintain a legally compliant and well-governed codebase while fostering trust +within our contributor community. + +When merging PRs into Vim, the current maintainer @chrisbra usually adds missing +`Signed-off-by` trailers for the author user name and email address as well for +anybody that explicitly *ACK*s a pull request as a statement that those +approvers are happy with that particular change. + # Reporting issues We use GitHub issues, but that is not a requirement. Writing to the Vim @@ -46,7 +71,7 @@ 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. However, they may +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 @@ -113,3 +138,4 @@ mailing list. For other questions please use the [Vi Stack Exchange][8] website, [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 +[15]: https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin diff --git a/Filelist b/Filelist index 22a987c4..85e4d329 100644 --- a/Filelist +++ b/Filelist @@ -23,8 +23,12 @@ SRC_ALL = \ ci/appveyor.bat \ ci/config.mk*.sed \ ci/if_ver*.vim \ + ci/if_feat_check.vim \ ci/setup-xvfb.sh \ + ci/setup-sway.sh \ ci/remove_snap.sh \ + ci/ddebs.list \ + ci/pinned-pkgs \ src/Make_all.mak \ src/README.md \ src/alloc.c \ @@ -157,6 +161,7 @@ SRC_ALL = \ src/textobject.c \ src/textprop.c \ src/time.c \ + src/tuple.c \ src/typval.c \ src/ui.c \ src/undo.c \ @@ -223,6 +228,7 @@ SRC_ALL = \ src/testdir/samples/*.html \ src/testdir/samples/*.txt \ src/testdir/samples/*.vim \ + src/testdir/samples/poc.zip \ src/testdir/samples/test000 \ src/testdir/samples/test.zip \ src/testdir/samples/test_undo.txt.undo \ @@ -338,6 +344,7 @@ SRC_ALL = \ src/proto/textobject.pro \ src/proto/textprop.pro \ src/proto/time.pro \ + src/proto/tuple.pro \ src/proto/typval.pro \ src/proto/ui.pro \ src/proto/undo.pro \ @@ -771,16 +778,16 @@ RT_ALL = \ runtime/tools/[a-z]*[a-z0-9] \ runtime/tutor/README.txt \ runtime/tutor/tutor1 \ + runtime/tutor/tutor1.utf-8 \ runtime/tutor/en/vim-01-beginner.tutor \ runtime/tutor/en/vim-01-beginner.tutor.json \ - runtime/tutor/it/vim-01-beginner.tutor \ - runtime/tutor/it/vim-01-beginner.tutor.json \ - runtime/tutor/sr/vim-01-beginner.tutor \ - runtime/tutor/sr/vim-01-beginner.tutor.json \ + runtime/tutor/en/vim-02-beginner.tutor \ + runtime/tutor/en/vim-02-beginner.tutor.json \ runtime/tutor/tutor.tutor \ runtime/tutor/tutor.tutor.json \ runtime/tutor/tutor.vim \ runtime/tutor/tutor2 \ + runtime/tutor/tutor2.utf-8 \ runtime/vimrc_example.vim \ runtime/pack/dist/opt/cfilter/plugin/cfilter.vim \ runtime/pack/dist/opt/comment/plugin/comment.vim \ @@ -803,7 +810,10 @@ RT_ALL = \ runtime/pack/dist/opt/editorconfig/ftdetect/editorconfig.vim \ runtime/pack/dist/opt/editorconfig/plugin/editorconfig.vim \ runtime/pack/dist/opt/helptoc/autoload/helptoc.vim \ + runtime/pack/dist/opt/helptoc/doc/helptoc.txt \ + runtime/pack/dist/opt/helptoc/doc/tags \ runtime/pack/dist/opt/helptoc/plugin/helptoc.vim \ + runtime/pack/dist/opt/hlyank/plugin/hlyank.vim \ runtime/pack/dist/opt/justify/plugin/justify.vim \ runtime/pack/dist/opt/matchit/plugin/matchit.vim \ runtime/pack/dist/opt/matchit/doc/matchit.txt \ @@ -816,7 +826,9 @@ RT_ALL = \ runtime/pack/dist/opt/netrw/LICENSE.txt \ runtime/pack/dist/opt/netrw/README.md \ runtime/pack/dist/opt/netrw/autoload/netrw.vim \ - runtime/pack/dist/opt/netrw/autoload/netrw/own.vim \ + runtime/pack/dist/opt/netrw/autoload/netrw/fs.vim \ + runtime/pack/dist/opt/netrw/autoload/netrw/os.vim \ + runtime/pack/dist/opt/netrw/autoload/netrw/msg.vim \ runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim \ runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim \ runtime/pack/dist/opt/netrw/doc/netrw.txt \ @@ -856,6 +868,7 @@ RT_SCRIPTS = \ runtime/indent/testdir/*.vim \ runtime/indent/testdir/*.in \ runtime/indent/testdir/*.ok \ + runtime/indent/testdir/tools/* \ runtime/ftplugin/*.vim \ runtime/ftplugin/logtalk.dict \ runtime/ftplugin/README.txt \ @@ -876,6 +889,7 @@ RT_SCRIPTS = \ runtime/syntax/testdir/input/setup/*.* \ runtime/syntax/testdir/dumps/*.dump \ runtime/syntax/testdir/dumps/*.vim \ + runtime/syntax/testdir/tools/* \ runtime/syntax/generator/Makefile \ runtime/syntax/generator/README.md \ runtime/syntax/generator/gen_syntax_vim.vim \ @@ -1074,7 +1088,16 @@ LANG_GEN = \ runtime/tutor/README.*.txt \ runtime/tutor/Makefile \ runtime/tutor/Make_all.mak \ - runtime/tutor/tutor1.utf-8 \ + runtime/tutor/it/vim-01-beginner.tutor \ + runtime/tutor/it/vim-01-beginner.tutor.json \ + runtime/tutor/ru/vim-01-beginner.tutor \ + runtime/tutor/ru/vim-01-beginner.tutor.json \ + runtime/tutor/ru/vim-02-beginner.tutor \ + runtime/tutor/ru/vim-02-beginner.tutor.json \ + runtime/tutor/sr/vim-01-beginner.tutor \ + runtime/tutor/sr/vim-01-beginner.tutor.json \ + runtime/tutor/sr/vim-02-beginner.tutor \ + runtime/tutor/sr/vim-02-beginner.tutor.json \ runtime/tutor/tutor1.?? \ runtime/tutor/tutor1.??.utf-8 \ runtime/tutor/tutor1.??.euc \ @@ -1087,7 +1110,6 @@ LANG_GEN = \ runtime/tutor/tutor1.??_??.utf-8 \ runtime/tutor/tutor1.bar \ runtime/tutor/tutor1.bar.utf-8 \ - runtime/tutor/tutor2.utf-8 \ runtime/tutor/tutor2.?? \ runtime/tutor/tutor2.??.utf-8 \ runtime/spell/README.txt \ @@ -1148,6 +1170,8 @@ IGNORE = \ .github/workflows/label.yml \ SECURITY.md \ ci/unlisted.make \ + ci/hlgroups.make \ + ci/hlgroups.ignore \ src/libvterm/CODE-MAP \ runtime/syntax/testdir/input/html_html \ diff --git a/Makefile b/Makefile index 12aa1f37..4d726991 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,7 @@ VIM_FOR_SYNTAXTEST = ../../src/vim # (For local testing only with GNU Make.) VIM_SYNTAX_TEST_FILTER = +VIM_SYNTAX_TEST_WAIT_TIME = syntaxtest: cd runtime/syntax && \ diff --git a/ci/appveyor.bat b/ci/appveyor.bat index c77cee19..17d95ff6 100644 --- a/ci/appveyor.bat +++ b/ci/appveyor.bat @@ -71,7 +71,7 @@ cd src echo "Building MSVC 64bit console Version" nmake -f Make_mvc.mak CPU=AMD64 ^ OLE=no GUI=no IME=yes ICONV=yes DEBUG=no ^ - FEATURES=%FEATURE% + FEATURES=%FEATURE% CI_CFLAGS=/we4267 if not exist vim.exe ( echo Build failure. exit 1 @@ -85,11 +85,11 @@ if "%FEATURE%" == "HUGE" ( OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^ PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^ PYTHON3_VER=%PYTHON3_VER% DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% ^ - FEATURES=%FEATURE% + FEATURES=%FEATURE% CI_CFLAGS=/we4267 ) ELSE ( nmake -f Make_mvc.mak CPU=AMD64 ^ OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no ^ - FEATURES=%FEATURE% + FEATURES=%FEATURE% CI_CFLAGS=/we4267 ) if not exist gvim.exe ( echo Build failure. diff --git a/ci/ddebs.list b/ci/ddebs.list new file mode 100644 index 00000000..e4491a60 --- /dev/null +++ b/ci/ddebs.list @@ -0,0 +1,3 @@ +deb http://ddebs.ubuntu.com noble main restricted universe multiverse +deb http://ddebs.ubuntu.com noble-updates main restricted universe multiverse +deb http://ddebs.ubuntu.com noble-proposed main restricted universe multiverse diff --git a/ci/hlgroups.ignore b/ci/hlgroups.ignore new file mode 100644 index 00000000..41e06f1b --- /dev/null +++ b/ci/hlgroups.ignore @@ -0,0 +1,66 @@ +ColorColumn +ComplMatchIns +Conceal +Cursor +CursorColumn +CursorIM +CursorLine +CursorLineNr +debugBreakpoint +debugPC +DiffAdd +DiffChange +DiffDelete +DiffText +Directory +ErrorMsg +FoldColumn +Folded +Ignore +IncSearch +lCursor +LineNr +LineNrAbove +LineNrBelow +MatchParen +Menu +ModeMsg +MoreMsg +MsgArea +NonText +Normal +Pmenu +PmenuSbar +PmenuSel +PmenuThumb +Question +Scrollbar +Search +SignColumn +SpecialKey +SpellBad +SpellCap +SpellLocal +SpellRare +StatusLine +StatusLineNC +StatusLineTerm +StatusLineTermNC +TabLine +TabLineFill +TabLineSel +Terminal +Title +TOhtmlProgress +TOhtml-progress-color +ToolbarButton +ToolbarLine +Tooltip +User1 +User1..9 +User9 +VertSplit +Visual +VisualNOS +WarningMsg +WildMenu diff --git a/ci/hlgroups.make b/ci/hlgroups.make new file mode 100644 index 00000000..65b39a8c --- /dev/null +++ b/ci/hlgroups.make @@ -0,0 +1,18 @@ +# vim: ft=make +SHELL = /bin/bash + +# Default target to actually run the comparison: +.PHONY: check +.INTERMEDIATE: hlgroups deflinks hlgroups.stripped + +check: hlgroups.stripped deflinks + diff hlgroups.stripped deflinks + +hlgroups: + grep '\*hl-' ../runtime/doc/*txt | sed -E -e 's/.*: hlgroups + +deflinks: ../src/highlight.c + grep '"default link' $< | sed 's/.*default link\s*\(.*\)\s.*/\1/' | sort > deflinks + +hlgroups.stripped: hlgroups.ignore hlgroups + grep -v -x -F -f hlgroups.ignore hlgroups > hlgroups.stripped diff --git a/ci/if_feat_check.vim b/ci/if_feat_check.vim new file mode 100644 index 00000000..f846f7cb --- /dev/null +++ b/ci/if_feat_check.vim @@ -0,0 +1,15 @@ +if 1 " This prevents it from being run in tiny versions + " Check for required features + if exists("g:required") + for feature in g:required + if !has(feature) + echo "Error: Feature '" .. feature .. "' not found" + echo '' + cquit + endif + endfor + echo "\nChecked features: " .. string(g:required) + echo '' + endif +endif +" vim: sts=2 sw=2 et diff --git a/ci/if_ver-1.vim b/ci/if_ver-1.vim index adc40a7c..397c05a4 100644 --- a/ci/if_ver-1.vim +++ b/ci/if_ver-1.vim @@ -1,6 +1,6 @@ -" Print all interface versions for Ubuntu. Part 1. +" Print all interface versions. Part 1. -if 1 +if 1 " This prevents it from being run in tiny versions execute 'source' expand(':h') .. '/if_ver-cmd.vim' echo "*** Interface versions ***\n" diff --git a/ci/if_ver-2.vim b/ci/if_ver-2.vim index 83e80e48..f717ec1e 100644 --- a/ci/if_ver-2.vim +++ b/ci/if_ver-2.vim @@ -1,6 +1,8 @@ -" Print py3 interface versions for Ubuntu. Part 2. +" Print py3 interface versions. Part 2. +" This is done separately from part 1 because Vim cannot concurrently load +" Python 2 and 3 together. -if 1 +if 1 " This prevents it from being run in tiny versions execute 'source' expand(':h') .. '/if_ver-cmd.vim' echo 'Python 3:' diff --git a/ci/pinned-pkgs b/ci/pinned-pkgs new file mode 100644 index 00000000..0603e141 --- /dev/null +++ b/ci/pinned-pkgs @@ -0,0 +1,69 @@ +# Unfortunately ubtunu does not keep the debug packages strictly up-to-date +# with the main packages. So this file needs to pin the main packages back to +# the version for which debug packages are available. + +Package: libwayland-client0 +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-client0 +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +Package: libwayland-cursor0 +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-cursor0 +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +Package: libwayland-egl1 +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-egl1 +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +Package: libwayland-dev +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-dev +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +Package: libwayland-server0 +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-server0 +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +Package: libwayland-bin +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-bin +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +# As of 2025-04-27 the base library package libgtk-3-0t64 is still at 3.24.41-4ubuntu1.2 +Package: libgtk-3-0t64-dbgsym +Pin: version 3.24.41-4ubuntu1.2 +Pin-Priority: 1000 + +Package: libgtk-3-0t64-dbgsym +Pin: version 3.24.41-4ubuntu1.3 +Pin-Priority: 100 + +# As of 2025-04-27 the base binary package libgtk-3-bin is still at 3.24.41-4ubuntu1.2 +Package: libgtk-3-bin-dbgsym +Pin: version 3.24.41-4ubuntu1.2 +Pin-Priority: 1000 + +Package: libgtk-3-bin-dbgsym +Pin: version 3.24.41-4ubuntu1.3 +Pin-Priority: 100 diff --git a/ci/setup-sway.sh b/ci/setup-sway.sh new file mode 100644 index 00000000..060b7f9e --- /dev/null +++ b/ci/setup-sway.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +# Using a systemd user service doesn't work because it seems like github actions +# doesn't support user sessions? Just run sway in the background and disown it. +WLR_BACKENDS=headless sway & +disown diff --git a/ci/unlisted.make b/ci/unlisted.make index 04dfcb53..6d506eb7 100644 --- a/ci/unlisted.make +++ b/ci/unlisted.make @@ -21,7 +21,7 @@ $(eval all_patterns := $(shell \ p; \ }')) -# In Makefile's `prepeare` target, all the IN_README_DIR files are moved from +# In Makefile's `prepare` target, all the IN_README_DIR files are moved from # READMEdir to the root, so add those files in their Git-tracked location: all_patterns := $(all_patterns) \ $(foreach readme, $(IN_README_DIR), READMEdir/$(readme)) diff --git a/debian/changelog b/debian/changelog index fd70ab8b..39f5aec2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,27 @@ -vim (2:9.1.1113-1deepin1) unstable; urgency=medium +vim (2:9.1.1385-1deepin1) experimental; urgency=medium + + [ James McCoy ] + * Merge upstream tag v9.1.1385 + + [ Kirill Rekhov ] + * d/upstream/metadata: add metadata + * Fix day-of-week for changelog entries 1:6.3-015+1, 1:6.3-010+1, 4.6-2. * Set NoDisplay=true for vim.desktop - -- Tianyu Chen Wed, 19 Mar 2025 09:21:18 +0800 + -- lhdjply Wed, 21 Mar 2025 15:27:16 +0800 + +vim (2:9.1.1230-1) unstable; urgency=medium + + * Merge upstream tag v9.1.1230 + + Security fixes: + - 9.1.1115: use-after-free in str_to_reg(), CVE-2025-26603 + - 9.1.1164: editing a specially crafted tar file allows code execution, + (Closes: #1099610, CVE-2025-27423) + - 9.1.1198: potential data loss with zip.vim and crafted zip files, + (Closes: #1101016, CVE-2025-29768) + + -- James McCoy Mon, 24 Mar 2025 20:59:06 -0400 vim (2:9.1.1113-1) unstable; urgency=medium @@ -4468,7 +4487,7 @@ vim (1:6.3-015+1) unstable; urgency=medium and fixes svn commit file highlighting. * Added a new patch which adds s390 and amd64 to debcontrol.vim. - -- Norbert Tretkowski Wed, 17 Aug 2004 19:34:13 +0200 + -- Norbert Tretkowski Tue, 17 Aug 2004 19:34:13 +0200 vim (1:6.3-013+2) unstable; urgency=low @@ -4515,7 +4534,7 @@ vim (1:6.3-010+1) unstable; urgency=low + updated kvim patch to apply without conflicts to new vim upstream patches - -- Norbert Tretkowski Thu, 30 Jun 2004 18:35:26 +0200 + -- Norbert Tretkowski Wed, 30 Jun 2004 18:35:26 +0200 vim (1:6.3-004+1) unstable; urgency=low @@ -7540,7 +7559,7 @@ vim (4.6-2) unstable; urgency=low * Built with libc6, ncurses3.4, and xlib6g * Updated menu entry - -- Galen Hazelwood Thu, 9 Sep 1997 12:44:30 -0600 + -- Galen Hazelwood Tue, 09 Sep 1997 12:44:30 -0600 vim (4.6-1) frozen unstable; urgency=low diff --git a/debian/patches/Revert-patch-9.1.0949-popups-inconsistently-shifted-to-th.patch b/debian/patches/Revert-patch-9.1.0949-popups-inconsistently-shifted-to-th.patch index 83d19e8c..7507aedc 100644 --- a/debian/patches/Revert-patch-9.1.0949-popups-inconsistently-shifted-to-th.patch +++ b/debian/patches/Revert-patch-9.1.0949-popups-inconsistently-shifted-to-th.patch @@ -16,7 +16,7 @@ Closes: #1091729 4 files changed, 19 insertions(+), 33 deletions(-) diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt -index 06acf39..d4c0bb7 100644 +index ba87b31..e7526ec 100644 --- a/runtime/doc/popup.txt +++ b/runtime/doc/popup.txt @@ -705,6 +705,7 @@ The second argument of |popup_create()| is a dictionary with options: @@ -28,10 +28,10 @@ index 06acf39..d4c0bb7 100644 the screen, then the popup is moved to the left so as to fit the diff --git a/src/popupwin.c b/src/popupwin.c -index 4045490..8c56717 100644 +index 60a54d7..bb4c550 100644 --- a/src/popupwin.c +++ b/src/popupwin.c -@@ -1434,7 +1434,17 @@ popup_adjust_position(win_T *wp) +@@ -1433,7 +1433,17 @@ popup_adjust_position(win_T *wp) len = linetabsize(wp, lnum); wp->w_width = w_width; @@ -50,7 +50,7 @@ index 4045490..8c56717 100644 && allow_adjust_left && (wp->w_popup_pos == POPPOS_TOPLEFT || wp->w_popup_pos == POPPOS_BOTLEFT)) -@@ -1446,6 +1456,7 @@ popup_adjust_position(win_T *wp) +@@ -1445,6 +1455,7 @@ popup_adjust_position(win_T *wp) { int truncate_shift = shift_by - wp->w_wincol; @@ -58,7 +58,7 @@ index 4045490..8c56717 100644 shift_by -= truncate_shift; } -@@ -1453,16 +1464,6 @@ popup_adjust_position(win_T *wp) +@@ -1452,16 +1463,6 @@ popup_adjust_position(win_T *wp) maxwidth += shift_by; wp->w_width = maxwidth; } @@ -76,7 +76,7 @@ index 4045490..8c56717 100644 { wp->w_width = len + margin_width; diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim -index 8b6b78f..d345b3e 100644 +index 3c8e5d7..7920443 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -31,7 +31,7 @@ func Test_simple_popup() @@ -152,10 +152,10 @@ index 8b6b78f..d345b3e 100644 \ wrap: 0, \ fixed: 1, diff --git a/src/version.c b/src/version.c -index 5fe6254..265d068 100644 +index a2cfb00..6091dcd 100644 --- a/src/version.c +++ b/src/version.c -@@ -1032,8 +1032,6 @@ static int included_patches[] = +@@ -1576,8 +1576,6 @@ static int included_patches[] = 951, /**/ 950, diff --git a/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch b/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch index 7e9f14ba..73871dbf 100644 --- a/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch +++ b/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch @@ -13,10 +13,10 @@ Signed-off-by: James McCoy 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim -index a740305..3155be1 100644 +index 95135c8..38e1cad 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim -@@ -1140,7 +1140,7 @@ export def FTtex() +@@ -1193,7 +1193,7 @@ export def FTtex() var firstNC = search('^\s*[^[:space:]%]', 'c', 1000) if firstNC > 0 # Check the next thousand lines for a LaTeX or ConTeXt keyword. diff --git a/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch b/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch index 49cc6666..48ef92d0 100644 --- a/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch +++ b/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch @@ -8,10 +8,10 @@ Closes: #382541 1 file changed, 8 insertions(+) diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim -index 859126f..7534ef4 100644 +index c184bd0..02e4605 100644 --- a/runtime/autoload/dist/script.vim +++ b/runtime/autoload/dist/script.vim -@@ -423,6 +423,14 @@ def DetectFromText(line1: string) +@@ -424,6 +424,14 @@ def DetectFromText(line1: string) elseif line1 =~ 'exec\s\+\S*scheme' || line2 =~ 'exec\s\+\S*scheme' setl ft=scheme diff --git a/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch b/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch index 33e271fb..7cffce16 100644 --- a/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch +++ b/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch @@ -15,10 +15,10 @@ Signed-off-by: James McCoy 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt -index 94fb739..7c086ba 100644 +index 5563a05..9b182c4 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt -@@ -5729,7 +5729,7 @@ A jump table for the options with a short description can be found at |Q_op|. +@@ -5861,7 +5861,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'modeline'* *'ml'* *'nomodeline'* *'noml'* 'modeline' 'ml' boolean (Vim default: on (off for root), diff --git a/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch b/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch index c54791d6..f46c048a 100644 --- a/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch +++ b/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch @@ -17,10 +17,10 @@ Signed-off-by: James Vega 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c -index f603a52..403e390 100644 +index 31494e3..735b303 100644 --- a/src/main.c +++ b/src/main.c -@@ -1973,6 +1973,10 @@ parse_command_name(mparm_T *parmp) +@@ -2008,6 +2008,10 @@ parse_command_name(mparm_T *parmp) } else if (STRNICMP(initstr, "vim", 3) == 0) initstr += 3; @@ -31,7 +31,7 @@ index f603a52..403e390 100644 // Catch "[r][g]vimdiff" and "[r][g]viewdiff". if (STRICMP(initstr, "diff") == 0) -@@ -3268,7 +3272,12 @@ source_startup_scripts(mparm_T *parmp) +@@ -3303,7 +3307,12 @@ source_startup_scripts(mparm_T *parmp) * Get system wide defaults, if the file name is defined. */ #ifdef SYS_VIMRC_FILE @@ -45,7 +45,7 @@ index f603a52..403e390 100644 #endif #ifdef MACOS_X (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, -@@ -3311,13 +3320,25 @@ source_startup_scripts(mparm_T *parmp) +@@ -3346,13 +3355,25 @@ source_startup_scripts(mparm_T *parmp) #ifdef USR_EXRC_FILE2 && do_source((char_u *)USR_EXRC_FILE2, FALSE, DOSO_NONE, NULL) == FAIL @@ -86,10 +86,10 @@ index 39c9304..fbc5c64 100644 # define SYS_VIMRC_FILE "$VIM/vimrc" #endif diff --git a/src/structs.h b/src/structs.h -index 03c28e2..a4a5ffa 100644 +index caf61ed..8d8b8a7 100644 --- a/src/structs.h +++ b/src/structs.h -@@ -4626,6 +4626,9 @@ typedef struct +@@ -4695,6 +4695,9 @@ typedef struct #ifdef FEAT_DIFF int diff_mode; // start with 'diff' set #endif diff --git a/debian/upstream/metadata b/debian/upstream/metadata new file mode 100644 index 00000000..4ad7b6bc --- /dev/null +++ b/debian/upstream/metadata @@ -0,0 +1,7 @@ +Bug-Database: https://github.com/vim/vim/issues +Bug-Submit: https://github.com/vim/vim/issues/new +Changelog: https://github.com/vim/vim/commits/master/ +Documentation: https://github.com/vim/vim/wiki +Repository: https://github.com/vim/vim.git +Repository-Browse: https://github.com/vim/vim +Security-Contact: https://github.com/vim/vim/blob/master/SECURITY.md diff --git a/lang/LICENSE.pt_br.txt b/lang/LICENSE.pt_br.txt new file mode 100644 index 00000000..a3d6e9e1 --- /dev/null +++ b/lang/LICENSE.pt_br.txt @@ -0,0 +1,81 @@ +LICENÇA DO VIM + +I) Não há restrições para distribuir cópias não modificadas do Vim, exceto + que elas devem incluir este texto de licença. Você também pode distribuir + partes não modificadas do Vim, igualmente irrestritas, exceto que elas + devem incluir este texto de licença. Você também tem permissão para incluir + executáveis que você fez a partir das fontes não modificadas do Vim, além + de seus próprios exemplos de uso e scripts do Vim. + +II) É permitido distribuir uma versão modificada (ou estendida) do Vim, + incluindo executáveis e/ou código-fonte, quando as quatro + condições a seguir forem atendidas: + 1) Este texto de licença deve ser incluído sem modificações. + 2) O Vim modificado deve ser distribuído de uma das cinco formas a seguir: + a) Se você fizer alterações no Vim, deverá descrever claramente na + distribuição como entrar em contato com você. Quando o mantenedor + solicitar a você (de qualquer forma) uma cópia do Vim modificado que + você distribuiu, você deverá disponibilizar suas alterações, + incluindo o código-fonte, ao mantenedor sem taxa. O mantenedor + reserva o direito de incluir suas alterações na versão oficial + do Vim. O que o mantenedor fará com suas alterações e sob qual + licença elas serão distribuídas é negociável. Se não houve negociação + então esta licença, ou uma versão posterior, também se aplica às suas + alterações. Os mantenedores atuais estão listados aqui: + https://github.com/orgs/vim/people. Se isso mudar, será anunciado em + lugares apropriados (provavelmente vim.sf.net, www.vim.org e/ou + comp.editors). Quando for completamente impossível contatar o + mantenedor, a obrigação de enviar a ele suas alterações cessa. + Uma vez que o mantenedor tenha confirmado que ele recebeu suas + alterações, elas não precisarão ser enviadas novamente. + b) Se você recebeu um Vim modificado que foi distribuído como + mencionado em a), você tem permissão para distribuí-lo sem + modificações, como mencionado em I). Se você fizer alterações + adicionais, o texto em a) se aplica a essas alterações. + c) Forneça todas as alterações, incluindo o código-fonte, com cada cópia + do Vim modificado que você distribuir. Isso pode ser feito na forma + de um diff de contexto. Você pode escolher qual licença usar para o + novo código que você adicionar. As alterações e sua licença não devem + restringir outros de fazer suas próprias alterações na versão oficial + do Vim. + d) Quando você tem um Vim modificado que inclui alterações conforme + mencionado em c), você pode distribuí-lo sem o código-fonte para as + alterações se as três condições a seguir forem atendidas: + - A licença que se aplica às alterações permite que você distribua + as alterações para o mantenedor do Vim sem taxa ou restrição, e + permite que o mantenedor do Vim inclua as alterações na + versão oficial do Vim sem taxa ou restrição. + - Você mantém as alterações por pelo menos três anos após a última + distribuição do Vim modificado correspondente. Quando o mantenedor + ou alguém para quem você distribuiu o Vim modificado solicitar a + você (de qualquer forma) as alterações dentro deste período, você + deve disponibilizá-las a ele. + - Você descreve claramente na distribuição como entrar em contato + com você. Estas informações de contato devem permanecer válidas por + pelo menos três anos após a última distribuição do Vim modificado + correspondente, ou pelo maior tempo possível. + e) Quando a Licença Pública Geral GNU (GPL) se aplica às alterações, + você pode distribuir o Vim modificado sob a GNU GPL versão 2 ou + qualquer versão posterior. + 3) Uma mensagem deve ser adicionada, no mínimo na saída do comando + ":version" e na tela de introdução, de modo que o usuário do Vim + modificado seja capaz de ver que ele foi modificado. Ao distribuir + conforme mencionado em 2)e), só é necessário adicionar a mensagem + na medida em que isso não entre em conflito com a licença usada para + as alterações. + 4) As informações de contato conforme exigido em 2)a) e 2)d) não devem ser + removidas ou alteradas, exceto que a própria pessoa pode fazer + correções. + +III) Se você distribuir uma versão modificada do Vim, encorajamos que use + a licença do Vim para suas alterações e disponibilizá-las ao + mantenedor, incluindo o código-fonte. A maneira preferida de fazer isso é + por e-mail ou enviando os arquivos para um servidor e enviando a URL por + e-mail. Se o número de alterações for pequeno (por exemplo, um Makefile + modificado), enviar um diff de contexto por e-mail será suficiente. + O endereço de e-mail a ser usado é + +IV) Não é permitido remover esta licença da distribuição das fontes do Vim, + partes dela ou de uma versão modificada. Você pode usar esta licença + para versões anteriores do Vim em vez da licença com a qual elas vieram, + a seu critério. diff --git a/lang/README.pt_br.txt b/lang/README.pt_br.txt new file mode 100644 index 00000000..f5084ce1 --- /dev/null +++ b/lang/README.pt_br.txt @@ -0,0 +1,131 @@ +README.txt para a versão 9.1 do Vim: Vi IMproved. + +O QUE É VIM? + +Vim é uma versão muito melhorada do bom e velho editor UNIX Vi. Muitos novos +recursos foram adicionados: desfazer multinível, destaque de sintaxe, histórico +de linha de comando, ajuda on-line, verificação ortográfica, completar +nome de arquivo, operações de bloco, linguagem de script, etc. Há também uma +interface gráfica (GUI) disponível. Ainda assim, a compatibilidade com Vi é +mantida, aqueles que têm Vi "nos dedos" se sentirão em casa. +Veja "runtime/doc/vi_diff.txt" para diferenças com Vi. + +Este editor é muito útil para editar programas e outros arquivos de texto +simples. Todos os comandos são fornecidos com caracteres normais do teclado, +então aqueles que podem digitar com dez dedos podem trabalhar muito rápido. +Além disso, as teclas de função podem ser mapeadas para comandos pelo usuário, +e o mouse pode ser usado. + +O Vim funciona em MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS e quase todos +os sabores do UNIX. A portabilidade para outros sistemas não deve ser difícil. +Versões mais antigas do Vim rodam em MS-DOS, MS-Windows 95/98/Me/NT/2000/XP/Vista, +Amiga DOS, Atari MiNT, BeOS, RISC OS e OS/2. Eles não são mais mantidos. + +DISTRIBUIÇÃO + +Você pode frequentemente usar seu gerenciador de pacotes favorito para +instalar o Vim. No Mac e Linux, uma pequena versão do Vim é pré-instalada, +você ainda precisa instalar o Vim se quiser mais recursos. + +Existem distribuições separadas para Unix, PC, Amiga e alguns outros sistemas. +Este arquivo README.txt vem com o arquivo de tempo de execução. Ele inclui a +documentação, arquivos de sintaxe e outros arquivos que são usados ​​em +tempo de execução. Para executar o Vim, você deve obter um dos arquivos +binários ou um arquivo fonte. Qual deles você precisa depende do sistema em +que deseja executá-lo e se você deseja ou deve compilá-lo você mesmo. +Verifique "https://www.vim.org/download.php" para uma visão geral das +distribuições disponíveis atualmente. + +Alguns lugares populares para obter o Vim mais recente: +* Confira o repositório git do github: https://github.com/vim/vim. +* Obtenha o código-fonte como um arquivo: https://github.com/vim/vim/tags. +* Obtenha um executável do Windows do repositório vim-win32-installer: +https://github.com/vim/vim-win32-installer/releases. + +COMPILAR + +Se você obteve uma distribuição binária, não precisa compilar o Vim. Se você +obteve uma distribuição de origem, todo o material para compilar o Vim está no +diretório "src". Veja src/INSTALL para instruções. + +INSTALAÇÃO + +Veja um desses arquivos para instruções específicas do sistema. No diretório +READMEdir (no repositório) ou no diretório superior (se você descompactar um +arquivo): + +README_ami.txt Amiga +README_unix.txt Unix +README_dos.txt MS-DOS e MS-Windows +README_mac.txt Macintosh +README_haiku.txt Haiku +README_vms.txt VMS + +Existem outros arquivos README_*.txt, dependendo da distribuição que você usou. + +DOCUMENTAÇÃO + +O tutor do Vim é um curso de treinamento de uma hora para iniciantes. +Frequentemente, ele pode ser iniciado como "vimtutor". Veja ":help tutor" +para mais informações. + +O melhor é usar ":help" no Vim. Se você ainda não tem um executável, leia +"runtime/doc/help.txt". Ele contém direcionamentos para os outros arquivos +de documentação. O Manual do Usuário é lido como um livro e é recomendado +para aprender a usar o Vim. Veja ":help user-manual". + +CÓPIA + +O Vim é um Charityware. Você pode usá-lo e copiá-lo o quanto quiser, mas +encorajamos que faça uma doação para ajudar órfãos em Uganda. Leia o arquivo +"runtime/doc/uganda.txt" para detalhes (execute ":help uganda" dentro do Vim). + +Resumo da licença: Não há restrições quanto ao uso ou distribuição de uma +cópia não modificada do Vim. Partes do Vim também podem ser distribuídas, mas +o texto da licença deve sempre ser incluído. Para versões modificadas, algumas +restrições se aplicam. A licença é compatível com GPL, você pode compilar o Vim +com bibliotecas GPL e distribuí-lo. + +PATROCÃNIO + +Corrigir bugs e adicionar novos recursos exige muito tempo e esforço. +Para mostrar seu apreço pelo trabalho e motivar os desenvolvedores a continuar +trabalhando no Vim, envie uma doação. + +O dinheiro que você doou será usado principalmente para ajudar crianças em +Uganda. Veja "runtime/doc/uganda.txt". Mas, ao mesmo tempo, as doações aumentam +a motivação da equipe de desenvolvimento para continuar trabalhando no Vim! + +Para as informações mais recentes sobre patrocínio, consulte o site do Vim: + https://www.vim.org/sponsor/ + +CONTRIBUIÇÕES + +Se você gostaria de ajudar a tornar o Vim melhor, veja o arquivo CONTRIBUTING.md. + +INFORMAÇÕES + +Se você estiver no macOS, pode usar o MacVim: https://macvim.org + +As últimas notícias sobre o Vim podem ser encontradas na página inicial do Vim: + https://www.vim.org/ + +Se você tiver problemas, dê uma olhada na documentação ou dicas do Vim: + https://www.vim.org/docs.php + https://vim.fandom.com/wiki/Vim_Tips_Wiki + +Se você ainda tiver problemas ou quaisquer outras perguntas, use uma das listas +de discussão para discuti-las com usuários e desenvolvedores do Vim: + https://www.vim.org/maillist.php + +Se nada mais funcionar, relate os bugs diretamente para a lista de discussão +vim-dev: + + +AUTOR PRINCIPAL + +A maior parte do Vim foi criada por Bram Moolenaar , +":help Bram-Moolenaar" + +Envie quaisquer outros comentários, patches, flores e sugestões para +a lista de discussão vim-dev: diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi index 878867f6..8842dac6 100644 --- a/nsis/gvim.nsi +++ b/nsis/gvim.nsi @@ -1,6 +1,6 @@ # NSIS file to create a self-installing exe for Vim. # It requires NSIS version 3.0 or later. -# Last Change: 2025 Jan 05 +# Last Change: 2025 Feb 24 Unicode true @@ -216,6 +216,7 @@ Page custom SetCustom ValidateCustom # Include support for other languages: !if ${HAVE_MULTI_LANG} + !include "lang\portuguesebr.nsi" !include "lang\danish.nsi" !include "lang\dutch.nsi" !include "lang\german.nsi" @@ -806,7 +807,8 @@ Function .onInit ClearErrors System::Call 'kernel32::GetUserDefaultLocaleName(t.r19, *i${NSIS_MAX_STRLEN})' StrCmp $R9 "zh-cn" coincide 0 - StrCmp $R9 "zh-tw" 0 part + StrCmp $R9 "zh-tw" coincide 0 + StrCmp $R9 "pt-br" 0 part coincide: System::Call 'User32::CharLower(t r19 r19)*i${NSIS_MAX_STRLEN}' ${StrRep} $lng_usr "$R9" "-" "_" diff --git a/nsis/lang/README.txt b/nsis/lang/README.txt index 07899cbe..0340c308 100644 --- a/nsis/lang/README.txt +++ b/nsis/lang/README.txt @@ -18,6 +18,13 @@ allowable length of strings. For example: drop-down lists on the .vimrc page - 55 characters. Characters in this case mean characters of the English alphabet. +Once the message translation file is ready, it must be included in the +"gvim.nsi" file. +Find the line "# Include support for other languages:" in the file "gvim.nsi" +and specify the name of the file with your translation below the line +!if ${HAVE_MULTI_LANG}, similar to the entries already there. File names are +specified in alphabetical order. + If you do not yet have a translated "LICENSE" file and/or a main "README.txt" file, set the following values: @@ -32,3 +39,25 @@ variables similarly to what is done in the other translation files. Translation files should be located in the "lang" subdirectory of the root directory. The name of the files is as follows: "README.xx.txt", where xx is the language code according to ISO639. + + +There are two ways to test the installer in different languages: + +1. Find and uncomment the "!define MUI_LANGDLL_ALWAYSSHOW" line in the + "gvim.nsi" file and rebuild the installer. + Now every time you run it, you will see a dialog box with the possibility to + select the language of the installer. + +2. If the Vim editor is already installed in your system, delete the + "Installer Language" parameter in the Windows registry under + "HKEY_CURRENT_USER\Software\Vim". + Or you can create a file "NoLangInstallerVim.reg" with the following content: + + Windows Registry Editor Version 5.00 + + [HKEY_CURRENT_USER\Software\Vim] + "Installer Language"=- + + and apply it by double-clicking on it. + After these steps, when you start the installer, a window with the installer + language selection will also be displayed. diff --git a/nsis/lang/portuguesebr.nsi b/nsis/lang/portuguesebr.nsi new file mode 100644 index 00000000..ea92f54e --- /dev/null +++ b/nsis/lang/portuguesebr.nsi @@ -0,0 +1,291 @@ +# vi:set ts=8 sts=4 sw=4 et fdm=marker: +# +# portuguesebr.nsi: Brazilian Portuguese strings for gvim NSIS installer. +# +# Locale ID : 1046 +# Locale Name : pt-BR +# fileencoding : UTF-8 +# Author : Rafael Fontenelle + +!insertmacro MUI_LANGUAGE "PortugueseBR" + + +# Overwrite the default translation. +# These strings should be always English. Otherwise dosinst.c fails. +LangString ^SetupCaption ${LANG_PORTUGUESEBR} \ + "Configuração do $(^Name)" +LangString ^UninstallCaption ${LANG_PORTUGUESEBR} \ + "Desinstalação do $(^Name)" + +############################################################################## +# License file for the license page {{{1 +############################################################################## + +LicenseLangString page_lic_file ${LANG_PORTUGUESEBR} "..\lang\LICENSE.pt_br.nsis.txt" + +############################################################################## +# README.txt file, which is opened after installation {{{1 +############################################################################## + +LangString vim_readme_file ${LANG_PORTUGUESEBR} "README.pt_br.txt" + +############################################################################## +# MUI Configuration Strings {{{1 +############################################################################## + +#LangString str_dest_folder ${LANG_PORTUGUESEBR} \ +# "Pasta de destino (Deve terminar com $\"vim$\")" + +LangString str_show_readme ${LANG_PORTUGUESEBR} \ + "Mostrar o README ao concluir a instalação" + +# Install types: +LangString str_type_typical ${LANG_PORTUGUESEBR} \ + "Típica" + +LangString str_type_minimal ${LANG_PORTUGUESEBR} \ + "Mínima" + +LangString str_type_full ${LANG_PORTUGUESEBR} \ + "Completa" + + +############################################################################## +# Section Titles & Description {{{1 +############################################################################## + +LangString str_section_old_ver ${LANG_PORTUGUESEBR} \ + "Desinstalar versões existentes" +LangString str_desc_old_ver ${LANG_PORTUGUESEBR} \ + "Desinstala versões do Vim existentes no seu sistema." + +LangString str_section_exe ${LANG_PORTUGUESEBR} \ + "Vim GUI e arquivos de runtime" +LangString str_desc_exe ${LANG_PORTUGUESEBR} \ + "Executáveis ​​e arquivos de runtime do Vim GUI. Este componente \ + é obrigatório." + +LangString str_section_console ${LANG_PORTUGUESEBR} \ + "Programa de console do Vim" +LangString str_desc_console ${LANG_PORTUGUESEBR} \ + "Versão de console do Vim (vim.exe)." + +LangString str_section_batch ${LANG_PORTUGUESEBR} \ + "Criar arquivos .bat" +LangString str_desc_batch ${LANG_PORTUGUESEBR} \ + "Cria arquivos .bat para variantes do Vim no diretório Windows para \ + usar na linha de comando." + +LangString str_group_icons ${LANG_PORTUGUESEBR} \ + "Criar ícones para o Vim" +LangString str_desc_icons ${LANG_PORTUGUESEBR} \ + "Cria ícones para Vim em vários locais para facilitar o acesso rápido." + +LangString str_section_desktop ${LANG_PORTUGUESEBR} \ + "Na área de trabalho" +LangString str_desc_desktop ${LANG_PORTUGUESEBR} \ + "Cria ícones para executáveis do gVim na área de trabalho." + +LangString str_section_start_menu ${LANG_PORTUGUESEBR} \ + "Na pasta Programas do Menu Iniciar" +LangString str_desc_start_menu ${LANG_PORTUGUESEBR} \ + "Adiciona Vim na pasta de programas do menu iniciar." + +#LangString str_section_quick_launch ${LANG_PORTUGUESEBR} \ +# "Na barra de Inicialização Rápida" +#LangString str_desc_quick_launch ${LANG_PORTUGUESEBR} \ +# "Adiciona um atalho para o Vim na barra de inicialização rápida." + +LangString str_section_edit_with ${LANG_PORTUGUESEBR} \ + "Adicionar menu de contexto do Vim" +LangString str_desc_edit_with ${LANG_PORTUGUESEBR} \ + "Adiciona o Vim à lista $\"Abrir com...$\" do menu de contexto." + +#LangString str_section_edit_with32 ${LANG_PORTUGUESEBR} \ +# "Versão 32 bits" +#LangString str_desc_edit_with32 ${LANG_PORTUGUESEBR} \ +# "Adiciona o Vim à lista $\"Abrir com...$\" do menu de contexto \ +# para aplicativos 32 bits." + +#LangString str_section_edit_with64 ${LANG_PORTUGUESEBR} \ +# "Versão 64 bits" +#LangString str_desc_edit_with64 ${LANG_PORTUGUESEBR} \ +# "Adiciona o Vim à lista $\"Abrir com...$\" do menu de contexto \ +# para aplicativos 64 bits." + +LangString str_section_vim_rc ${LANG_PORTUGUESEBR} \ + "Criar configuração padrão" +LangString str_desc_vim_rc ${LANG_PORTUGUESEBR} \ + "Cria um arquivo de configuração padrão (_vimrc) se não já existir." + +LangString str_group_plugin ${LANG_PORTUGUESEBR} \ + "Criar diretórios de plugins" +LangString str_desc_plugin ${LANG_PORTUGUESEBR} \ + "Cria diretórios de plugins. Diretórios de plugins permitem estender \ + o Vim adicionando um arquivo a um direótrio." + +LangString str_section_plugin_home ${LANG_PORTUGUESEBR} \ + "Privados" +LangString str_desc_plugin_home ${LANG_PORTUGUESEBR} \ + "Cria diretórios de plugins no diretório HOME." + +LangString str_section_plugin_vim ${LANG_PORTUGUESEBR} \ + "Compartilhados" +LangString str_desc_plugin_vim ${LANG_PORTUGUESEBR} \ + "Cria diretórios de plugins no diretório de instalação do Vim, \ + o qual é usado por todos os usuários do sistema." + +LangString str_section_nls ${LANG_PORTUGUESEBR} \ + "Suporte ao idioma nativo" +LangString str_desc_nls ${LANG_PORTUGUESEBR} \ + "Instala arquivos para suporte ao idioma nativo." + +LangString str_unsection_register ${LANG_PORTUGUESEBR} \ + "Desregistrar Vim" +LangString str_desc_unregister ${LANG_PORTUGUESEBR} \ + "Remove os registras do Vim do sistema." + +LangString str_unsection_exe ${LANG_PORTUGUESEBR} \ + "Remover arquivos executáveis/runtime do Vim" +LangString str_desc_rm_exe ${LANG_PORTUGUESEBR} \ + "Remove todos os arquivos executáveis e de runtime do Vim." + +LangString str_ungroup_plugin ${LANG_PORTUGUESEBR} \ + "Remover diretórios de plugins" +LangString str_desc_rm_plugin ${LANG_PORTUGUESEBR} \ + "Remove os diretórios de plugins se eles estiverem vazios." + +LangString str_unsection_plugin_home ${LANG_PORTUGUESEBR} \ + "Privados" +LangString str_desc_rm_plugin_home ${LANG_PORTUGUESEBR} \ + "Remove os diretórios de plugins do diretório HOME." + +LangString str_unsection_plugin_vim ${LANG_PORTUGUESEBR} \ + "Compartilhados" +LangString str_desc_rm_plugin_vim ${LANG_PORTUGUESEBR} \ + "Remove os diretórios de plugins do diretório de instalação do Vim." + +LangString str_unsection_rootdir ${LANG_PORTUGUESEBR} \ + "Remover diretório raiz do Vim" +LangString str_desc_rm_rootdir ${LANG_PORTUGUESEBR} \ + "Remove o diretório raiz do Vim. Ele contém seus \ + arquivos de configuração do Vim!" + + +############################################################################## +# Messages {{{1 +############################################################################## + +#LangString str_msg_too_many_ver ${LANG_PORTUGUESEBR} \ +# "Encontradas $vim_old_ver_count versões do Vim em seu sistema.$\r$\n\ +# Este instalador só consegue lidar com ${VIM_MAX_OLD_VER} versões\ +# no máximo.$\r$\n\ +# Por favor, remova algumas versões e comece novamente." + +#LangString str_msg_invalid_root ${LANG_PORTUGUESEBR} \ +# "Caminho de instalação inválido: $vim_install_root!$\r$\n\ +# Ele deve terminar com $\"vim$\"." + +#LangString str_msg_bin_mismatch ${LANG_PORTUGUESEBR} \ +# "Incompatibilidade de caminho de binários!$\r$\n$\r$\n\ +# Esperava que o caminho de binários fosse $\"$vim_bin_path$\",$\r$\n\ +# mas o sistema indica que o caminho de binários é $\"$INSTDIR$\"." + +#LangString str_msg_vim_running ${LANG_PORTUGUESEBR} \ +# "Vim ainda está em execução em seu sistema.$\r$\n\ +# Por favor, feche todas as instâncias do Vim para poder continuar." + +#LangString str_msg_register_ole ${LANG_PORTUGUESEBR} \ +# "Tentativa de registrar o Vim com OLE. \ +# Não há mensagem que indique se isso funciona ou não." + +#LangString str_msg_unreg_ole ${LANG_PORTUGUESEBR} \ +# "Tentando desregistrar o Vim com OLE. \ +# Não há mensagem que indique se isso funciona ou não." + +#LangString str_msg_rm_start ${LANG_PORTUGUESEBR} \ +# "Desinstalando a seguinte versão:" + +#LangString str_msg_rm_fail ${LANG_PORTUGUESEBR} \ +# "Falha ao desinstalar a seguinte versão:" + +#LangString str_msg_no_rm_key ${LANG_PORTUGUESEBR} \ +# "Não foi possível encontrar a chave de registro do desinstalador." + +#LangString str_msg_no_rm_reg ${LANG_PORTUGUESEBR} \ +# "Não foi possível encontrar o desinstalador a partir do registro." + +#LangString str_msg_no_rm_exe ${LANG_PORTUGUESEBR} \ +# "Não foi possível acessar o desinstalador." + +#LangString str_msg_rm_copy_fail ${LANG_PORTUGUESEBR} \ +# "Falha ao copiar o desinstalador para um diretório temporário." + +#LangString str_msg_rm_run_fail ${LANG_PORTUGUESEBR} \ +# "Falha ao executar o desinstalador." + +#LangString str_msg_abort_install ${LANG_PORTUGUESEBR} \ +# "Instalador será interrompido." + +LangString str_msg_install_fail ${LANG_PORTUGUESEBR} \ + "A instalação falhou. Mais sorte na próxima vez." + +LangString str_msg_rm_exe_fail ${LANG_PORTUGUESEBR} \ + "Alguns arquivos em $0 não foram excluídos!$\r$\n\ + Você deve fazê-lo manualmente." + +#LangString str_msg_rm_root_fail ${LANG_PORTUGUESEBR} \ +# "AVISO: Não foi possível remover $\"$vim_install_root$\", \ +# pois não está vazio!" + +LangString str_msg_uninstalling ${LANG_PORTUGUESEBR} \ + "Desinstalando a versão antiga..." + +LangString str_msg_registering ${LANG_PORTUGUESEBR} \ + "Registrando..." + +LangString str_msg_unregistering ${LANG_PORTUGUESEBR} \ + "Desregistrando..." + + +############################################################################## +# Dialog Box {{{1 +############################################################################## + +LangString str_vimrc_page_title ${LANG_PORTUGUESEBR} \ + "Escolher configurações do _vimrc" +LangString str_vimrc_page_subtitle ${LANG_PORTUGUESEBR} \ + "Escolha as configurações para melhorias, teclado e mouse." + +LangString str_msg_compat_title ${LANG_PORTUGUESEBR} \ + " Comportamento Vi / Vim " +LangString str_msg_compat_desc ${LANG_PORTUGUESEBR} \ + "&Compatibilidade e melhorias" +LangString str_msg_compat_vi ${LANG_PORTUGUESEBR} \ + "Compatível com Vi" +LangString str_msg_compat_vim ${LANG_PORTUGUESEBR} \ + "Vim original" +LangString str_msg_compat_defaults ${LANG_PORTUGUESEBR} \ + "Vim com algumas melhorias (carrega defaults.vim)" +LangString str_msg_compat_all ${LANG_PORTUGUESEBR} \ + "Vim com todas as melhorias (carrega vimrc_example.vim) (Padrão)" + +LangString str_msg_keymap_title ${LANG_PORTUGUESEBR} \ + " Mapeamentos " +LangString str_msg_keymap_desc ${LANG_PORTUGUESEBR} \ + "&Remapear algumas teclas para o Windows (Ctrl-V, Ctrl-C, Ctrl-A, Ctrl-S, Ctrl-F, etc)" +LangString str_msg_keymap_default ${LANG_PORTUGUESEBR} \ + "Não remapear teclas (Padrão)" +LangString str_msg_keymap_windows ${LANG_PORTUGUESEBR} \ + "Remapear algumas teclas" + +LangString str_msg_mouse_title ${LANG_PORTUGUESEBR} \ + " Mouse " +LangString str_msg_mouse_desc ${LANG_PORTUGUESEBR} \ + "&Comportamento de botões direito e esquerdo" +LangString str_msg_mouse_default ${LANG_PORTUGUESEBR} \ + "Direito: menu popup, Esquerdo: modo visual (Padrão)" +LangString str_msg_mouse_windows ${LANG_PORTUGUESEBR} \ + "Direito: menu popup, Esquerdo: modo de seleção (Windows)" +LangString str_msg_mouse_unix ${LANG_PORTUGUESEBR} \ + "Direito: estende seleção, Esquerdo: modo visual (Unix)" diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index a7403052..95135c8b 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -3,7 +3,7 @@ vim9script # Vim functions for file type detection # # Maintainer: The Vim Project -# Last Change: 2025 Jan 25 +# Last Change: 2025 Apr 21 # Former Maintainer: Bram Moolenaar # These functions are moved here from runtime/filetype.vim to make startup @@ -203,19 +203,36 @@ export def FTlpc() setf c enddef +# Searches within the first `maxlines` lines of the file for distinctive +# Objective-C or C++ syntax and returns the appropriate filetype. Returns a +# null_string if the search was inconclusive. +def CheckObjCOrCpp(maxlines = 100): string + var n = 1 + while n < maxlines && n <= line('$') + const line = getline(n) + if line =~ '\v^\s*\@%(class|interface|end)>' + return 'objcpp' + elseif line =~ '\v^\s*%(class|namespace|template|using)>' + return 'cpp' + endif + ++n + endwhile + return null_string +enddef + +# Determines whether a *.h file is C, C++, Ch, or Objective-C/Objective-C++. export def FTheader() - if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1 - if exists("g:c_syntax_for_h") - setf objc - else - setf objcpp - endif - elseif exists("g:c_syntax_for_h") + if exists('g:filetype_h') + execute $'setf {g:filetype_h}' + elseif exists('g:c_syntax_for_h') setf c - elseif exists("g:ch_syntax_for_h") + elseif exists('g:ch_syntax_for_h') setf ch else - setf cpp + # Search the first 100 lines of the file for distinctive Objective-C or C++ + # syntax and set the filetype accordingly. Otherwise, use C as the default + # filetype. + execute $'setf {CheckObjCOrCpp() ?? 'c'}' endif enddef @@ -557,17 +574,47 @@ export def FTm() enddef export def FTmake() - # Check if it is a Microsoft Makefile - unlet! b:make_microsoft + # Check if it is a BSD, GNU, or Microsoft Makefile + unlet! b:make_flavor + + # 1. filename + if expand('%:t') == 'BSDmakefile' + b:make_flavor = 'bsd' + setf make + return + elseif expand('%:t') == 'GNUmakefile' + b:make_flavor = 'gnu' + setf make + return + endif + + # 2. user's setting + if exists('g:make_flavor') + b:make_flavor = g:make_flavor + setf make + return + elseif get(g:, 'make_microsoft') + echom "make_microsoft is deprecated; try g:make_flavor = 'microsoft' instead" + b:make_flavor = 'microsoft' + setf make + return + endif + + # 3. try to detect a flavor from file content var n = 1 while n < 1000 && n <= line('$') var line = getline(n) if line =~? '^\s*!\s*\(ifn\=\(def\)\=\|include\|message\|error\)\>' - b:make_microsoft = 1 + b:make_flavor = 'microsoft' + break + elseif line =~ '^\.\%(export\|error\|for\|if\%(n\=\%(def\|make\)\)\=\|info\|warning\)\>' + b:make_flavor = 'bsd' break - elseif line =~ '^ *ifn\=\(eq\|def\)\>' || line =~ '^ *[-s]\=include\s' + elseif line =~ '^ *\%(ifn\=\%(eq\|def\)\|define\|override\)\>' + b:make_flavor = 'gnu' break - elseif line =~ '^ *\w\+\s*[!?:+]=' + elseif line =~ '\$[({][a-z-]\+\s\+\S\+' # a function call, e.g. $(shell pwd) + b:make_flavor = 'gnu' break endif n += 1 @@ -592,14 +639,19 @@ export def FTmms() setf mmix enddef -# This function checks if one of the first five lines start with a dot. In -# that case it is probably an nroff file: 'filetype' is set and 1 is returned. +# This function checks if one of the first five lines start with a typical +# nroff pattern in man files. In that case it is probably an nroff file: +# 'filetype' is set and 1 is returned. export def FTnroff(): number - if getline(1)[0] .. getline(2)[0] .. getline(3)[0] - .. getline(4)[0] .. getline(5)[0] =~ '\.' - setf nroff - return 1 - endif + var n = 1 + while n <= 5 + var line = getline(n) + if line =~ '^\%([.'']\s*\%(TH\|D[dt]\|S[Hh]\|d[es]1\?\|so\)\s\+\S\|[.'']\s*ig\>\|\%([.'']\s*\)\?\\"\)' + setf nroff + return 1 + endif + n += 1 + endwhile return 0 enddef @@ -875,16 +927,16 @@ export def SetFileTypeSH(name: string, setft = true): string if setft && expand("") =~ g:ft_ignore_pat return '' endif - if name =~ '\' + if name =~ '^csh$' || name =~ '^#!.\{-2,}\' # Some .sh scripts contain #!/bin/csh. return SetFileTypeShell("csh", setft) - elseif name =~ '\' + elseif name =~ '^tcsh$' || name =~ '^#!.\{-2,}\' # Some .sh scripts contain #!/bin/tcsh. return SetFileTypeShell("tcsh", setft) - elseif name =~ '\' + elseif name =~ '^zsh$' || name =~ '^#!.\{-2,}\' # Some .sh scripts contain #!/bin/zsh. return SetFileTypeShell("zsh", setft) - elseif name =~ '\' + elseif name =~ '^ksh$' || name =~ '^#!.\{-2,}\' b:is_kornshell = 1 if exists("b:is_bash") unlet b:is_bash @@ -892,7 +944,8 @@ export def SetFileTypeSH(name: string, setft = true): string if exists("b:is_sh") unlet b:is_sh endif - elseif exists("g:bash_is_sh") || name =~ '\' || name =~ '\' + elseif exists("g:bash_is_sh") || name =~ '^bash2\=$' || + \ name =~ '^#!.\{-2,}\' b:is_bash = 1 if exists("b:is_kornshell") unlet b:is_kornshell @@ -900,7 +953,7 @@ export def SetFileTypeSH(name: string, setft = true): string if exists("b:is_sh") unlet b:is_sh endif - elseif name =~ '\' || name =~ '\' + elseif name =~ '^\%(da\)\=sh$' || name =~ '^#!.\{-2,}\<\%(da\)\=sh\>' # Ubuntu links "sh" to "dash", thus it is expected to work the same way b:is_sh = 1 if exists("b:is_kornshell") diff --git a/runtime/autoload/dist/man.vim b/runtime/autoload/dist/man.vim index d9dbaf47..32bf80c7 100644 --- a/runtime/autoload/dist/man.vim +++ b/runtime/autoload/dist/man.vim @@ -5,6 +5,8 @@ " Autoload Split: Bram Moolenaar " Last Change: 2024 Jan 17 (make it work on AIX, see #13847) " 2024 Jul 06 (honor command modifiers, #15117) +" 2025 Mar 05 (add :keepjumps, #16791) +" 2025 Mar 09 (improve :Man completion for man-db, #16843) let s:cpo_save = &cpo set cpo-=C @@ -34,6 +36,88 @@ endtry unlet! uname_s +let s:man_db_pages_by_section = v:null +func! s:ManDbPagesBySection() abort + if s:man_db_pages_by_section isnot v:null + return s:man_db_pages_by_section + endif + let s:man_db_pages_by_section = {} + let list_command = 'apropos --long .' + let unparsed_lines = [] + for line in systemlist(list_command) + " Typical lines: + " vim (1) - Vi IMproved, a programmer's text editor + " + " Unusual lines: + " pgm_read_ T _ (3avr) - (unknown subject) + " + " Code that shows the line's format: + " https://gitlab.com/man-db/man-db/-/blob/2607d203472efb036d888e9e7997724a41a53876/src/whatis.c#L409 + let match = matchlist(line, '^\(.\{-1,}\) (\(\S\+\)) ') + if empty(match) + call add(unparsed_lines, line) + continue + endif + let [page, section] = match[1:2] + if !has_key(s:man_db_pages_by_section, section) + let s:man_db_pages_by_section[section] = [] + endif + call add(s:man_db_pages_by_section[section], page) + endfor + if !empty(unparsed_lines) + echomsg 'Unable to parse ' .. string(len(unparsed_lines)) .. ' lines ' .. + \ 'from the output of `' .. list_command .. '`. Example lines:' + for line in unparsed_lines[:9] + echomsg line + endfor + endif + return s:man_db_pages_by_section +endfunc + +func! dist#man#Reload() abort + if g:ft_man_implementation ==# 'man-db' + let s:man_db_pages_by_section = v:null + call s:ManDbPagesBySection() + endif +endfunc + +func! s:StartsWithCaseInsensitive(haystack, needle) abort + if empty(a:needle) + return v:true + endif + return a:haystack[:len(a:needle)-1] ==? a:needle +endfunc + +func! dist#man#ManDbComplete(arg_lead, cmd_line, cursor_pos) abort + let args = split(trim(a:cmd_line[: a:cursor_pos - 1], '', 1), '', v:true) + let pages_by_section = s:ManDbPagesBySection() + if len(args) > 2 + " Page in the section args[1]. At least on Debian testing as of + " 2025-03-06, man seems to match sections case-insensitively and match any + " prefix of the section. E.g., `man 3 sigprocmask` and `man 3PoSi + " sigprocmask` with both load sigprocmask(3posix) even though the 3 in the + " first command is also the name of a different section. + let results = [] + for [section, pages] in items(pages_by_section) + if s:StartsWithCaseInsensitive(section, args[1]) + call extend(results, pages) + endif + endfor + else + " Could be a section, or a page in any section. Add space after sections + " since there has to be a second argument in that case. + let results = flattennew(values(pages_by_section), 1) + for section in keys(pages_by_section) + call add(results, section .. ' ') + endfor + endif + call sort(results) + call uniq(results) + call filter(results, + \ {_, val -> s:StartsWithCaseInsensitive(val, a:arg_lead)}) + return results +endfunc + func s:ParseIntoPageAndSection() " Accommodate a reference that terminates in a hyphen. " @@ -188,7 +272,7 @@ func dist#man#GetPage(cmdmods, ...) setl buftype=nofile noswapfile setl fdc=0 ma nofen nonu nornu - %delete _ + keepjumps %delete _ let unsetwidth = 0 if empty($MANWIDTH) let $MANWIDTH = winwidth(0) @@ -218,10 +302,10 @@ func dist#man#GetPage(cmdmods, ...) endif " Remove blank lines from top and bottom. while line('$') > 1 && getline(1) =~ '^\s*$' - 1delete _ + keepjumps 1delete _ endwhile while line('$') > 1 && getline('$') =~ '^\s*$' - $delete _ + keepjumps $delete _ endwhile 1 setl ft=man nomod diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim index 859126f0..c184bd03 100644 --- a/runtime/autoload/dist/script.vim +++ b/runtime/autoload/dist/script.vim @@ -4,7 +4,7 @@ vim9script # Invoked from "scripts.vim" in 'runtimepath' # # Maintainer: The Vim Project -# Last Change: 2025 Jan 20 +# Last Change: 2025 Apr 24 # Former Maintainer: Bram Moolenaar export def DetectFiletype() @@ -26,8 +26,9 @@ def DetectFromHashBang(firstline: string) # "#!/usr/bin/bash" to make matching easier. # Recognize only a few {options} that are commonly used. if line1 =~ '^#!\s*\S*\ -" Last Change: 2023 Nov 04 +" Last Change: 2025 Apr 27 " enable the zip and gzip plugin by default, if not set diff --git a/runtime/autoload/dist/vimindent.vim b/runtime/autoload/dist/vimindent.vim index 0681496a..37f2ee5e 100644 --- a/runtime/autoload/dist/vimindent.vim +++ b/runtime/autoload/dist/vimindent.vim @@ -2,7 +2,7 @@ vim9script # Language: Vim script # Maintainer: github user lacygoill -# Last Change: 2024 Dec 26 +# Last Change: 2025 Apr 13 # # Includes changes from The Vim Project: # - 2024 Feb 09: Fix indent after literal Dict (A. Radev via #13966) @@ -981,8 +981,10 @@ def SearchPair( # {{{3 if end == '[' || end == ']' e = e->escape('[]') endif + # VIM_INDENT_TEST_TRACE_START return searchpair('\C' .. s, (middle == '' ? '' : '\C' .. middle), '\C' .. e, flags, (): bool => InCommentOrString(), stopline, TIMEOUT) + # VIM_INDENT_TEST_TRACE_END dist#vimindent#SearchPair enddef def SearchPairStart( # {{{3 @@ -1268,7 +1270,9 @@ def NonCommentedMatch(line: dict, pat: string): bool # {{{3 var pos: list = getcurpos() cursor(line.lnum, 1) + # VIM_INDENT_TEST_TRACE_START var match_lnum: number = search(pat, 'cnW', line.lnum, TIMEOUT, (): bool => InCommentOrString()) + # VIM_INDENT_TEST_TRACE_END dist#vimindent#NonCommentedMatch setpos('.', pos) return match_lnum > 0 enddef diff --git a/runtime/autoload/getscript.vim b/runtime/autoload/getscript.vim index 39060508..1e3b5b39 100644 --- a/runtime/autoload/getscript.vim +++ b/runtime/autoload/getscript.vim @@ -12,6 +12,8 @@ " autoloading search path fix " substitution of hardcoded commands with global variables " 2024 Nov 12 by Vim Project: fix problems on Windows (#16036) +" 2025 Feb 28 by Vim Project: add support for bzip3 (#16755) +" 2025 May 11 by Vim Project: check network connectivity (#17249) " }}} " " GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim @@ -100,6 +102,10 @@ if !exists("g:GetLatestVimScripts_bunzip2") let g:GetLatestVimScripts_bunzip2= "bunzip2" endif +if !exists("g:GetLatestVimScripts_bunzip3") + let g:GetLatestVimScripts_bunzip3= "bunzip3" +endif + if !exists("g:GetLatestVimScripts_gunzip") let g:GetLatestVimScripts_gunzip= "gunzip" endif @@ -142,9 +148,6 @@ if g:GetLatestVimScripts_allowautoinstall elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim) let s:autoinstall= $HOME."/".s:dotvim endif -" call Decho("s:autoinstall<".s:autoinstall.">") -"else "Decho -" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled") endif " --------------------------------------------------------------------- @@ -158,24 +161,19 @@ silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts() " scripts based on the list in " (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat fun! getscript#GetLatestVimScripts() -" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">") -" insure that wget is executable if executable(g:GetLatestVimScripts_wget) != 1 echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system" -" call Dret("GetLatestVimScripts : wget not executable/available") return endif " Find the .../GetLatest subdirectory under the runtimepath for datadir in split(&rtp,',') + [''] if isdirectory(datadir."/GetLatest") -" call Decho("found directory<".datadir.">") let datadir= datadir . "/GetLatest" break endif if filereadable(datadir."GetLatestVimScripts.dat") -" call Decho("found ".datadir."/GetLatestVimScripts.dat") break endif endfor @@ -183,32 +181,25 @@ fun! getscript#GetLatestVimScripts() " Sanity checks: readability and writability if datadir == "" echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install' -" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory") return endif if filewritable(datadir) != 2 echoerr "(getLatestVimScripts) Your ".datadir." isn't writable" -" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">") return endif let datafile= datadir."/GetLatestVimScripts.dat" if !filereadable(datafile) echoerr "Your data file<".datafile."> isn't readable" -" call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">") return endif if !filewritable(datafile) echoerr "Your data file<".datafile."> isn't writable" -" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">") return endif " -------------------- " Passed sanity checks " -------------------- -" call Decho("datadir <".datadir.">") -" call Decho("datafile <".datafile.">") - " don't let any event handlers interfere (like winmanager's, taglist's, etc) let eikeep = &ei let hlskeep = &hls @@ -221,25 +212,20 @@ fun! getscript#GetLatestVimScripts() " 3. split window " 4. edit datafile let origdir= getcwd() -" call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge'))) exe "cd ".fnameescape(substitute(datadir,'\','/','ge')) split -" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge'))) exe "e ".fnameescape(substitute(datafile,'\','/','ge')) res 1000 let s:downloads = 0 let s:downerrors= 0 + let s:message = [] " Check on dependencies mentioned in plugins -" call Decho(" ") -" call Decho("searching plugins for GetLatestVimScripts dependencies") let lastline = line("$") -" call Decho("lastline#".lastline) let firstdir = substitute(&rtp,',.*$','','') let plugins = split(globpath(firstdir,"plugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"ftplugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"AsNeeded/**/*.vim"),'\n') -" extend the search to the packages too (this script predates the feature) let plugins += split(globpath(firstdir,"pack/*/start/*/plugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"pack/*/opt/*/plugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"pack/*/start/*/ftplugin/**/*.vim"),'\n') @@ -252,14 +238,10 @@ fun! getscript#GetLatestVimScripts() " It reads the plugin script at the end of the GetLatestVimScripts.dat " file, examines it, and then removes it. for plugin in plugins -" call Decho(" ") -" call Decho("plugin<".plugin.">") " read plugin in " evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it $ -" call Decho(".dependency checking<".plugin."> line$=".line("$")) -" call Decho("..exe silent r ".fnameescape(plugin)) exe "silent r ".fnameescape(plugin) exe "silent bwipe ".bufnr("#") @@ -267,7 +249,6 @@ fun! getscript#GetLatestVimScripts() let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e') let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','') let llp1 = lastline+1 -" call Decho("..depscript<".depscript.">") " found a "GetLatestVimScripts: # #" line in the script; " check if it's already in the datafile by searching backwards from llp1, @@ -281,21 +262,17 @@ fun! getscript#GetLatestVimScripts() " this second search is taken when, for example, a 0 0 scriptname is to be skipped over let srchline= search('\<'.noai_script.'\>','bW') endif -" call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline) if srchline == 0 " found a new script to permanently include in the datafile let keep_rega = @a let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','') echomsg "Appending <".@a."> to ".datafile." for ".depscript -" call Decho("..Appending <".@a."> to ".datafile." for ".depscript) exe lastline."put a" let @a = keep_rega let lastline = llp1 let curline = curline + 1 let foundscript = foundscript + 1 -" else " Decho -" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")") endif let curline = curline + 1 @@ -304,12 +281,8 @@ fun! getscript#GetLatestVimScripts() " llp1: last line plus one let llp1= lastline + 1 -" call Decho(".deleting lines: ".llp1.",$d") exe "silent! ".llp1.",$d" endfor -" call Decho("--- end dependency checking loop --- foundscript=".foundscript) -" call Decho(" ") -" call Dredir("BUFFER TEST (GetLatestVimScripts 1)","ls!") if foundscript == 0 setlocal nomod @@ -318,32 +291,32 @@ fun! getscript#GetLatestVimScripts() " -------------------------------------------------------------------- " Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat " -------------------------------------------------------------------- -" call Decho("begin: checking out-of-date scripts using datafile<".datafile.">") setlocal lz 1 -" /^-----/,$g/^\s*\d/call Decho(getline(".")) - 1 /^-----/,$g/^\s*\d/call s:GetOneScript() -" call Decho("--- end out-of-date checking --- ") " Final report (an echomsg) try silent! ?^-------? catch /^Vim\%((\a\+)\)\=:E114/ -" call Dret("GetLatestVimScripts : nothing done!") return endtry exe "norm! kz\" redraw! + if !empty(s:message) + echohl WarningMsg + for mess in s:message + echom mess + endfor + let s:downerrors += len(s:message) + endif let s:msg = "" if s:downloads == 1 let s:msg = "Downloaded one updated script to <".datadir.">" - elseif s:downloads == 2 - let s:msg= "Downloaded two updated scripts to <".datadir.">" elseif s:downloads > 1 let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">" else - let s:msg= "Everything was already current" + let s:msg= empty(s:message) ? "Everything was already current" : "There were some errors" endif if s:downerrors > 0 let s:msg= s:msg." (".s:downerrors." downloading errors)" @@ -361,8 +334,6 @@ fun! getscript#GetLatestVimScripts() let &hls = hlskeep let &acd = acdkeep setlocal nolz -" call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!") -" call Dret("GetLatestVimScripts : did ".s:downloads." downloads") endfun " --------------------------------------------------------------------- @@ -371,8 +342,6 @@ endfun " ScriptID, SourceID, and Filename. " It downloads any scripts that have newer versions from vim.sourceforge.net. fun! s:GetOneScript(...) -" call Dfunc("GetOneScript()") - " set options to allow progress to be shown on screen let rega= @a let t_ti= &t_ti @@ -398,13 +367,9 @@ fun! s:GetOneScript(...) let srcid = a:2 let fname = a:3 let cmmnt = "" -" call Decho("scriptid<".scriptid.">") -" call Decho("srcid <".srcid.">") -" call Decho("fname <".fname.">") else let curline = getline(".") if curline =~ '^\s*#' -" call Dret("GetOneScript : skipping a pure comment line") return endif let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$' @@ -428,36 +393,26 @@ fun! s:GetOneScript(...) catch /^Vim\%((\a\+)\)\=:E486/ let cmmnt= "" endtry -" call Decho("curline <".curline.">") -" call Decho("parsepat<".parsepat.">") -" call Decho("scriptid<".scriptid.">") -" call Decho("srcid <".srcid.">") -" call Decho("fname <".fname.">") endif " plugin author protection from downloading his/her own scripts atop their latest work + " When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname if scriptid == 0 || srcid == 0 - " When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname -" call Dret("GetOneScript : skipping a scriptid==srcid==0 line") return endif let doautoinstall= 0 if fname =~ ":AutoInstall:" -" call Decho("case AutoInstall: fname<".fname.">") let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','') -" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall) if s:autoinstall != "" let doautoinstall = g:GetLatestVimScripts_allowautoinstall endif else let aicmmnt= fname endif -" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall) exe "norm z\" redraw! -" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid) echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid " grab a copy of the plugin's vim.sourceforge.net webpage @@ -465,15 +420,17 @@ fun! s:GetOneScript(...) let tmpfile = tempname() let v:errmsg = "" + " Check if URLs are reachable + if !CheckVimScriptURL(scriptid, srcid) + return + endif + " make up to three tries at downloading the description let itry= 1 while itry <= 3 -" call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr) if has("win32") || has("win16") || has("win95") -" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!") new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw! else -" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)) exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr) endif if itry == 1 @@ -491,7 +448,6 @@ fun! s:GetOneScript(...) endif let itry= itry + 1 endwhile -" call Decho(" --- end downloading tries while loop --- itry=".itry) " testing: did finding "Click on the package..." fail? if findpkg == 0 || itry >= 4 @@ -502,12 +458,9 @@ fun! s:GetOneScript(...) let &t_te = t_te let &rs = rs let s:downerrors = s:downerrors + 1 -" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">") echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">" -" call Dret("GetOneScript : srch for /Click on the package/ failed") return endif -" call Decho('found "Click on the package to download"') let findsrcid= search('src_id=','W') if findsrcid == 0 @@ -518,28 +471,22 @@ fun! s:GetOneScript(...) let &t_te = t_te let &rs = rs let s:downerrors = s:downerrors + 1 -" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">") echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">" -" call Dret("GetOneScript : srch for /src_id/ failed") return endif -" call Decho('found "src_id=" in description page') let srcidpat = '^\s*\([^<]\+\)<.*$' let latestsrcid= substitute(getline("."),srcidpat,'\1','') let sname = substitute(getline("."),srcidpat,'\2','') " script name actually downloaded -" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> sname<".sname.">") silent q! call delete(tmpfile) " convert the strings-of-numbers into numbers let srcid = srcid + 0 let latestsrcid = latestsrcid + 0 -" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">") " has the plugin's most-recent srcid increased, which indicates that it has been updated if latestsrcid > srcid -" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">") let s:downloads= s:downloads + 1 if sname == bufname("%") @@ -550,88 +497,65 @@ fun! s:GetOneScript(...) " ----------------------------------------------------------------------------- " the plugin has been updated since we last obtained it, so download a new copy " ----------------------------------------------------------------------------- -" call Decho(".downloading new <".sname.">") echomsg ".downloading new <".sname.">" if has("win32") || has("win16") || has("win95") -" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)."|bw!") new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)|bw! else -" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid) exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid) endif " -------------------------------------------------------------------------- " AutoInstall: only if doautoinstall has been requested by the plugin itself " -------------------------------------------------------------------------- -" call Decho("checking if plugin requested autoinstall: doautoinstall=".doautoinstall) if doautoinstall -" call Decho(" ") -" call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname)) if filereadable(sname) -" call Decho("<".sname."> is readable") -" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall)) exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall) let curdir = fnameescape(substitute(getcwd(),'\','/','ge')) let installdir= curdir."/Installed" if !isdirectory(installdir) call mkdir(installdir) endif -" call Decho("curdir<".curdir."> installdir<".installdir.">") -" call Decho("exe cd ".fnameescape(s:autoinstall)) exe "cd ".fnameescape(s:autoinstall) " determine target directory for moves let firstdir= substitute(&rtp,',.*$','','') let pname = substitute(sname,'\..*','.vim','') -" call Decho("determine tgtdir: is <".firstdir.'/AsNeeded/'.pname." readable?") if filereadable(firstdir.'/AsNeeded/'.pname) let tgtdir= "AsNeeded" else let tgtdir= "plugin" endif -" call Decho("tgtdir<".tgtdir."> pname<".pname.">") - + " decompress if sname =~ '\.bz2$' -" call Decho("decompress: attempt to bunzip2 ".sname) exe "sil !".g:GetLatestVimScripts_bunzip2." ".shellescape(sname) let sname= substitute(sname,'\.bz2$','','') -" call Decho("decompress: new sname<".sname."> after bunzip2") + elseif sname =~ '\.bz3$' + exe "sil !".g:GetLatestVimScripts_bunzip3." ".shellescape(sname) + let sname= substitute(sname,'\.bz3$','','') elseif sname =~ '\.gz$' -" call Decho("decompress: attempt to gunzip ".sname) exe "sil !".g:GetLatestVimScripts_gunzip." ".shellescape(sname) let sname= substitute(sname,'\.gz$','','') -" call Decho("decompress: new sname<".sname."> after gunzip") elseif sname =~ '\.xz$' -" call Decho("decompress: attempt to unxz ".sname) exe "sil !".g:GetLatestVimScripts_unxz." ".shellescape(sname) let sname= substitute(sname,'\.xz$','','') -" call Decho("decompress: new sname<".sname."> after unxz") else -" call Decho("no decompression needed") endif - + " distribute archive(.zip, .tar, .vba, .vmb, ...) contents if sname =~ '\.zip$' -" call Decho("dearchive: attempt to unzip ".sname) exe "silent !".g:GetLatestVimScripts_unzip." -o ".shellescape(sname) elseif sname =~ '\.tar$' -" call Decho("dearchive: attempt to untar ".sname) exe "silent !tar -xvf ".shellescape(sname) elseif sname =~ '\.tgz$' -" call Decho("dearchive: attempt to untar+gunzip ".sname) exe "silent !tar -zxvf ".shellescape(sname) elseif sname =~ '\.taz$' -" call Decho("dearchive: attempt to untar+uncompress ".sname) exe "silent !tar -Zxvf ".shellescape(sname) elseif sname =~ '\.tbz$' -" call Decho("dearchive: attempt to untar+bunzip2 ".sname) exe "silent !tar -jxvf ".shellescape(sname) elseif sname =~ '\.txz$' -" call Decho("dearchive: attempt to untar+xz ".sname) exe "silent !tar -Jxvf ".shellescape(sname) elseif sname =~ '\.vba$\|\.vmb$' -" call Decho("dearchive: attempt to handle a vimball: ".sname) silent 1split if exists("g:vimball_home") let oldvimballhome= g:vimball_home @@ -645,28 +569,22 @@ fun! s:GetOneScript(...) else unlet g:vimball_home endif - else -" call Decho("no dearchiving needed") endif - + " --------------------------------------------- " move plugin to plugin/ or AsNeeded/ directory " --------------------------------------------- if sname =~ '.vim$' -" call Decho("dearchive: attempt to simply move ".sname." to ".tgtdir) exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".tgtdir else -" call Decho("dearchive: move <".sname."> to installdir<".installdir.">") exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir endif if tgtdir != "plugin" -" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape("plugin/".pname)." ".tgtdir) exe "silent !".g:GetLatestVimScripts_mv." ".shellescape("plugin/".pname)." ".tgtdir endif - + " helptags step let docdir= substitute(&rtp,',.*','','e')."/doc" -" call Decho("helptags: docdir<".docdir.">") exe "helptags ".fnameescape(docdir) exe "cd ".fnameescape(curdir) endif @@ -681,13 +599,42 @@ fun! s:GetOneScript(...) " update the data in the file call setline(line("."),modline) -" call Decho("update data in ".expand("%")."#".line(".").": modline<".modline.">") -" else " Decho -" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."], no need to update") endif +endfun + +" CheckVimScriptURL: Check Network Connection {{{1 +" Check status code of scriptaddr and downloadaddr +" return v:true if the script is downloadable or v:false in case of errors +fun CheckVimScriptURL(script_id, src_id) + " doesn't work with powershell + if !executable('curl') || &shell =~? 'pwsh\|powershell' + return v:true + endif + let output = has("win32") ? ' -o NUL ' : ' -o /dev/null ' + + let temp = tempname() + defer delete(temp) + let script_url = g:GetLatestVimScripts_scriptaddr . a:script_id + let download_url = g:GetLatestVimScripts_downloadaddr . a:src_id -" call Dredir("BUFFER TEST (GetOneScript)","ls!") -" call Dret("GetOneScript") + let script_cmd = 'curl -s -I -w "%{http_code}"' . output . shellescape(script_url) . ' >' . shellescape(temp) + call system(script_cmd) + let script_status = readfile(temp, 'b')[0] + + let download_cmd = 'curl -s -I -w "%{http_code}"' . output . shellescape(download_url) . ' >' . shellescape(temp) + call system(download_cmd) + let download_status = readfile(temp, 'b')[0] + + if script_status !=# '200' + let s:message += [ printf('Error: Failed to reach script: %s', a:script_id) ] + return v:false + endif + + if download_status !=# '200' + let s:message += [ printf('Error: Failed to download script %s', a:script_id) ] + return v:false + endif + return v:true endfun " --------------------------------------------------------------------- diff --git a/runtime/autoload/htmlfold.vim b/runtime/autoload/htmlfold.vim new file mode 100644 index 00000000..76ccaefa --- /dev/null +++ b/runtime/autoload/htmlfold.vim @@ -0,0 +1,192 @@ +" HTML folding script, :h ft-html-plugin +" Latest Change: 2025 May 10 +" Original Author: Aliaksei Budavei <0x000c70@gmail.com> + +function! htmlfold#MapBalancedTags() abort + " Describe only _a capturable-name prefix_ for start and end patterns of + " a tag so that start tags with attributes spanning across lines can also be + " matched with a single call of "getline()". + let tag = '\m\c 0 + let name_attr = synIDattr(synID(lnum, cnum, 0), 'name') + + if name_attr ==# 'htmlTag' || name_attr ==# 'htmlScriptTag' + let name = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') + + if !empty(name) + call insert(names, tolower(name), 0) + call insert(pairs, [lnum, -1], 0) + endif + elseif name_attr ==# 'htmlEndTag' + let name = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') + + if !empty(name) + let idx = index(names, tolower(name)) + + if idx >= 0 + " Dismiss inlined balanced tags and opened-only tags. + if pairs[idx][0] != lnum + let pairs[idx][1] = lnum + call add(ends, lnum) + endif + + " Claim a pair. + let names[: idx] = repeat([''], (idx + 1)) + endif + endif + endif + + " Advance the cursor, at "<", past "", etc. + call cursor(lnum, (cnum + 3)) + let [lnum, cnum] = searchpos(tag, 'cnW') + endwhile + finally + call setpos('.', pos) + endtry + + if empty(ends) + return {} + endif + + let folds = {} + let pending_end = ends[0] + let level = 0 + + while !empty(pairs) + let [start, end] = remove(pairs, -1) + + if end < 0 + continue + endif + + if start >= pending_end + " Mark a sibling tag. + call remove(ends, 0) + + while start >= ends[0] + " Mark a parent tag. + call remove(ends, 0) + let level -= 1 + endwhile + + let pending_end = ends[0] + else + " Mark a child tag. + let level += 1 + endif + + " Flatten the innermost inlined folds. + let folds[start] = get(folds, start, ('>' . level)) + let folds[end] = get(folds, end, ('<' . level)) + endwhile + + return folds +endfunction + +" See ":help vim9-mix". +if !has("vim9script") + finish +endif + +def! g:htmlfold#MapBalancedTags(): dict + # Describe only _a capturable-name prefix_ for start and end patterns of + # a tag so that start tags with attributes spanning across lines can also be + # matched with a single call of "getline()". + const tag: string = '\m\c = [] + var pairs: list> = [] + var ends: list = [] + const pos: list = getpos('.') + + try + cursor(1, 1) + var [lnum: number, cnum: number] = searchpos(tag, 'cnW') + + # Pair up nearest non-inlined tags in scope. + while lnum > 0 + const name_attr: string = synIDattr(synID(lnum, cnum, 0), 'name') + + if name_attr ==# 'htmlTag' || name_attr ==# 'htmlScriptTag' + const name: string = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') + + if !empty(name) + insert(names, tolower(name), 0) + insert(pairs, [lnum, -1], 0) + endif + elseif name_attr ==# 'htmlEndTag' + const name: string = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') + + if !empty(name) + const idx: number = index(names, tolower(name)) + + if idx >= 0 + # Dismiss inlined balanced tags and opened-only tags. + if pairs[idx][0] != lnum + pairs[idx][1] = lnum + add(ends, lnum) + endif + + # Claim a pair. + names[: idx] = repeat([''], (idx + 1)) + endif + endif + endif + + # Advance the cursor, at "<", past "", etc. + cursor(lnum, (cnum + 3)) + [lnum, cnum] = searchpos(tag, 'cnW') + endwhile + finally + setpos('.', pos) + endtry + + if empty(ends) + return {} + endif + + var folds: dict = {} + var pending_end: number = ends[0] + var level: number = 0 + + while !empty(pairs) + const [start: number, end: number] = remove(pairs, -1) + + if end < 0 + continue + endif + + if start >= pending_end + # Mark a sibling tag. + remove(ends, 0) + + while start >= ends[0] + # Mark a parent tag. + remove(ends, 0) + level -= 1 + endwhile + + pending_end = ends[0] + else + # Mark a child tag. + level += 1 + endif + + # Flatten the innermost inlined folds. + folds[start] = get(folds, start, ('>' .. level)) + folds[end] = get(folds, end, ('<' .. level)) + endwhile + + return folds +enddef + +" vim: fdm=syntax sw=2 ts=8 noet diff --git a/runtime/autoload/python.vim b/runtime/autoload/python.vim index d5f48623..cf01198d 100644 --- a/runtime/autoload/python.vim +++ b/runtime/autoload/python.vim @@ -20,10 +20,12 @@ let g:python_indent = extend(get(g:, 'python_indent', {}), #{ let s:maxoff = 50 " maximum number of lines to look backwards for () function s:SearchBracket(fromlnum, flags) + " VIM_INDENT_TEST_TRACE_START return searchpairpos('[[({]', '', '[])}]', a:flags, \ {-> synstack('.', col('.')) \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\|String\)$'}) >= 0}, \ [0, a:fromlnum - s:maxoff]->max(), g:python_indent.searchpair_timeout) + " VIM_INDENT_TEST_TRACE_END python#s:SearchBracket endfunction " See if the specified line is already user-dedented from the expected value. diff --git a/runtime/autoload/rustfmt.vim b/runtime/autoload/rustfmt.vim index 8fd38581..f325df2f 100644 --- a/runtime/autoload/rustfmt.vim +++ b/runtime/autoload/rustfmt.vim @@ -1,5 +1,6 @@ " Author: Stephen Sugden " Last Modified: 2023-09-11 +" Last Change: 2025 Mar 31 by Vim project (rename s:RustfmtConfigOptions()) " " Adapted from https://github.com/fatih/vim-go " For bugs, patches and license go to https://github.com/rust-lang/rust.vim @@ -61,7 +62,7 @@ function! s:RustfmtWriteMode() endif endfunction -function! s:RustfmtConfigOptions() +function! rustfmt#RustfmtConfigOptions() let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';') if l:rustfmt_toml !=# '' return '--config-path '.shellescape(fnamemodify(l:rustfmt_toml, ":p")) @@ -84,7 +85,7 @@ function! s:RustfmtCommandRange(filename, line1, line2) let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]} let l:write_mode = s:RustfmtWriteMode() - let l:rustfmt_config = s:RustfmtConfigOptions() + let l:rustfmt_config = rustfmt#RustfmtConfigOptions() " FIXME: When --file-lines gets to be stable, add version range checking " accordingly. @@ -99,7 +100,7 @@ endfunction function! s:RustfmtCommand() let write_mode = g:rustfmt_emit_files ? '--emit=stdout' : '--write-mode=display' - let config = s:RustfmtConfigOptions() + let config = rustfmt#RustfmtConfigOptions() return join([g:rustfmt_command, write_mode, config, g:rustfmt_options]) endfunction diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index 5c4499fa..499036ef 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -1,9 +1,20 @@ " tar.vim: Handles browsing tarfiles - AUTOLOAD PORTION -" Date: Feb 06, 2025 +" Date: Mar 01, 2025 " Version: 32b (with modifications from the Vim Project) " Maintainer: This runtime file is looking for a new maintainer. " Former Maintainer: Charles E Campbell " License: Vim License (see vim's :help license) +" Last Change: +" 2024 Jan 08 by Vim Project: fix a few problems (#138331, #12637, #8109) +" 2024 Feb 19 by Vim Project: announce adoption +" 2024 Nov 11 by Vim Project: support permissions (#7379) +" 2025 Feb 06 by Vim Project: add support for lz4 (#16591) +" 2025 Feb 28 by Vim Project: add support for bzip3 (#16755) +" 2025 Mar 01 by Vim Project: fix syntax error in tar#Read() +" 2025 Mar 02 by Vim Project: escape the filename before using :read +" 2025 Mar 02 by Vim Project: determine the compression using readblob() +" instead of shelling out to file(1) +" 2025 Apr 16 by Vim Project: decouple from netrw by adding s:WinPath() " " Contains many ideas from Michael Toren's " @@ -136,7 +147,7 @@ fun! tar#Browse(tarfile) let lastline= line("$") call setline(lastline+1,'" tar.vim version '.g:loaded_tar) call setline(lastline+2,'" Browsing tarfile '.a:tarfile) - call setline(lastline+3,'" Select a file with cursor and press ENTER') + call setline(lastline+3,'" Select a file with cursor and press ENTER, "x" to extract a file') keepj $put ='' keepj sil! 0d keepj $ @@ -153,21 +164,19 @@ fun! tar#Browse(tarfile) elseif tarfile =~# '\.\(tgz\)$' || tarfile =~# '\.\(tbz\)$' || tarfile =~# '\.\(txz\)$' || \ tarfile =~# '\.\(tzst\)$' || tarfile =~# '\.\(tlz4\)$' - if has("unix") && executable("file") - let filekind= system("file ".shellescape(tarfile,1)) - else - let filekind= "" - endif + let header= s:Header(tarfile) - if filekind =~ "bzip2" + if header =~? 'bzip2' exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " - elseif filekind =~ "XZ" + elseif header =~? 'bzip3' + exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + elseif header =~? 'xz' exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " - elseif filekind =~ "Zstandard" + elseif header =~? 'zstd' exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " - elseif filekind =~ "LZ4" + elseif header =~? 'lz4' exe "sil! r! lz4 --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " - else + elseif header =~? 'gzip' exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " endif @@ -175,6 +184,8 @@ fun! tar#Browse(tarfile) exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.\(bz2\|tbz\|tb2\)$' exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + elseif tarfile =~# '\.\(bz3\|tb3\)$' + exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.\(lzma\|tlz\)$' exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.\(xz\|txz\)$' @@ -273,6 +284,8 @@ fun! tar#Read(fname,mode) set report=10 let tarfile = substitute(a:fname,'tarfile:\(.\{-}\)::.*$','\1','') let fname = substitute(a:fname,'tarfile:.\{-}::\(.*\)$','\1','') + " be careful not to execute special crafted files + let escape_file = fname->fnameescape() " changing the directory to the temporary earlier to allow tar to extract the file with permissions intact if !exists("*mkdir") @@ -316,6 +329,9 @@ fun! tar#Read(fname,mode) if fname =~ '\.bz2$' && executable("bzcat") let decmp= "|bzcat" let doro = 1 + elseif fname =~ '\.bz3$' && executable("bz3cat") + let decmp= "|bz3cat" + let doro = 1 elseif fname =~ '\.t\=gz$' && executable("zcat") let decmp= "|zcat" let doro = 1 @@ -334,7 +350,7 @@ fun! tar#Read(fname,mode) else let decmp="" let doro = 0 - if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.xz$\|\.zip$\|\.Z$' + if fname =~ '\.bz2$\|\.bz3$\|\.gz$\|\.lzma$\|\.xz$\|\.zip$\|\.Z$' setlocal bin endif endif @@ -347,49 +363,51 @@ fun! tar#Read(fname,mode) if tarfile =~# '\.bz2$' exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname + exe "read ".escape_file + elseif tarfile =~# '\.bz3$' + exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "read ".escape_file elseif tarfile =~# '\.\(gz\)$' exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname + exe "read ".escape_file elseif tarfile =~# '\(\.tgz\|\.tbz\|\.txz\)' - if has("unix") && executable("file") - let filekind= system("file ".shellescape(tarfile,1)) - else - let filekind= "" - endif - if filekind =~ "bzip2" + let filekind= s:Header(tarfile) + if filekind =~? "bzip2" exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname - elseif filekind =~ "XZ" + exe "read ".escape_file + elseif filekind =~ "bzip3" + exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "read ".escape_file + elseif filekind =~? "xz" exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname - elseif filekind =~ "Zstandard" + exe "read ".escape_file + elseif filekind =~? "zstd" exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname - else + exe "read ".escape_file + elseif filekind =~? "gzip" exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname + exe "read ".escape_file endif elseif tarfile =~# '\.lrp$' exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname + exe "read ".escape_file elseif tarfile =~# '\.lzma$' exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname + exe "read ".escape_file elseif tarfile =~# '\.\(xz\|txz\)$' exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname + exe "read ".escape_file elseif tarfile =~# '\.\(lz4\|tlz4\)$' exe "sil! r! lz4 --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname + exe "read ".escape_file else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. let tarfile = substitute(tarfile, '-', './-', '') endif exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".tar_secure.shellescape(fname,1).decmp - exe "read ".fname + exe "read ".escape_file endif redraw! @@ -446,6 +464,10 @@ fun! tar#Write(fname) call system("bzip2 -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.bz2','','e') let compress= "bzip2 -- ".shellescape(tarfile,0) + elseif tarfile =~# '\.bz3' + call system("bzip3 -d -- ".shellescape(tarfile,0)) + let tarfile = substitute(tarfile,'\.bz3','','e') + let compress= "bzip3 -- ".shellescape(tarfile,0) elseif tarfile =~# '\.gz' call system("gzip -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.gz','','e') @@ -472,6 +494,7 @@ fun! tar#Write(fname) let tarfile = substitute(tarfile,'\.lzma','','e') let compress= "lzma -- ".shellescape(tarfile,0) endif + " Note: no support for name.tar.tbz/.txz/.tgz/.tlz4/.tzst if v:shell_error != 0 redraw! @@ -593,7 +616,7 @@ fun! tar#Extract() let tarball = expand("%") let tarbase = substitute(tarball,'\..*$','','') - let extractcmd= netrw#WinPath(g:tar_extractcmd) + let extractcmd= s:WinPath(g:tar_extractcmd) if filereadable(tarbase.".tar") call system(extractcmd." ".shellescape(tarbase).".tar ".shellescape(fname)) if v:shell_error != 0 @@ -638,6 +661,15 @@ fun! tar#Extract() echo "***note*** successfully extracted ".fname endif + elseif filereadable(tarbase.".tar.bz3") + let extractcmd= substitute(extractcmd,"-","-j","") + call system(extractcmd." ".shellescape(tarbase).".tar.bz3 ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd."j ".tarbase.".tar.bz3 ".fname.": failed!" | echohl NONE + else + echo "***note*** successfully extracted ".fname + endif + elseif filereadable(tarbase.".txz") let extractcmd= substitute(extractcmd,"-","-J","") call system(extractcmd." ".shellescape(tarbase).".txz ".shellescape(fname)) @@ -711,6 +743,48 @@ fun! s:Rmdir(fname) endif endfun +" s:FileHeader: {{{2 +fun! s:Header(fname) + let header= readblob(a:fname, 0, 6) + if header[0:2] == str2blob(['BZh']) " bzip2 header + return "bzip2" + elseif header[0:2] == str2blob(['BZ3']) " bzip3 header + return "bzip3" + elseif header == str2blob(["\3757zXZ\n"]) " xz header + return "xz" + elseif header[0:3] == str2blob(["\x28\xB5\x2F\xFD"]) " zstd header + return "zstd" + elseif header[0:3] == str2blob(["\004\"M\030"]) " lz4 header + return "lz4" + elseif (header[0:1] == str2blob(["\037\235"]) || + \ header[0:1] == str2blob(["\037\213"]) || + \ header[0:1] == str2blob(["\037\236"]) || + \ header[0:1] == str2blob(["\037\240"]) || + \ header[0:1] == str2blob(["\037\036"])) + return "gzip" + endif + return "unknown" +endfun + +" --------------------------------------------------------------------- +" s:WinPath: {{{2 +fun! s:WinPath(path) + if (!g:netrw_cygwin || &shell !~ '\%(\\|\\)\%(\.exe\)\=$') && has("win32") + " remove cygdrive prefix, if present + let path = substitute(a:path, '/cygdrive/\(.\)', '\1:', '') + " remove trailing slash (Win95) + let path = substitute(path, '\(\\\|/\)$', '', 'g') + " remove escaped spaces + let path = substitute(path, '\ ', ' ', 'g') + " convert slashes to backslashes + let path = substitute(path, '/', '\', 'g') + else + let path = a:path + endif + + return path +endfun + " --------------------------------------------------------------------- " tar#Vimuntar: installs a tarball in the user's .vim / vimfiles directory {{{2 fun! tar#Vimuntar(...) @@ -732,7 +806,7 @@ fun! tar#Vimuntar(...) if simplify(curdir) != simplify(vimhome) " copy (possibly compressed) tarball to .vim/vimfiles - call system(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome)) + call system(s:WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome)) exe "cd ".fnameescape(vimhome) endif @@ -754,7 +828,7 @@ fun! tar#Vimuntar(...) else call vimball#Decompress(tartail,0) endif - let extractcmd= netrw#WinPath(g:tar_extractcmd) + let extractcmd= s:WinPath(g:tar_extractcmd) call system(extractcmd." ".shellescape(tarbase.".tar")) " set up help diff --git a/runtime/autoload/tutor.vim b/runtime/autoload/tutor.vim index 3265fdde..6ab79602 100644 --- a/runtime/autoload/tutor.vim +++ b/runtime/autoload/tutor.vim @@ -210,6 +210,7 @@ function! tutor#TutorCmd(tutor_name) call tutor#SetupVim() exe "edit ".l:to_open + call tutor#EnableInteractive(v:true) endfunction function! tutor#TutorCmdComplete(lead,line,pos) @@ -217,3 +218,24 @@ function! tutor#TutorCmdComplete(lead,line,pos) let l:names = uniq(sort(map(l:tutors, 'fnamemodify(v:val, ":t:r")'), 's:Sort')) return join(l:names, "\n") endfunction + +" Enables/disables interactive mode. +function! tutor#EnableInteractive(enable) + let enable = a:enable + if enable + setlocal buftype=nofile + setlocal concealcursor+=inv + setlocal conceallevel=2 + call tutor#ApplyMarks() + augroup tutor_interactive + autocmd! TextChanged,TextChangedI call tutor#ApplyMarksOnChanged() + augroup END + else + setlocal buftype< + setlocal concealcursor< + setlocal conceallevel< + if exists('#tutor_interactive') + autocmd! tutor_interactive * + endif + endif +endfunction diff --git a/runtime/autoload/vimball.vim b/runtime/autoload/vimball.vim index 774b798a..64569844 100644 --- a/runtime/autoload/vimball.vim +++ b/runtime/autoload/vimball.vim @@ -2,8 +2,10 @@ " Maintainer: This runtime file is looking for a new maintainer. " Original Author: Charles E. Campbell " Date: Apr 11, 2016 -" Version: 37 +" Version: 37 (with modifications from the Vim Project) " GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim +" Last Change: +" 2025 Feb 28 by Vim Project: add support for bzip3 (#16755) " Copyright: (c) 2004-2011 by Charles E. Campbell " The VIM LICENSE applies to Vimball.vim, and Vimball.txt " (see |copyright|) except use "Vimball" instead of "Vim". @@ -530,6 +532,26 @@ fun! vimball#Decompress(fname,...) exe "e ".escape(fname,' \') if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif + elseif expand("%") =~ '.*\.bz3' && executable("bunzip3") + " handle *.bz3 with bunzip3 + silent exe "!bunzip3 ".shellescape(a:fname) + if v:shell_error != 0 + call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) bunzip3 may have failed with <".a:fname.">") + endif + let fname= substitute(a:fname,'\.bz3$','','') + exe "e ".escape(fname,' \') + if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif + + elseif expand("%") =~ '.*\.bz3' && executable("bzip3") + " handle *.bz3 with bzip3 -d + silent exe "!bzip3 -d ".shellescape(a:fname) + if v:shell_error != 0 + call vimball#ShowMesg(s:WARNING,'(vimball#Decompress) "bzip3 -d" may have failed with <'.a:fname.">") + endif + let fname= substitute(a:fname,'\.bz3$','','') + exe "e ".escape(fname,' \') + if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif + elseif expand("%") =~ '.*\.zip' && executable("unzip") " handle *.zip with unzip silent exe "!unzip ".shellescape(a:fname) diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim index 4a53fc5f..dae4ddeb 100644 --- a/runtime/autoload/zip.vim +++ b/runtime/autoload/zip.vim @@ -14,6 +14,7 @@ " 2024 Aug 05 by Vim Project: clean-up and make it work with shellslash on Windows " 2024 Aug 18 by Vim Project: correctly handle special globbing chars " 2024 Aug 21 by Vim Project: simplify condition to detect MS-Windows +" 2025 Mar 11 by Vim Project: handle filenames with leading '-' correctly " License: Vim License (see vim's :help license) " Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, @@ -343,6 +344,11 @@ fun! zip#Extract() return endif let target = fname->substitute('\[', '[[]', 'g') + " unzip 6.0 does not support -- to denote end-of-arguments + " unzip 6.1 (2010) apparently supports, it, but hasn't been released + " so the workaround is to use glob '[-]' so that it won't be considered an argument + " else, it would be possible to use 'unzip -o '-d/tmp' to extract the whole archive + let target = target->substitute('^-', '[&]', '') if &shell =~ 'cmd' && has("win32") let target = target \ ->substitute('[?*]', '[&]', 'g') diff --git a/runtime/compiler/context.vim b/runtime/compiler/context.vim index 093943e2..c3780d46 100644 --- a/runtime/compiler/context.vim +++ b/runtime/compiler/context.vim @@ -6,6 +6,7 @@ vim9script # Contributors: Enno Nagel # Last Change: 2024 Mar 29 # 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) +# 2025 Mar 11 by The Vim Project (add comment for Dispatch) if exists("g:current_compiler") finish @@ -15,6 +16,7 @@ import autoload '../autoload/context.vim' g:current_compiler = 'context' +# CompilerSet makeprg=context if get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) || (!filereadable('Makefile') && !filereadable('makefile')) var makeprg = join(context.ConTeXtCmd(shellescape(expand('%:p:t'))), ' ') diff --git a/runtime/compiler/gleam_build.vim b/runtime/compiler/gleam_build.vim new file mode 100644 index 00000000..c2b1679b --- /dev/null +++ b/runtime/compiler/gleam_build.vim @@ -0,0 +1,25 @@ +" Vim compiler file +" Language: Gleam +" Maintainer: Kirill Morozov +" Based On: https://github.com/gleam-lang/gleam.vim +" Last Change: 2025 Apr 21 + +if exists('current_compiler') + finish +endif +let current_compiler = "gleam_build" + +CompilerSet makeprg=gleam\ build + +" Example error message: +" +" error: Unknown variable +" ┌─ /home/michael/root/projects/tutorials/gleam/try/code/src/main.gleam:19:18 +" │ +" 19 │ Ok(tuple(name, spot)) +" │ ^^^^ did you mean `sport`? +" +" The name `spot` is not in scope here. +CompilerSet errorformat=%Eerror:\ %m,%Wwarning:\ %m,%C\ %#┌─%#\ %f:%l:%c\ %#-%# + +" vim: sw=2 sts=2 et diff --git a/runtime/compiler/javac.vim b/runtime/compiler/javac.vim index 53cd772e..d4f24cd2 100644 --- a/runtime/compiler/javac.vim +++ b/runtime/compiler/javac.vim @@ -2,6 +2,7 @@ " Compiler: Java Development Kit Compiler " Maintainer: Doug Kearns " Last Change: 2024 Nov 19 (enable local javac_makeprg_params) +" 2025 Mar 11 (add comment for Dispatch) if exists("current_compiler") finish @@ -11,6 +12,7 @@ let current_compiler = "javac" let s:cpo_save = &cpo set cpo&vim +" CompilerSet makeprg=javac execute $'CompilerSet makeprg=javac\ {escape(get(b:, 'javac_makeprg_params', get(g:, 'javac_makeprg_params', '')), ' \|"')}' CompilerSet errorformat=%E%f:%l:\ error:\ %m, diff --git a/runtime/compiler/powershell.vim b/runtime/compiler/powershell.vim index 3d37d7c8..d5dd6920 100644 --- a/runtime/compiler/powershell.vim +++ b/runtime/compiler/powershell.vim @@ -6,6 +6,7 @@ " 2024 Apr 03 by the Vim Project (removed :CompilerSet definition) " 2024 Apr 05 by the Vim Project (avoid leaving behind g:makeprg) " 2024 Nov 19 by the Vim Project (properly escape makeprg setting) +" 2025 Mar 11 by the Vim Project (add comment for Dispatch) if exists("current_compiler") finish @@ -50,6 +51,8 @@ let s:makeprg = g:ps1_makeprg_cmd .. ' %:p:S' " + CategoryInfo : ObjectNotFound: (Write-Ouput:String) [], CommandNotFoundException " + FullyQualifiedErrorId : CommandNotFoundException +" CompilerSet makeprg=pwsh +" CompilerSet makeprg=powershell execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' \|"') " Showing error in context with underlining. diff --git a/runtime/compiler/svelte-check.vim b/runtime/compiler/svelte-check.vim new file mode 100644 index 00000000..bfffe281 --- /dev/null +++ b/runtime/compiler/svelte-check.vim @@ -0,0 +1,21 @@ +" Vim compiler file +" Compiler: svelte-check +" Maintainer: @Konfekt +" Last Change: 2025 Feb 27 + +if exists("current_compiler") | finish | endif +let current_compiler = "svelte-check" + +CompilerSet makeprg=npx\ svelte-check\ --output\ machine +CompilerSet errorformat=%*\\d\ %t%*\\a\ \"%f\"\ %l:%c\ \"%m\", +CompilerSet errorformat+=%-G%*\\d\ START\ %.%#, +CompilerSet errorformat+=%-G%*\\d\ COMPLETED\ %.%#, +CompilerSet errorformat+=%-G%.%# + +" " Fall-back for versions of svelte-check that don't support --output machine +" " before May 2020 https://github.com/sveltejs/language-tools/commit/9f7a90379d287a41621a5e78af5b010a8ab810c3 +" " which is before the first production release 1.1.31 of Svelte-Check +" CompilerSet makeprg=npx\ svelte-check +" CompilerSet errorformat=%A%f:%l:%c, +" CompilerSet errorformat+=%C%t%*\\a\\:\ %m, +" CompilerSet errorformat+=%-G%.%#, diff --git a/runtime/compiler/tex.vim b/runtime/compiler/tex.vim index bc162372..529f7f77 100644 --- a/runtime/compiler/tex.vim +++ b/runtime/compiler/tex.vim @@ -6,6 +6,7 @@ " 2024 Apr 03 by the Vim Project (removed :CompilerSet definition) " 2024 Apr 05 by the Vim Project (avoid leaving behind g:makeprg) " 2024 Nov 19 by the Vim Project (properly escape makeprg setting) +" 2025 Mar 11 by the Vim Project (add comment for Dispatch) if exists("current_compiler") finish @@ -28,6 +29,7 @@ if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') || let current_compiler = "latex" endif let s:makeprg=current_compiler .. ' -interaction=nonstopmode' + " CompilerSet makeprg=latex execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' \|"') else let current_compiler = 'make' diff --git a/runtime/compiler/tsc.vim b/runtime/compiler/tsc.vim index 76f525ba..9922cd7d 100644 --- a/runtime/compiler/tsc.vim +++ b/runtime/compiler/tsc.vim @@ -2,6 +2,7 @@ " Compiler: TypeScript Compiler " Maintainer: Doug Kearns " Last Change: 2024 Apr 03 +" 2025 Mar 11 by The Vim Project (add comment for Dispatch, add tsc_makeprg variable) if exists("current_compiler") finish @@ -11,9 +12,9 @@ let current_compiler = "tsc" let s:cpo_save = &cpo set cpo&vim +" CompilerSet makeprg=tsc " CompilerSet makeprg=npx\ tsc - -CompilerSet makeprg=tsc +execute $'CompilerSet makeprg={escape(get(b:, 'tsc_makeprg', get(g:, 'tsc_makeprg', 'tsc')), ' \|"')}' CompilerSet errorformat=%f\ %#(%l\\,%c):\ %trror\ TS%n:\ %m, \%trror\ TS%n:\ %m, \%-G%.%# diff --git a/runtime/compiler/typst.vim b/runtime/compiler/typst.vim index 13699f46..b7e5ff55 100644 --- a/runtime/compiler/typst.vim +++ b/runtime/compiler/typst.vim @@ -2,8 +2,9 @@ " Language: Typst " Previous Maintainer: Gregory Anders " Maintainer: Luca Saccarola +" Based On: https://github.com/kaarmu/typst.vim " Last Change: 2024 Dec 09 -" Based on: https://github.com/kaarmu/typst.vim +" 2025 Mar 11 by the Vim Project (add comment for Dispatch) if exists('current_compiler') finish @@ -13,4 +14,5 @@ let current_compiler = get(g:, 'typst_cmd', 'typst') " With `--diagnostic-format` we can use the default errorformat let s:makeprg = [current_compiler, 'compile', '--diagnostic-format', 'short', '%:S'] +" CompilerSet makeprg=typst execute 'CompilerSet makeprg=' . join(s:makeprg, '\ ') diff --git a/runtime/defaults.vim b/runtime/defaults.vim index 38b03da1..f5b4888a 100644 --- a/runtime/defaults.vim +++ b/runtime/defaults.vim @@ -107,6 +107,7 @@ if 1 \ let line = line("'\"") \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit' \ && index(['xxd', 'gitrebase', 'tutor'], &filetype) == -1 + \ && !&diff \ | execute "normal! g`\"" \ | endif diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile index 82b56808..01b2c3e8 100644 --- a/runtime/doc/Makefile +++ b/runtime/doc/Makefile @@ -141,6 +141,11 @@ os_risc.txt: os_win32.txt: touch $@ +pi_netrw.txt: ../pack/dist/opt/netrw/doc/netrw.txt + cp ../pack/dist/opt/netrw/doc/netrw.txt $@.tmp + sed -e '1s/$$/ *pi_netrw.txt*/' $@.tmp > $@ && \ + rm -f $@.tmp + vietnamese.txt: touch $@ diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index a8f1b8b1..204a9117 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 9.1. Last change: 2025 Feb 08 +*autocmd.txt* For Vim version 9.1. Last change: 2025 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -387,6 +387,7 @@ Name triggered by ~ |TabNew| after creating a new tab page |WinClosed| after closing a window |TabClosed| after closing a tab page +|TabClosedPre| before closing a tab page |WinEnter| after entering another window |WinLeave| before leaving a window |TabEnter| after entering another tab page @@ -397,6 +398,7 @@ Name triggered by ~ |CmdlineChanged| after a change was made to the command-line text |CmdlineEnter| after the cursor moves to the command line |CmdlineLeave| before the cursor leaves the command line +|CmdlineLeavePre| before preparing to leave the command line |InsertEnter| starting Insert mode |InsertChange| when typing while in Insert or Replace mode @@ -592,7 +594,8 @@ BufWriteCmd Before writing the whole buffer to a file. The buffer contents should not be changed. When the command resets 'modified' the undo information is adjusted to mark older undo - states as 'modified', like |:write| does. + states as 'modified', like |:write| does. Use + the |'[| and |']| marks for the range of lines. |Cmd-event| *BufWritePost* BufWritePost After writing the whole buffer to a file @@ -603,6 +606,8 @@ CmdUndefined When a user command is used but it isn't when it's used. The pattern is matched against the command name. Both and are set to the name of the command. + This is triggered even when inside an + autocommand defined without |autocmd-nested|. NOTE: Autocompletion won't work until the command is defined. An alternative is to always define the user command and have it @@ -635,6 +640,18 @@ CmdlineLeave Before leaving the command line; including is set to a single character, indicating the type of command-line. |cmdwin-char| + *CmdlineLeavePre* +CmdlineLeavePre Just before leaving the command line, and + before |CmdlineLeave|. Useful for capturing + completion info with |cmdcomplete_info()|, as + this information is cleared before + |CmdlineLeave| is triggered. Triggered for + non-interactive use of ":" in a mapping, but + not when using ||. Also triggered when + abandoning the command line by typing CTRL-C + or . is set to a single + character indicating the command-line type. + See |cmdwin-char| for details. *CmdwinEnter* CmdwinEnter After entering the command-line window. Useful for setting options specifically for @@ -883,14 +900,14 @@ FileType When the 'filetype' option has been set. The FileWriteCmd Before writing to a file, when not writing the whole buffer. Should do the writing to the file. Should not change the buffer. Use the - '[ and '] marks for the range of lines. + |'[| and |']| marks for the range of lines. |Cmd-event| *FileWritePost* FileWritePost After writing to a file, when not writing the whole buffer. *FileWritePre* FileWritePre Before writing to a file, when not writing the - whole buffer. Use the '[ and '] marks for the + whole buffer. Use the |'[| and |']| marks for the range of lines. *FilterReadPost* FilterReadPost After reading a file from a filter command. @@ -934,7 +951,9 @@ FuncUndefined When a user function is used but it isn't when it's used. The pattern is matched against the function name. Both and are set to the name of the function. - Not triggered when compiling a |Vim9| + This is triggered even when inside an + autocommand defined without |autocmd-nested|, + but not triggered when compiling a |Vim9| function. NOTE: When writing Vim scripts a better alternative is to use an autoloaded function. @@ -1228,6 +1247,10 @@ Syntax When the 'syntax' option has been set. The See |:syn-on|. *TabClosed* TabClosed After closing a tab page. + *TabClosedPre* +TabClosedPre Before closing a tab page. The window layout + is locked, thus opening and closing of windows + is prohibited. *TabEnter* TabEnter Just after entering a tab page. |tab-page| After triggering the WinEnter and before @@ -1342,6 +1365,10 @@ TextYankPost After text has been yanked or deleted in the called recursively. It is not allowed to change the buffer text, see |textlock|. *E1064* + Also triggered indirectly when Vim tries to + become owner of the Visual selection because + of setting "autoselect" for 'guioptions' or + 'clipboard'. {only when compiled with the +eval feature} *User* @@ -1467,6 +1494,13 @@ WinScrolled After any window in the current tab page or changed width or height. See |win-scrolled-resized|. + Note: This can not be skipped with + `:noautocmd`, because it triggers after + processing normal commands when Vim is back in + the main loop. If you want to disable this, + consider setting the 'eventignore' option + instead. + The pattern is matched against the |window-ID| of the first window that scrolled or resized. Both and are set to the diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index e2d2f43b..b9d0719a 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Feb 06 +*builtin.txt* For Vim version 9.1. Last change: 2025 May 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -129,11 +129,14 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]]) chdir({dir}) String change current working directory cindent({lnum}) Number C indent for line {lnum} clearmatches([{win}]) none clear all matches +cmdcomplete_info() Dict get current cmdline completion + information col({expr} [, {winid}]) Number column byte index of cursor or mark complete({startcol}, {matches}) none set Insert mode completion complete_add({expr}) Number add completion match complete_check() Number check for key typed during completion complete_info([{what}]) Dict get current completion information +complete_match([{lnum}, {col}]) List get completion column and trigger text confirm({msg} [, {choices} [, {default} [, {type}]]]) Number number of choice picked by user copy({expr}) any make a shallow copy of {expr} @@ -191,9 +194,8 @@ filter({expr1}, {expr2}) List/Dict/Blob/String remove items from {expr1} where {expr2} is 0 finddir({name} [, {path} [, {count}]]) - String find directory {name} in {path} findfile({name} [, {path} [, {count}]]) - String find file {name} in {path} + String/List find dir/file {name} in {path} flatten({list} [, {maxdepth}]) List flatten {list} up to {maxdepth} levels flattennew({list} [, {maxdepth}]) List flatten a copy of {list} @@ -207,7 +209,7 @@ foldclosedend({lnum}) Number last line of fold at {lnum} if closed foldlevel({lnum}) Number fold level at {lnum} foldtext() String line displayed for closed fold foldtextresult({lnum}) String text for closed fold at {lnum} -foreach({expr1}, {expr2}) List/Dict/Blob/String +foreach({expr1}, {expr2}) List/Tuple/Dict/Blob/String for each item in {expr1} call {expr2} foreground() Number bring the Vim window to the foreground fullcommand({name} [, {vim9}]) String get full command from {name} @@ -348,7 +350,7 @@ job_start({command} [, {options}]) Job start a job job_status({job}) String get the status of {job} job_stop({job} [, {how}]) Number stop {job} -join({list} [, {sep}]) String join {list} items into one String +join({expr} [, {sep}]) String join items in {expr} into one String js_decode({string}) any decode JS style JSON js_encode({expr}) String encode JS style JSON json_decode({string}) any decode JSON @@ -364,6 +366,7 @@ line2byte({lnum}) Number byte count of line {lnum} lispindent({lnum}) Number Lisp indent for line {lnum} list2blob({list}) Blob turn {list} of numbers into a Blob list2str({list} [, {utf8}]) String turn {list} of numbers into a String +list2tuple({list}) Tuple turn {list} of items into a tuple listener_add({callback} [, {buf}]) Number add a callback to listen to changes listener_flush([{buf}]) none invoke listener callbacks @@ -511,10 +514,10 @@ remove({blob}, {idx} [, {end}]) Number/Blob remove bytes {idx}-{end} from {blob} remove({dict}, {key}) any remove entry {key} from {dict} rename({from}, {to}) Number rename (move) file from {from} to {to} -repeat({expr}, {count}) List/Blob/String +repeat({expr}, {count}) List/Tuple/Blob/String repeat {expr} {count} times resolve({filename}) String get filename a shortcut points to -reverse({obj}) List/Blob/String +reverse({obj}) List/Tuple/Blob/String reverse {obj} round({expr}) Float round off {expr} rubyeval({expr}) any evaluate |Ruby| expression @@ -713,6 +716,7 @@ test_null_job() Job null value for testing test_null_list() List null value for testing test_null_partial() Funcref null value for testing test_null_string() String null value for testing +test_null_tuple() Tuple null value for testing test_option_not_set({name}) none reset flag indicating option was set test_override({expr}, {val}) none test with Vim internal overrides test_refcount({expr}) Number get the reference count of {expr} @@ -734,6 +738,7 @@ tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr} trim({text} [, {mask} [, {dir}]]) String trim characters in {mask} from {text} trunc({expr}) Float truncate Float {expr} +tuple2list({tuple}) List turn {tuple} of items into a list type({expr}) Number type of value {expr} typename({expr}) String representation of the type of {expr} undofile({name}) String undo file name for {name} @@ -1309,19 +1314,25 @@ blob2str({blob} [, {options}]) *blob2str()* items: encoding Decode the bytes in {blob} using this encoding. The value is a |String|. See - |encoding-names| for the supported values. - *E1515* - An error is given and an empty List is returned if - an invalid byte sequence is encountered in {blob}, + |encoding-names| for the supported values + (plus the special value "none"). + *E1515* *E1516* + When current 'encoding' is "utf-8", an error is given and an + empty List is returned if an invalid byte sequence is + encountered in {blob}. To suppress this validation and get + potentially invalid string, set "encoding" in {options} to + "none". Returns an empty List if blob is empty. See also |str2blob()| Examples: > - blob2str(0z6162) returns ["ab"] - blob2str(0zC2ABC2BB) returns ["«»"] - blob2str(0zABBB, {'encoding': 'latin1'}) returns ["«»"] + blob2str(0z6162) returns ['ab'] + blob2str(0zC2ABC2BB) returns ['«»'] + blob2str(0z610A62) returns ['a', 'b'] + blob2str(0z610062) returns ['a\nb'] + blob2str(0zABBB, {'encoding': 'latin1'}) returns ['«»'] < Can also be used as a |method|: > GetBlob()->blob2str() @@ -1823,6 +1834,29 @@ clearmatches([{win}]) *clearmatches()* Return type: |Number| +cmdcomplete_info() *cmdcomplete_info()* + Returns a |Dictionary| with information about cmdline + completion. See |cmdline-completion|. + The items are: + cmdline_orig The original command-line string before + completion began. + pum_visible |TRUE| if popup menu is visible. + See |pumvisible()|. + matches List of all completion candidates. Each item + is a string. + selected Selected item index. First index is zero. + Index is -1 if no item is selected (showing + typed text only, or the last completion after + no item is selected when using the or + keys) + + Returns an empty |Dictionary| if no completion was attempted, + if there was only one candidate and it was fully completed, or + if an error occurred. + + Return type: dict + + col({expr} [, {winid}]) *col()* The result is a Number, which is the byte index of the column position given with {expr}. @@ -1998,6 +2032,50 @@ complete_info([{what}]) *complete_info()* < Return type: dict +complete_match([{lnum}, {col}]) *complete_match()* + Searches backward from the given position and returns a List + of matches according to the 'isexpand' option. When no + arguments are provided, uses the current cursor position. + + Each match is represented as a List containing + [startcol, trigger_text] where: + - startcol: column position where completion should start, + or -1 if no trigger position is found. For multi-character + triggers, returns the column of the first character. + - trigger_text: the matching trigger string from 'isexpand', + or empty string if no match was found or when using the + default 'iskeyword' pattern. + + When 'isexpand' is empty, uses the 'iskeyword' pattern + "\k\+$" to find the start of the current keyword. + + Examples: > + set isexpand=.,->,/,/*,abc + func CustomComplete() + let res = complete_match() + if res->len() == 0 | return | endif + let [col, trigger] = res[0] + let items = [] + if trigger == '/*' + let items = ['/** */'] + elseif trigger == '/' + let items = ['/*! */', '// TODO:', '// fixme:'] + elseif trigger == '.' + let items = ['length()'] + elseif trigger =~ '^\->' + let items = ['map()', 'reduce()'] + elseif trigger =~ '^\abc' + let items = ['def', 'ghk'] + endif + if items->len() > 0 + let startcol = trigger =~ '^/' ? col : col + len(trigger) + call complete(startcol, items) + endif + endfunc + inoremap call CustomComplete() +< + Return type: list> + *confirm()* confirm({msg} [, {choices} [, {default} [, {type}]]]) confirm() offers the user a dialog, from which a choice can be @@ -2067,7 +2145,8 @@ copy({expr}) *copy()* that the original |List| can be changed without changing the copy, and vice versa. But the items are identical, thus changing an item changes the contents of both |Lists|. - A |Dictionary| is copied in a similar way as a |List|. + A |Tuple| or |Dictionary| is copied in a similar way as a + |List|. Also see |deepcopy()|. Can also be used as a |method|: > mylist->copy() @@ -2110,10 +2189,10 @@ cosh({expr}) *cosh()* count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706* Return the number of times an item with value {expr} appears - in |String|, |List| or |Dictionary| {comp}. + in |String|, |List|, |Tuple| or |Dictionary| {comp}. If {start} is given then start with the item with this index. - {start} can only be used with a |List|. + {start} can only be used with a |List| or a |Tuple|. When {ic} is given and it's |TRUE| then case is ignored. @@ -2233,7 +2312,8 @@ deepcopy({expr} [, {noref}]) *deepcopy()* *E698* |Dictionary|, a copy for it is made, recursively. Thus changing an item in the copy does not change the contents of the original |List|. - A |Dictionary| is copied in a similar way as a |List|. + A |Tuple| or |Dictionary| is copied in a similar way as a + |List|. When {noref} is omitted or zero a contained |List| or |Dictionary| is only copied once. All references point to @@ -2541,8 +2621,8 @@ echoraw({string}) *echoraw()* empty({expr}) *empty()* Return the Number 1 if {expr} is empty, zero otherwise. - - A |List| or |Dictionary| is empty when it does not have any - items. + - A |List|, |Tuple| or |Dictionary| is empty when it does + not have any items. - A |String| is empty when its length is zero. - A |Number| and |Float| are empty when their value is zero. - |v:false|, |v:none| and |v:null| are empty, |v:true| is not. @@ -3006,7 +3086,8 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()* When {expr3} is omitted then "force" is assumed. {expr1} is changed when {expr2} is not empty. If necessary - make a copy of {expr1} first. + make a copy of {expr1} first or use |extendnew()| to return a + new List/Dictionary. {expr2} remains unchanged. When {expr1} is locked and {expr2} is not empty the operation fails. @@ -3085,7 +3166,7 @@ feedkeys({string} [, {mode}]) *feedkeys()* Can also be used as a |method|: > GetInput()->feedkeys() < - Return type: |String| or list depending on {list} + Return type: |Number| filecopy({from}, {to}) *filecopy()* @@ -3223,7 +3304,8 @@ finddir({name} [, {path} [, {count}]]) *finddir()* Can also be used as a |method|: > GetName()->finddir() < - Return type: |String| + Return type: list if {count} is negative, |String| + otherwise findfile({name} [, {path} [, {count}]]) *findfile()* @@ -3237,7 +3319,8 @@ findfile({name} [, {path} [, {count}]]) *findfile()* Can also be used as a |method|: > GetName()->findfile() < - Return type: |String| + Return type: list if {count} is negative, |String| + otherwise flatten({list} [, {maxdepth}]) *flatten()* @@ -3468,8 +3551,9 @@ foldtextresult({lnum}) *foldtextresult()* Return type: |String| -foreach({expr1}, {expr2}) *foreach()* - {expr1} must be a |List|, |String|, |Blob| or |Dictionary|. +foreach({expr1}, {expr2}) *foreach()* *E1525* + {expr1} must be a |List|, |Tuple|, |String|, |Blob| or + |Dictionary|. For each item in {expr1} execute {expr2}. {expr1} is not modified; its values may be, as with |:lockvar| 1. |E741| See |map()| and |filter()| to modify {expr1}. @@ -3478,10 +3562,10 @@ foreach({expr1}, {expr2}) *foreach()* If {expr2} is a |string|, inside {expr2} |v:val| has the value of the current item. For a |Dictionary| |v:key| has the key - of the current item and for a |List| |v:key| has the index of - the current item. For a |Blob| |v:key| has the index of the - current byte. For a |String| |v:key| has the index of the - current character. + of the current item and for a |List| or a |Tuple| |v:key| has + the index of the current item. For a |Blob| |v:key| has the + index of the current byte. For a |String| |v:key| has the + index of the current character. Examples: > call foreach(mylist, 'used[v:val] = true') < This records the items that are in the {expr1} list. @@ -3507,8 +3591,8 @@ foreach({expr1}, {expr2}) *foreach()* Can also be used as a |method|: > mylist->foreach(expr2) < - Return type: |String|, |Blob| list<{type}> or dict<{type}> - depending on {expr1} + Return type: |String|, |Blob|, list<{type}>, tuple<{type}> or + dict<{type}> depending on {expr1} *foreground()* foreground() Move the Vim window to the foreground. Useful when sent from @@ -3681,6 +3765,15 @@ get({list}, {idx} [, {default}]) *get()* *get()-list* < Return type: any, depending on {list} +get({tuple}, {idx} [, {default}]) *get()-tuple* + Get item {idx} from |Tuple| {tuple}. When this item is not + available return {default}. Return zero when {default} is + omitted. + Preferably used as a |method|: > + mytuple->get(idx) +< + Return type: any, depending on {tuple} + get({blob}, {idx} [, {default}]) *get()-blob* Get byte {idx} from |Blob| {blob}. When this byte is not available return {default}. Return -1 when {default} is @@ -4221,6 +4314,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* file file and directory names file_in_path file and directory names in |'path'| filetype filetype names |'filetype'| + filetypecmd |:filetype| suboptions function function name help help subjects highlight highlight groups @@ -4867,7 +4961,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()* Can also be used as a |method|: > GetRegname()->getreg() < - Return type: |String| + Return type: |String| or list depending on {list} getreginfo([{regname}]) *getreginfo()* @@ -4993,6 +5087,8 @@ getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()* Can also be used as a |method|: > getpos('.')->getregionpos(getpos("'a")) < + For an example, see the highlight-yank plugin |52.6| + Return type: list>> @@ -5812,8 +5908,8 @@ id({item}) *id()* < prevents {item} from being garbage collected and provides a way to get the {item} from the `id`. - {item} may be a List, Dictionary, Object, Job, Channel or - Blob. If the item is not a permitted type, or it is a null + {item} may be a List, Tuple, Dictionary, Object, Job, Channel + or Blob. If the item is not a permitted type, or it is a null value, then an empty String is returned. Can also be used as a |method|: > @@ -5840,12 +5936,12 @@ index({object}, {expr} [, {start} [, {ic}]]) *index()* Find {expr} in {object} and return its index. See |indexof()| for using a lambda to select the item. - If {object} is a |List| return the lowest index where the item - has a value equal to {expr}. There is no automatic - conversion, so the String "4" is different from the Number 4. - And the number 4 is different from the Float 4.0. The value - of 'ignorecase' is not used here, case matters as indicated by - the {ic} argument. + If {object} is a |List| or a |Tuple| return the lowest index + where the item has a value equal to {expr}. There is no + automatic conversion, so the String "4" is different from the + Number 4. And the number 4 is different from the Float 4.0. + The value of 'ignorecase' is not used here, case matters as + indicated by the {ic} argument. If {object} is |Blob| return the lowest index where the byte value is equal to {expr}. @@ -5869,11 +5965,11 @@ index({object}, {expr} [, {start} [, {ic}]]) *index()* indexof({object}, {expr} [, {opts}]) *indexof()* Returns the index of an item in {object} where {expr} is - v:true. {object} must be a |List| or a |Blob|. + v:true. {object} must be a |List|, a |Tuple| or a |Blob|. - If {object} is a |List|, evaluate {expr} for each item in the - List until the expression is v:true and return the index of - this item. + If {object} is a |List| or a |Tuple|, evaluate {expr} for each + item in the List or Tuple until the expression is v:true + and return the index of this item. If {object} is a |Blob| evaluate {expr} for each byte in the Blob until the expression is v:true and return the index of @@ -5881,11 +5977,11 @@ indexof({object}, {expr} [, {opts}]) *indexof()* {expr} must be a |string| or |Funcref|. - If {expr} is a |string|: If {object} is a |List|, inside - {expr} |v:key| has the index of the current List item and - |v:val| has the value of the item. If {object} is a |Blob|, - inside {expr} |v:key| has the index of the current byte and - |v:val| has the byte value. + If {expr} is a |string|: If {object} is a |List| or a |Tuple|, + inside {expr} |v:key| has the index of the current List or + Tuple item and |v:val| has the value of the item. If {object} + is a |Blob|, inside {expr} |v:key| has the index of the + current byte and |v:val| has the byte value. If {expr} is a |Funcref| it must take two arguments: 1. the key or the index of the current item. @@ -6195,9 +6291,9 @@ items({dict}) *items()* echo key .. ': ' .. value endfor < - A List or a String argument is also supported. In these - cases, items() returns a List with the index and the value at - the index. + A |List|, a |Tuple| or a |String| argument is also supported. + In these cases, items() returns a List with the index and the + value at the index. Can also be used as a |method|: > mydict->items() @@ -6208,16 +6304,17 @@ items({dict}) *items()* job_ functions are documented here: |job-functions-details| -join({list} [, {sep}]) *join()* - Join the items in {list} together into one String. +join({expr} [, {sep}]) *join()* + Join the items in {expr} together into one String. {expr} can + be a |List| or a |Tuple|. When {sep} is specified it is put in between the items. If {sep} is omitted a single space is used. Note that {sep} is not added at the end. You might want to add it there too: > let lines = join(mylist, "\n") .. "\n" -< String items are used as-is. |Lists| and |Dictionaries| are - converted into a string like with |string()|. - The opposite function is |split()|. +< String items are used as-is. |Lists|, |Tuples| and + |Dictionaries| are converted into a string like with + |string()|. The opposite function is |split()|. Can also be used as a |method|: > mylist->join() @@ -6311,6 +6408,8 @@ json_encode({expr}) *json_encode()* |Funcref| not possible, error |List| as an array (possibly null); when used recursively: [] + |Tuple| as an array (possibly null); when + used recursively: [] |Dict| as an object (possibly null); when used recursively: {} |Blob| as an array of the individual bytes @@ -6359,6 +6458,8 @@ len({expr}) *len()* *E701* used, as with |strlen()|. When {expr} is a |List| the number of items in the |List| is returned. + When {expr} is a |Tuple| the number of items in the |Tuple| is + returned. When {expr} is a |Blob| the number of bytes is returned. When {expr} is a |Dictionary| the number of entries in the |Dictionary| is returned. @@ -6540,6 +6641,25 @@ list2str({list} [, {utf8}]) *list2str()* Return type: |String| +list2tuple({list}) *list2tuple()* + Create a Tuple from a shallow copy of the list items. + Examples: > + list2tuple([1, 2, 3]) returns (1, 2, 3) +< |tuple2list()| does the opposite. + + This function doesn't recursively convert all the List items + in {list} to a Tuple. Note that the items are identical + between the list and the tuple, changing an item changes the + contents of both the tuple and the list. + + Returns an empty tuple on error. + + Can also be used as a |method|: > + GetList()->list2tuple() +< + Return type: tuple<{type}> (depending on the given |List|) + + listener_add({callback} [, {buf}]) *listener_add()* Add a callback function that will be invoked when changes have been made to buffer {buf}. @@ -7270,6 +7390,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* given sequence. limit Maximum number of matches in {list} to be returned. Zero means no limit. + camelcase Use enhanced camel case scoring making results + better suited for completion related to + programming languages. Defaults to v:true. If {list} is a list of dictionaries, then the optional {dict} argument supports the following additional items: @@ -7452,11 +7575,12 @@ max({expr}) *max()* Return the maximum value of all items in {expr}. Example: > echo max([apples, pears, oranges]) -< {expr} can be a |List| or a |Dictionary|. For a Dictionary, - it returns the maximum of all values in the Dictionary. - If {expr} is neither a List nor a Dictionary, or one of the - items in {expr} cannot be used as a Number this results in - an error. An empty |List| or |Dictionary| results in zero. +< {expr} can be a |List|, a |Tuple| or a |Dictionary|. For a + Dictionary, it returns the maximum of all values in the + Dictionary. If {expr} is neither a List nor a Tuple nor a + Dictionary, or one of the items in {expr} cannot be used as a + Number this results in an error. An empty |List|, |Tuple| + or |Dictionary| results in zero. Can also be used as a |method|: > mylist->max() @@ -7543,11 +7667,12 @@ min({expr}) *min()* Return the minimum value of all items in {expr}. Example: > echo min([apples, pears, oranges]) -< {expr} can be a |List| or a |Dictionary|. For a Dictionary, - it returns the minimum of all values in the Dictionary. - If {expr} is neither a List nor a Dictionary, or one of the - items in {expr} cannot be used as a Number this results in - an error. An empty |List| or |Dictionary| results in zero. +< {expr} can be a |List|, a |Tuple| or a |Dictionary|. For a + Dictionary, it returns the minimum of all values in the + Dictionary. If {expr} is neither a List nor a Tuple nor a + Dictionary, or one of the items in {expr} cannot be used as a + Number this results in an error. An empty |List|, |Tuple| or + |Dictionary| results in zero. Can also be used as a |method|: > mylist->min() @@ -7582,9 +7707,8 @@ mkdir({name} [, {flags} [, {prot}]]) *mkdir()* *E739* If {prot} is given it is used to set the protection bits of the new directory. The default is 0o755 (rwxr-xr-x: r/w for the user, readable for others). Use 0o700 to make it - unreadable for others. This is only used for the last part of - {name}. Thus if you create /tmp/foo/bar then /tmp/foo will be - created with 0o755. + unreadable for others. This is used for the newly created + directories. Note: umask is applied to {prot} (on Unix). Example: > :call mkdir($HOME .. "/tmp/foo/bar", "p", 0o700) @@ -8106,7 +8230,8 @@ printf({fmt}, {expr1} ...) *printf()* < 1.41 You will get an overflow error |E1510|, when the field-width - or precision will result in a string longer than 6400 chars. + or precision will result in a string longer than 1 MiB + (1024*1024 = 1048576) chars. *E1500* You cannot mix positional and non-positional arguments: > @@ -8284,13 +8409,14 @@ py3eval({expr} [, {locals}]) *py3eval()* converted to Vim data structures. If a {locals} |Dictionary| is given, it defines set of local variables available in the expression. The keys are variable - names and the values are the variable values. |Dictionary| and - |List| values are referenced, and may be updated by the - expression (as if |python-bindeval| was used). + names and the values are the variable values. |Dictionary|, + |List| and |Tuple| values are referenced, and may be updated + by the expression (as if |python-bindeval| was used). Numbers and strings are returned as they are (strings are copied though, Unicode strings are additionally converted to 'encoding'). Lists are represented as Vim |List| type. + Tuples are represented as Vim |Tuple| type. Dictionaries are represented as Vim |Dictionary| type with keys converted to strings. Note that in a `:def` function local variables are not visible @@ -8312,6 +8438,7 @@ pyeval({expr} [, {locals}]) *pyeval()* Numbers and strings are returned as they are (strings are copied though). Lists are represented as Vim |List| type. + Tuples are represented as Vim |Tuple| type. Dictionaries are represented as Vim |Dictionary| type, non-string keys result in error. Note that in a `:def` function local variables are not visible @@ -8571,8 +8698,8 @@ readfile({fname} [, {type} [, {max}]]) reduce({object}, {func} [, {initial}]) *reduce()* *E998* {func} is called for every item in {object}, which can be a - |String|, |List| or a |Blob|. {func} is called with two - arguments: the result so far and current item. After + |String|, |List|, |Tuple| or a |Blob|. {func} is called with + two arguments: the result so far and current item. After processing all items the result is returned. *E1132* {initial} is the initial result. When omitted, the first item @@ -8893,16 +9020,16 @@ repeat({expr}, {count}) *repeat()* result. Example: > :let separator = repeat('-', 80) < When {count} is zero or negative the result is empty. - When {expr} is a |List| or a |Blob| the result is {expr} - concatenated {count} times. Example: > + When {expr} is a |List|, a |Tuple| or a |Blob| the result is + {expr} concatenated {count} times. Example: > :let longlist = repeat(['a', 'b'], 3) < Results in ['a', 'b', 'a', 'b', 'a', 'b']. Can also be used as a |method|: > mylist->repeat(count) < - Return type: |String|, |Blob| or list<{type}> depending on - {expr} + Return type: |String|, |Blob|, list<{type}> or tuple<{type}> + depending on {expr} resolve({filename}) *resolve()* *E655* @@ -8929,18 +9056,19 @@ resolve({filename}) *resolve()* *E655* reverse({object}) *reverse()* Reverse the order of items in {object}. {object} can be a - |List|, a |Blob| or a |String|. For a List and a Blob the - items are reversed in-place and {object} is returned. + |List|, a |Tuple|, a |Blob| or a |String|. For a List and a + Blob the items are reversed in-place and {object} is returned. + For a Tuple, a new Tuple is returned. For a String a new String is returned. - Returns zero if {object} is not a List, Blob or a String. - If you want a List or Blob to remain unmodified make a copy - first: > + Returns zero if {object} is not a List, Tuple, Blob or a + String. If you want a List or Blob to remain unmodified make + a copy first: > :let revlist = reverse(copy(mylist)) < Can also be used as a |method|: > mylist->reverse() < - Return type: |String|, |Blob| or list<{type}> depending on - {object} + Return type: |String|, |Blob|, list<{type}> or tuple<{type}> + depending on {object} round({expr}) *round()* @@ -9699,6 +9827,7 @@ setcursorcharpos({list}) Can also be used as a |method|: > GetCursorPos()->setcursorcharpos() < + Returns 0 when the position could be set, -1 otherwise. Return type: |Number| @@ -10293,7 +10422,7 @@ slice({expr}, {start} [, {end}]) *slice()* Can also be used as a |method|: > GetList()->slice(offset) < - Return type: list<{type}> + Return type: list<{type}> or tuple<{type}> sort({list} [, {how} [, {dict}]]) *sort()* *E702* @@ -10644,7 +10773,8 @@ str2blob({list} [, {options}]) *str2blob()* The argument {options} is a |Dict| and supports the following items: - encoding Encode the characters using this encoding. + encoding Convert the characters using this encoding + before making the Blob. The value is a |String|. See |encoding-names| for the supported values. @@ -10656,11 +10786,12 @@ str2blob({list} [, {options}]) *str2blob()* See also |blob2str()| Examples: > - str2blob(["ab"]) returns 0z6162 - str2blob(["«»"]) returns 0zC2ABC2BB - str2blob(["a\nb"]) returns 0z610A62 - str2blob(readfile('myfile.txt')) + str2blob(["ab"]) returns 0z6162 + str2blob(["«»"]) returns 0zC2ABC2BB + str2blob(["a\nb"]) returns 0z610062 + str2blob(["a","b"]) returns 0z610A62 str2blob(["«»"], {'encoding': 'latin1'}) returns 0zABBB + str2blob(readfile('myfile.txt')) < Can also be used as a |method|: > GetListOfStrings()->str2blob() @@ -10903,15 +11034,16 @@ string({expr}) *string()* Funcref function('name') Blob 0z00112233.44556677.8899 List [item, item] + Tuple (item, item) Dictionary {key: value, key: value} Class class SomeName Object object of SomeName {lnum: 1, col: 3} Enum enum EnumName EnumValue enum name.value {name: str, ordinal: nr} - When a |List| or |Dictionary| has a recursive reference it is - replaced by "[...]" or "{...}". Using eval() on the result - will then fail. + When a |List|, |Tuple| or |Dictionary| has a recursive + reference it is replaced by "[...]" or "(...)" or "{...}". + Using eval() on the result will then fail. For an object, invokes the string() method to get a textual representation of the object. If the method is not present, @@ -11865,6 +11997,25 @@ trunc({expr}) *trunc()* Return type: |Float| +tuple2list({tuple}) *tuple2list()* + Create a List from a shallow copy of the tuple items. + Examples: > + tuple2list((1, 2, 3)) returns [1, 2, 3] +< |list2tuple()| does the opposite. + + This function doesn't recursively convert all the Tuple items + in {tuple} to a List. Note that the items are identical + between the list and the tuple, changing an item changes the + contents of both the tuple and the list. + + Returns an empty list on error. + + Can also be used as a |method|: > + GetTuple()->tuple2list() +< + Return type: list<{type}> (depending on the given |Tuple|) + + *type()* type({expr}) The result is a Number representing the type of {expr}. Instead of using the number directly, it is better to use the @@ -11885,6 +12036,7 @@ type({expr}) The result is a Number representing the type of {expr}. Typealias: 14 |v:t_typealias| Enum: 15 |v:t_enum| EnumValue: 16 |v:t_enumvalue| + Tuple: 17 |v:t_tuple| For backward compatibility, this method can be used: > :if type(myvar) == type(0) :if type(myvar) == type("") diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 301eacee..24137c74 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 9.1. Last change: 2024 Dec 15 +*change.txt* For Vim version 9.1. Last change: 2025 Apr 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -156,8 +156,8 @@ only after a '.'). The 'B' and 'M' flags in 'formatoptions' change the behavior for inserting spaces before and after a multibyte character |fo-table|. -The '[ mark is set at the end of the first line that was joined, '] at the end -of the resulting line. +The |'[| mark is set at the end of the first line that was joined, |']| at the +end of the resulting line. ============================================================================== @@ -1149,6 +1149,11 @@ inside of strings can change! Also see 'softtabstop' option. > :[line]pu[t]! [x] Put the text [from register x] before [line] (default current line). + *:ip* *:iput* +:[line]ip[ut] [x] like |:put|, but adjust indent to the current line + +:[line]ip[ut]! [x] like |:put|!, but adjust indent to the current line + ["x]]p or *]p* *]* ["x]] Like "p", but adjust the indent to the current line. Using the mouse only works when 'mouse' contains 'n' @@ -1183,8 +1188,8 @@ the ":put" command, Vim always inserts the text in the next line. You can exchange two characters with the command sequence "xp". You can exchange two lines with the command sequence "ddp". You can exchange two words with the command sequence "deep" (start with the cursor in the blank space before the -first word). You can use the "']" or "`]" command after the put command to -move the cursor to the end of the inserted text, or use "'[" or "`[" to move +first word). You can use the |']| or |`]| command after the put command to +move the cursor to the end of the inserted text, or use |'[| or |`[| to move the cursor to the start. *put-Visual-mode* *v_p* *v_P* diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index a50fc74e..93431f8f 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*cmdline.txt* For Vim version 9.1. Last change: 2025 Mar 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -88,6 +88,10 @@ CTRL-SHIFT-V *c_CTRL-SHIFT-V* *c_CTRL-SHIFT-Q* CTRL-SHIFT-Q Works just like CTRL-V, unless |modifyOtherKeys| is active, then it inserts the Escape sequence for a key with modifiers. In the GUI the |key-notation| is inserted without simplifying. + Note: When CTRL-SHIFT-V is intercepted by your system (e.g., + to paste text) you can often use CTRL-SHIFT-Q instead. + However, in some terminals (e.g. GNOME Terminal), CTRL-SHIFT-Q + quits the terminal without confirmation. *c_* *c_Left* cursor left. See 'wildmenu' for behavior during wildmenu diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index d97d230e..621e7f66 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -1,4 +1,4 @@ -*develop.txt* For Vim version 9.1. Last change: 2024 Dec 25 +*develop.txt* For Vim version 9.1. Last change: 2025 May 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -192,7 +192,7 @@ For any non-trivial change, please always create a pull request on github, since this triggers the test suite. *style-clang-format* -sound.c and sign.c can be (semi-) automatically formated using the +sound.c and sign.c can be (semi-) automatically formatted using the `clang-format` formatter according to the distributed .clang-format file. Other source files do not yet correspond to the .clang-format file. This may change in the future and they may be reformatted as well. @@ -215,7 +215,7 @@ them: - flexible array members: Not supported by HP-UX C compiler (John Marriott) -COMMENTS *style-comments* +COMMENTS *style-comments* Try to avoid putting multiline comments inside a function body: if the function is so complex that you need to separately comment parts of it, you @@ -230,8 +230,7 @@ For everything else use: > // comment < - -INDENTATION *style-indentation* +INDENTATION *style-indentation* We use 4 space to indent the code. If you are using Vim to edit the source, you don't need to do anything due to the |modeline|. @@ -239,7 +238,7 @@ you don't need to do anything due to the |modeline|. For other editors an `.editorconfig` is provided at the root of the repo. -DECLARATIONS *style-declarations* +DECLARATIONS *style-declarations* Declare, when possible, `for` loop variables in the guard: OK: > @@ -259,114 +258,76 @@ Wrong: > int *ptr; < - -BRACES *style-braces* +BRACES *style-braces* All curly braces must be returned onto a new line: OK: > if (cond) { - cmd; - cmd; + cmd; + cmd; } else { - cmd; - cmd; + cmd; + cmd; } < Wrong: > if (cond) { - cmd; - cmd; + cmd; + cmd; } else { - cmd; - cmd; + cmd; + cmd; } < OK: > while (cond) { cmd; + cmd; } < Wrong: > while (cond) { cmd; + cmd; } < -When a block has one line, including comments, the braces can be left out. OK: > - if (cond) - cmd; - else - cmd; -< -Wrong: > - if (cond) - /* - * comment - */ + do + { cmd; - else cmd; + } while (cond); < -When an `if`/`else` has braces on one block, the other should have it too. -OK: > - if (cond) - { - cmd; - } - else +or > + do { cmd; cmd; } + while (cond); < Wrong: > - if (cond) - cmd; - else - { - cmd; - cmd; - } - - if (cond) - { - cmd; - cmd; - } - else + do { cmd; -< -OK: > - while (cond) cmd; + } while (cond); < -Wrong: -> - while (cond) - if (cond) - cmd; -< - TYPES *style-types* -Use descriptive types. You can find a list of them in the src/structs.h file -and probably in a typedef in the file you are working on. - +Use descriptive types. These are defined in src/vim.h, src/structs.h etc. Note that all custom types are postfixed with "_T" -OK: > - int is_valid_line_number(linenr_T lnum); -< -Wrong: > - int is_valid_line_number(unsigned long lnum); +Example: > + linenr_T + buf_T + pos_T < - SPACES AND PUNCTUATION *style-spaces* No space between a function name and the bracket: @@ -386,8 +347,8 @@ Wrong: func(arg1,arg2); for (i = 0;i < 2;++i) Use a space before and after '=', '+', '/', etc. -Wrong: var=a*5; OK: var = a * 5; +Wrong: var=a*5; Use empty lines to group similar actions together. @@ -412,7 +373,6 @@ Wrong: > while (buf != NULL && !got_int) < - FUNCTIONS *style-functions* Use function declarations with the return type on a separate indented line. diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index e3abbdef..81564664 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -1,4 +1,4 @@ -*diff.txt* For Vim version 9.1. Last change: 2024 Feb 01 +*diff.txt* For Vim version 9.1. Last change: 2025 Mar 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -226,14 +226,28 @@ The diffs are highlighted with these groups: |hl-DiffAdd| DiffAdd Added (inserted) lines. These lines exist in this buffer but not in another. |hl-DiffChange| DiffChange Changed lines. -|hl-DiffText| DiffText Changed text inside a Changed line. Vim - finds the first character that is different, - and the last character that is different - (searching from the end of the line). The - text in between is highlighted. This means - that parts in the middle that are still the - same are highlighted anyway. The 'diffopt' - flags "iwhite" and "icase" are used here. +|hl-DiffText| DiffText Changed text inside a Changed line. Exact + behavior depends on the `inline:` setting in + 'diffopt'. + With `inline:` set to "simple", Vim finds the + first character that is different, and the + last character that is different (searching + from the end of the line). The text in + between is highlighted. This means that parts + in the middle that are still the same are + highlighted anyway. The 'diffopt' flags + "iwhite" and "icase" are used here. + With `inline:` set to "char" or "word", Vim + uses the internal diff library to perform a + detailed diff between the changed blocks and + highlight the exact difference between the + two. Will respect any 'diffopt' flag that + affects internal diff. + Not used when `inline:` is set to "none". +|hl-DiffTextAdd| DiffTextAdd Added text inside a Changed line. Similar to + DiffText, but used when there is no + corresponding text in other buffers. Not used + when `inline:` is set to "simple" or "none". |hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines, because they don't really exist in this buffer. diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index a70515d6..a88aad1a 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 9.1. Last change: 2024 Oct 14 +*editing.txt* For Vim version 9.1. Last change: 2025 Apr 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -974,8 +974,9 @@ Note: When the 'write' option is off, you are not able to write any file. executed like with ":!{cmd}", any '!' is replaced with the previous command |:!|. -The default [range] for the ":w" command is the whole buffer (1,$). If you -write the whole buffer, it is no longer considered changed. When you +The default [range] for the ":w" command is the whole buffer (1,$). The |'[| +and |']| marks will be set to the [range] being used for the write command. +If you write the whole buffer, it is no longer considered changed. When you write it to a different file with ":w somefile" it depends on the "+" flag in 'cpoptions'. When included, the write command will reset the 'modified' flag, even though the buffer itself may still be different from its file. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 0851aa5c..170d2d03 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 9.1. Last change: 2025 Jan 29 +*eval.txt* For Vim version 9.1. Last change: 2025 Apr 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -21,9 +21,10 @@ a remark is given. 1.1 Variable types 1.2 Function references |Funcref| 1.3 Lists |Lists| - 1.4 Dictionaries |Dictionaries| - 1.5 Blobs |Blobs| - 1.6 More about variables |more-variables| + 1.4 Tuples |Tuples| + 1.5 Dictionaries |Dictionaries| + 1.6 Blobs |Blobs| + 1.7 More about variables |more-variables| 2. Expression syntax |expression-syntax| 3. Internal variable |internal-variables| 4. Builtin Functions |functions| @@ -46,8 +47,8 @@ Profiling is documented at |profiling|. 1.1 Variable types ~ *E712* *E896* *E897* *E899* *E1098* - *E1107* *E1135* *E1138* -There are ten types of variables: + *E1107* *E1135* *E1138* *E1523* +There are eleven types of variables: *Number* *Integer* Number A 32 or 64 bit signed number. |expr-number| @@ -63,6 +64,10 @@ String A NUL terminated string of 8-bit unsigned characters (bytes). List An ordered sequence of items, see |List| for details. Example: [1, 2, ['a', 'b']] +Tuple An ordered immutable sequence of items, see |Tuple| for + details. + Example: (1, 2, ('a', 'b')) + Dictionary An associative, unordered array: Each entry has a key and a value. |Dictionary| Examples: @@ -165,16 +170,17 @@ A List, Dictionary or Float is not a Number or String, thus evaluate to FALSE. *E611* *E745* *E728* *E703* *E729* *E730* *E731* *E908* *E910* *E913* *E974* *E975* *E976* *E1319* *E1320* *E1321* *E1322* - *E1323* *E1324* -|List|, |Dictionary|, |Funcref|, |Job|, |Channel|, |Blob|, |Class| and -|object| types are not automatically converted. + *E1323* *E1324* *E1520* *E1522* +|List|, |Tuple|, |Dictionary|, |Funcref|, |Job|, |Channel|, |Blob|, |Class| +and |object| types are not automatically converted. *E805* *E806* *E808* When mixing Number and Float the Number is converted to Float. Otherwise there is no automatic conversion of Float. You can use str2float() for String to Float, printf() for Float to String and float2nr() for Float to Number. - *E362* *E891* *E892* *E893* *E894* *E907* *E911* *E914* + *E362* *E891* *E892* *E893* *E894* + *E907* *E911* *E914* *E1521* When expecting a Float a Number can also be used, but nothing else. *no-type-checking* @@ -267,9 +273,9 @@ position in the sequence. List creation ~ *E696* *E697* -A List is created with a comma-separated list of items in square brackets. +A List is created with a comma-separated sequence of items in square brackets. Examples: > - :let mylist = [1, two, 3, "four"] + :let mylist = [1, "two", 3, "four"] :let emptylist = [] An item can be any expression. Using a List for an item creates a @@ -327,13 +333,13 @@ similar to -1. > :let otherlist = mylist[:] " make a copy of the List Notice that the last index is inclusive. If you prefer using an exclusive -index use the |slice()| method. +index use the |slice()| function. -If the first index is beyond the last item of the List or the second item is +If the first index is beyond the last item of the List or the last index is before the first item, the result is an empty list. There is no error message. -If the second index is equal to or greater than the length of the list the +If the last index is equal to or greater than the length of the list the length minus one is used: > :let mylist = [0, 1, 2, 3] :echo mylist[2:8] " result: [2, 3] @@ -463,8 +469,8 @@ Changing the order of items in a list: > For loop ~ -The |:for| loop executes commands for each item in a List, String or Blob. -A variable is set to each item in sequence. Example with a List: > +The |:for| loop executes commands for each item in a List, Tuple, String or +Blob. A variable is set to each item in sequence. Example with a List: > :for item in mylist : call Doit(item) :endfor @@ -497,6 +503,8 @@ It is also possible to put remaining items in a List variable: > : endif :endfor +For a Tuple one tuple item at a time is used. + For a Blob one byte at a time is used. For a String one character, including any composing characters, is used as a @@ -527,8 +535,216 @@ Don't forget that a combination of features can make things simple. For example, to add up all the numbers in a list: > :exe 'let sum = ' .. join(nrlist, '+') +1.4 Tuples ~ + *tuple* *Tuple* *Tuples* + *E1532* *E1533* +A Tuple is an ordered sequence of items. An item can be of any type. Items +can be accessed by their index number. A Tuple is immutable. + +A Tuple is similar to a List but uses less memory and provides O(1) lookup +time for an item. + +Tuple creation ~ + *E1526* *E1527* +A Tuple is created with a comma-separated sequence of items in parentheses. +Examples: > + :let mytuple = (1, "two", 3, "four") + :let tuple = (5,) + :let emptytuple = () + +An item can be any expression. If there is only one item in the tuple, then +the item must be followed by a comma. + +Using a Tuple for an item creates a Tuple of Tuples: > + :let nesttuple = ((11, 12), (21, 22), (31, 32)) + + +Tuple index ~ + *tuple-index* *E1519* +An item in the Tuple can be accessed by putting the index in square brackets +after the Tuple. Indexes are zero-based, thus the first item has index zero. +> + :let item = mytuple[0] " get the first item: 1 + :let item = mytuple[2] " get the third item: 3 + +When the resulting item is a tuple this can be repeated: > + :let item = nesttuple[0][1] " get the first tuple, second item: 12 +< +A negative index is counted from the end. Index -1 refers to the last item in +the Tuple, -2 to the last but one item, etc. > + :let last = mytuple[-1] " get the last item: "four" + +To avoid an error for an invalid index use the |get()| function. When an item +is not available it returns zero or the default value you specify: > + :echo get(mytuple, idx) + :echo get(mytuple, idx, "NONE") + + +Tuple modification ~ + *tuple-modification* +A tuple is immutable and items cannot be added or removed from a tuple. But +List and Dict items within a tuple can be modified: > + :let tuple = (1, [2, 3], {'a': 4}) + :let tuple[1][0] = 10 + :let tuple[2]['a'] = 20 + + +Tuple concatenation ~ + *tuple-concatenation* +Two tuples can be concatenated with the "+" operator: > + :let longtuple = mytuple + (5, 6) + :let longtuple = (5, 6) + mytuple +To prepend or append an item, turn it into a tuple by putting () around it. +The item must be followed by a comma. + + *E1540* +Two variadic tuples with same item type can be concatenated but with different +item types cannot be concatenated. Examples: > + var a: tuple<...list> = (1, 2) + var b: tuple<...list> = ('a', 'b') + echo a + b # not allowed + + var a: tuple = (1, 2) + var b: tuple<...list> = ('a', 'b') + echo a + b # allowed + + var a: tuple<...list> = (1, 2) + var b: tuple = (3, 4) + echo a + b # not allowed + + var a: tuple<...list> = (1, 2) + var b: tuple> = (3, 4) + echo a + b # not allowed +< +Note that a tuple is immutable and items cannot be added or removed from a +tuple. + + +Subtuple ~ + *subtuple* +A part of the Tuple can be obtained by specifying the first and last index, +separated by a colon in square brackets: > + :let shorttuple = mytuple[2:-1] " get Tuple (3, "four") + +Omitting the first index is similar to zero. Omitting the last index is +similar to -1. > + :let endtuple = mytuple[2:] " from item 2 to the end: (3, "four") + :let shorttuple = mytuple[2:2] " Tuple with one item: (3,) + :let othertuple = mytuple[:] " make a copy of the Tuple + +Notice that the last index is inclusive. If you prefer using an exclusive +index, use the |slice()| function. + +If the first index is beyond the last item of the Tuple or the last index is +before the first item, the result is an empty tuple. There is no error +message. + +If the last index is equal to or greater than the length of the tuple, the +length minus one is used: > + :let mytuple = (0, 1, 2, 3) + :echo mytuple[2:8] " result: (2, 3) + +NOTE: mytuple[s:e] means using the variable "s:e" as index. Watch out for +using a single letter variable before the ":". Insert a space when needed: +mytuple[s : e]. + + +Tuple identity ~ + *tuple-identity* +When variable "aa" is a tuple and you assign it to another variable "bb", both +variables refer to the same tuple: > + :let aa = (1, 2, 3) + :let bb = aa +< + +Making a copy of a tuple is done with the |copy()| function. Using [:] also +works, as explained above. This creates a shallow copy of the tuple: For +example, changing a list item in the tuple will also change the item in the +copied tuple: > + :let aa = ([1, 'a'], 2, 3) + :let bb = copy(aa) + :let aa[0][1] = 'aaa' + :echo aa +< ([1, aaa], 2, 3) > + :echo bb +< ([1, aaa], 2, 3) + +To make a completely independent tuple, use |deepcopy()|. This also makes a +copy of the values in the tuple, recursively. Up to a hundred levels deep. + +The operator "is" can be used to check if two variables refer to the same +Tuple. "isnot" does the opposite. In contrast, "==" compares if two tuples +have the same value. > + :let atuple = (1, 2, 3) + :let btuple = (1, 2, 3) + :echo atuple is btuple +< 0 > + :echo atuple == btuple +< 1 + +Note about comparing tuples: Two tuples are considered equal if they have the +same length and all items compare equal, as with using "==". There is one +exception: When comparing a number with a string they are considered +different. There is no automatic type conversion, as with using "==" on +variables. Example: > + echo 4 == "4" +< 1 > + echo (4,) == ("4",) +< 0 + +Thus comparing Tuples is more strict than comparing numbers and strings. You +can compare simple values this way too by putting them in a tuple: > -1.4 Dictionaries ~ + :let a = 5 + :let b = "5" + :echo a == b +< 1 > + :echo (a,) == (b,) +< 0 + + +Tuple unpack ~ + +To unpack the items in a tuple to individual variables, put the variables in +square brackets, like list items: > + :let [var1, var2] = mytuple + +When the number of variables does not match the number of items in the tuple +this produces an error. To handle any extra items from the tuple, append ";" +and a variable name (which will then be of type tuple): > + :let [var1, var2; rest] = mytuple + +This works like: > + :let var1 = mytuple[0] + :let var2 = mytuple[1] + :let rest = mytuple[2:] + +Except that there is no error if there are only two items. "rest" will be an +empty tuple then. + + +Tuple functions ~ + *E1536* +Functions that are useful with a Tuple: > + :let xs = count(tuple, 'x') " count number of 'x's in tuple + :if empty(tuple) " check if tuple is empty + :let i = index(tuple, 'x') " index of first 'x' in tuple + :let l = items(tuple) " list of items in a tuple + :let string = join(tuple, ', ') " create string from tuple items + :let l = len(tuple) " number of items in tuple + :let big = max(tuple) " maximum value in tuple + :let small = min(tuple) " minimum value in tuple + :let r = repeat(tuple, n) " repeat a tuple n times + :let r = reverse(tuple) " reverse a tuple + :let s = slice(tuple, n1, n2) " slice a tuple + :let s = string(tuple) " String representation of tuple + :let l = tuple2list(tuple) " convert a tuple to list + :let t = list2tuple(list) " convert a list to tuple +< + *E1524* +A tuple cannot be used with the |map()|, |mapnew()| and |filter()| functions. + +1.5 Dictionaries ~ *dict* *Dict* *Dictionaries* *Dictionary* A Dictionary is an associative array: Each entry has a key and a value. The entry can be located with the key. The entries are stored without a specific @@ -537,10 +753,10 @@ ordering. Dictionary creation ~ *E720* *E721* *E722* *E723* -A Dictionary is created with a comma-separated list of entries in curly +A Dictionary is created with a comma-separated sequence of entries in curly braces. Each entry has a key and a value, separated by a colon. Each key can only appear once. Examples: > - :let mydict = {1: 'one', 2: 'two', 3: 'three'} + :let mydict = {'one': 1, 'two': 2, 'three': 3} :let emptydict = {} < *E713* *E716* *E717* A key is always a String. You can use a Number, it will be converted to a @@ -570,8 +786,11 @@ An extra comma after the last entry is ignored. Accessing entries ~ The normal way to access an entry is by putting the key in square brackets: > + :let mydict = {'one': 1, 'two': 2, 'three': 3} :let val = mydict["one"] :let mydict["four"] = 4 + :let val = mydict.one + :let mydict.four = 4 You can add new entries to an existing Dictionary this way, unlike Lists. @@ -709,7 +928,7 @@ Functions that can be used with a Dictionary: > :call map(dict, '">> " .. v:val') " prepend ">> " to each item -1.5 Blobs ~ +1.6 Blobs ~ *blob* *Blob* *Blobs* *E978* A Blob is a binary object. It can be used to read an image from a file and send it over a channel, for example. @@ -856,7 +1075,7 @@ Making a copy of a Blob is done with the |copy()| function. Using [:] also works, as explained above. -1.6 More about variables ~ +1.7 More about variables ~ *more-variables* If you need to know the type of a variable or expression, use the |type()| function. @@ -907,16 +1126,18 @@ Expression syntax summary, from least to most significant: etc. As above, append ? for ignoring case, # for matching case - expr5 is expr5 same |List|, |Dictionary| or |Blob| instance - expr5 isnot expr5 different |List|, |Dictionary| or |Blob| + expr5 is expr5 same |List|, |Tuple|, |Dictionary| or |Blob| instance + expr5 isnot expr5 different |List|, |Tuple|, |Dictionary| or + |Blob| instance |expr5| expr6 expr6 << expr6 bitwise left shift expr6 >> expr6 bitwise right shift |expr6| expr7 - expr7 + expr7 ... number addition, list or blob concatenation + expr7 + expr7 ... number addition, list or tuple or blob + concatenation expr7 - expr7 ... number subtraction expr7 . expr7 ... string concatenation expr7 .. expr7 ... string concatenation @@ -935,8 +1156,10 @@ Expression syntax summary, from least to most significant: + expr9 unary plus |expr10| expr11 - expr10[expr1] byte of a String or item of a |List| + expr10[expr1] byte of a String or item of a |List| or + |Tuple| expr10[expr1 : expr1] substring of a String or sublist of a |List| + or a slice of a |Tuple| expr10.name entry in a |Dictionary| expr10(expr1, ...) function call with |Funcref| variable expr10->name(expr1, ...) |method| call @@ -945,6 +1168,7 @@ Expression syntax summary, from least to most significant: "string" string constant, backslash is special 'string' string constant, ' is doubled [expr1, ...] |List| + (expr1, ...) |Tuple| {expr1: expr1, ...} |Dictionary| #{key: expr1, ...} legacy |Dictionary| &option option value @@ -1101,10 +1325,11 @@ Examples: "abc" == "Abc" evaluates to 1 if 'ignorecase' is set, 0 otherwise NOTE: In |Vim9| script 'ignorecase' is not used. - *E691* *E692* + *E691* *E692* *E1517* *E1518* A |List| can only be compared with a |List| and only "equal", "not equal", "is" and "isnot" can be used. This compares the values of the list, recursively. Ignoring case means case is ignored when comparing item values. +Same applies for a |Tuple|. *E735* *E736* A |Dictionary| can only be compared with a |Dictionary| and only "equal", "not @@ -1124,12 +1349,13 @@ Dictionary and arguments, use |get()| to get the function name: > if get(Part1, 'name') == get(Part2, 'name') " Part1 and Part2 refer to the same function < *E1037* -Using "is" or "isnot" with a |List|, |Dictionary| or |Blob| checks whether -the expressions are referring to the same |List|, |Dictionary| or |Blob| -instance. A copy of a |List| is different from the original |List|. When -using "is" without a |List|, |Dictionary| or |Blob|, it is equivalent to -using "equal", using "isnot" equivalent to using "not equal". Except that -a different type means the values are different: > +Using "is" or "isnot" with a |List|, |Tuple|, |Dictionary| or |Blob| checks +whether the expressions are referring to the same |List|, |Tuple|, +|Dictionary| or |Blob| instance. A copy of a |List| or |Tuple| is different +from the original |List| or |Tuple|. When using "is" without a |List|, +|Tuple|, |Dictionary| or |Blob|, it is equivalent to using "equal", using +"isnot" is equivalent to using "not equal". Except that a different type +means the values are different: > echo 4 == '4' 1 echo 4 is '4' @@ -1147,7 +1373,7 @@ that: > because 'x' converted to a Number is zero. However: > echo [0] == ['x'] 0 -Inside a List or Dictionary this conversion is not used. +Inside a List or Tuple or Dictionary this conversion is not used. In |Vim9| script the types must match. @@ -1191,13 +1417,14 @@ topmost bit (sometimes called the sign bit) is cleared. If the right operand expr6 and expr7 *expr6* *expr7* *E1036* *E1051* --------------- -expr7 + expr7 Number addition, |List| or |Blob| concatenation *expr-+* + *expr-+* +expr7 + expr7 Number addition, |List| or |Tuple| or |Blob| concatenation expr7 - expr7 Number subtraction *expr--* expr7 . expr7 String concatenation *expr-.* expr7 .. expr7 String concatenation *expr-..* For |Lists| only "+" is possible and then both expr7 must be a list. The -result is a new list with the two lists Concatenated. +result is a new list with the two lists concatenated. Same for a |Tuple|. For String concatenation ".." is preferred, since "." is ambiguous, it is also used for |Dict| member access and floating point numbers. @@ -1295,7 +1522,8 @@ in any order. E.g., these are all possible: expr10->(expr1, ...)[expr1] Evaluation is always from left to right. -expr10[expr1] item of String or |List| *expr-[]* *E111* + *expr-[]* *E111* +expr10[expr1] item of String or |List| or |Tuple| *E909* *subscript* *E1062* In legacy Vim script: If expr10 is a Number or String this results in a String that contains the @@ -1328,6 +1556,8 @@ Generally, if a |List| index is equal to or higher than the length of the |List|, or more negative than the length of the |List|, this results in an error. +A |Tuple| index is similar to a |List| index as explained above. + expr10[expr1a : expr1b] substring or |sublist| *expr-[:]* *substring* @@ -1369,6 +1599,7 @@ just above. Also see |sublist| below. Examples: > :let l = mylist[:3] " first four items :let l = mylist[4:4] " List with one item :let l = mylist[:] " shallow copy of a List +A |Tuple| slice is similar to a |List| slice. If expr10 is a |Blob| this results in a new |Blob| with the bytes in the indexes expr1a and expr1b, inclusive. Examples: > @@ -2081,7 +2312,7 @@ v:colornames A dictionary that maps color names to hex color strings. These You can make changes to that file, but make sure to add new keys instead of updating existing ones, otherwise Vim will skip - loading the file (thinking is hasn't been changed). + loading the file (thinking it hasn't been changed). *v:completed_item* *completed_item-variable* v:completed_item @@ -2615,6 +2846,8 @@ v:t_typealias Value of |typealias| type. Read-only. See: |type()| v:t_enum Value of |enum| type. Read-only. See: |type()| *v:t_enumvalue* *t_enumvalue-variable* v:t_enumvalue Value of |enumvalue| type. Read-only. See: |type()| + *v:t_tuple* *t_tuple-variable* +v:t_tuple Value of |Tuple| type. Read-only. See: |type()| *v:termresponse* *termresponse-variable* v:termresponse The escape sequence returned by the terminal for the |t_RV| @@ -2934,13 +3167,13 @@ declarations and assignments do not use a command. |vim9-declaration| :let &g:{option-name} -= {expr1} Like above, but only set the global value of an option (if there is one). Works like |:setglobal|. - *E1093* + *E1093* *E1537* *E1538* *E1535* :let [{name1}, {name2}, ...] = {expr1} *:let-unpack* *E687* *E688* - {expr1} must evaluate to a |List|. The first item in - the list is assigned to {name1}, the second item to - {name2}, etc. + {expr1} must evaluate to a |List| or a |Tuple|. The + first item in the list or tuple is assigned to + {name1}, the second item to {name2}, etc. The number of names must match the number of items in - the |List|. + the |List| or |Tuple|. Each name can be one of the items of the ":let" command as mentioned above. Example: > @@ -2957,16 +3190,22 @@ declarations and assignments do not use a command. |vim9-declaration| :let [{name1}, {name2}, ...] .= {expr1} :let [{name1}, {name2}, ...] += {expr1} :let [{name1}, {name2}, ...] -= {expr1} - Like above, but append/add/subtract the value for each - |List| item. +:let [{name1}, {name2}, ...] *= {expr1} +:let [{name1}, {name2}, ...] /= {expr1} +:let [{name1}, {name2}, ...] %= {expr1} + Like above, but append, add, subtract, multiply, + divide, or modulo the value for each |List| or |Tuple| + item. :let [{name}, ..., ; {lastname}] = {expr1} *E452* - Like |:let-unpack| above, but the |List| may have more - items than there are names. A list of the remaining - items is assigned to {lastname}. If there are no - remaining items {lastname} is set to an empty list. + Like |:let-unpack| above, but the |List| or |Tuple| + may have more items than there are names. A list or a + tuple of the remaining items is assigned to + {lastname}. If there are no remaining items, + {lastname} is set to an empty list or tuple. Example: > :let [a, b; rest] = ["aval", "bval", 3, 4] + :let [a, b; rest] = ("aval", "bval", 3, 4) < :let [{name}, ..., ; {lastname}] .= {expr1} :let [{name}, ..., ; {lastname}] += {expr1} @@ -3161,23 +3400,26 @@ text... get an error message: "E940: Cannot lock or unlock variable {name}". - [depth] is relevant when locking a |List| or - |Dictionary|. It specifies how deep the locking goes: + [depth] is relevant when locking a |List|, a |Tuple| + or a |Dictionary|. It specifies how deep the locking + goes: 0 Lock the variable {name} but not its value. - 1 Lock the |List| or |Dictionary| itself, - cannot add or remove items, but can - still change their values. + 1 Lock the |List| or |Tuple| or + |Dictionary| itself, cannot add or + remove items, but can still change + their values. 2 Also lock the values, cannot change the items. If an item is a |List| or - |Dictionary|, cannot add or remove - items, but can still change the + |Tuple| or |Dictionary|, cannot add or + remove items, but can still change the values. - 3 Like 2 but for the |List| / - |Dictionary| in the |List| / + 3 Like 2 but for the |List| / |Tuple| / + |Dictionary| in the |List| / |Tuple| / |Dictionary|, one level deeper. - The default [depth] is 2, thus when {name} is a |List| - or |Dictionary| the values cannot be changed. + The default [depth] is 2, thus when {name} is a + |List|, a |Tuple| or a |Dictionary| the values cannot + be changed. Example with [depth] 0: > let mylist = [1, 2, 3] @@ -3282,7 +3524,7 @@ text... :endfo[r] *:endfo* *:endfor* Repeat the commands between `:for` and `:endfor` for each item in {object}. {object} can be a |List|, - a |Blob| or a |String|. *E1177* + a |Tuple|, a |Blob| or a |String|. *E1177* Variable {var} is set to the value of each item. In |Vim9| script the loop variable must not have been @@ -4907,7 +5149,7 @@ executable. It takes the following arguments: filetype string executable string - *dist#vim9#Open()* *:Open* + *dist#vim9#Open()* *:Open* *:URLOpen* *g:Openprg* *gx* dist#vim9#Open(file: string) ~ @@ -4915,6 +5157,8 @@ Opens `path` with the system default handler (macOS `open`, Windows `explorer.exe`, Linux `xdg-open`, …). If the variable |g:Openprg| exists the string specified in the variable is used instead. +The |:Open| user command uses file completion for its argument. + This function is by default called using the gx mapping. In visual mode tries to open the visually selected text. @@ -4933,13 +5177,18 @@ Usage: >vim :call dist#vim9#Open() :Open < + *package-open* +The |:Open| and |:Launch| command are provided by the included plugin +$VIMRUNTIME/plugin/openPlugin.vim - *dist#vim9#Launch()* *:Launch* + *dist#vim9#Launch()* *:Launch* dist#vim9#Launch(file: string) ~ Launches with the appropriate system programs. Intended for launching GUI programs within Vim. +The |:Launch| user command uses shell completion for its first argument. + NOTE: escaping of is left to the user Examples: >vim diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index cbf038af..63d7b030 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 9.1. Last change: 2024 Dec 04 +*filetype.txt* For Vim version 9.1. Last change: 2025 May 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -153,11 +153,17 @@ variables can be used to overrule the filetype used for certain extensions: *.f g:filetype_f |ft-forth-syntax| *.frm g:filetype_frm |ft-form-syntax| *.fs g:filetype_fs |ft-forth-syntax| - *.h g:c_syntax_for_h |ft-c-syntax| + *.h g:c_syntax_for_h |ft-c-syntax| (deprecated) + *.h g:ch_syntax_for_h |ft-ch-syntax| (deprecated) + *.h g:filetype_h |ft-c-syntax| + |ft-ch-syntax| + |ft-cpp-syntax| *.i g:filetype_i |ft-progress-syntax| *.inc g:filetype_inc *.lsl g:filetype_lsl *.m g:filetype_m |ft-mathematica-syntax| + *[mM]makefile,*.mk,*.mak,[mM]akefile* + g:make_flavor |ft-make-syntax| *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md g:filetype_md |ft-pandoc-syntax| *.mod g:filetype_mod @@ -263,7 +269,7 @@ D. If your filetype can only be detected by inspecting the contents of the item of the 'runtimepath' option. Example for Unix: > :!mkdir ~/.vim < - 2. Create a vim script file for doing this. Example: > + 2. Create a Vim script file for doing this. Example: > if did_filetype() " filetype already set.. finish " ..don't do these checks endif @@ -640,6 +646,35 @@ One command, :DiffGitCached, is provided to show a diff of the current commit in the preview window. It is equivalent to calling "git diff --cached" plus any arguments given to the command. +GIT REBASE *ft-gitrebase-plugin* + +The gitrebase filetype defines the following buffer-local commands, to help +with interactive `git rebase`: > + + :Drop " to discard this commit + :Edit " to stop for editing this commit + :Fixup " to squash (but discard the message) into the previous one + :Pick " to pick this commit (the cursor is on) + :Reword " to pick this commit, but change the commit message + :Squash " to squash this commit into the previous one + +In addition, the following command can be used to cycle between the different +possibilities: > + + :Cycle " to cycle between the previous commands +< +The `:Cycle` command is also mapped to the CTRL-A and CTRL-X keys. +For details, see `git-rebase --help`. + +GLEAM *ft-gleam-plugin* + +By default the following options are set for the recommended gleam style: > + + setlocal expandtab shiftwidth=2 softtabstop=2 + +To disable this behavior, set the following variable in your vimrc: > + + let g:gleam_recommended_style = 0 GO *ft-go-plugin* @@ -667,6 +702,32 @@ HARE *ft-hare* Since the text for this plugin is rather long it has been put in a separate file: |ft_hare.txt|. +HTML *ft-html-plugin* + +Tag folding poses a few difficulties. Many elements, e.g. `blockquote`, are +always delimited by start and end tags; end tags for some elements, e.g. `p`, +can be omitted in certain contexts; void elements, e.g. `hr`, have no end tag. +Although the rules for supporting omissible end tags are ad-hoc and involved +[0], they apply to elements in scope. Assuming syntactical wellformedness, an +end tag can be associated with its nearest matching start tag discoverable in +scope [1] and towards the beginning of a file, whereas all unbalanced tags and +inlined tags can be disregarded. Having syntax highlighting in effect, tag +folding using the |fold-expr| method can be enabled with: > + let g:html_expr_folding = 1 +< +By default, tag folding will be redone from scratch after each occurrence of +a |TextChanged| or an |InsertLeave| event. Such frequency may not be desired, +especially for large files, and this recomputation can be disabled with: > + let g:html_expr_folding_without_recomputation = 1 + doautocmd FileType +< +To force another recomputation, do: > + unlet! b:foldsmap + normal zx +< +[0] https://html.spec.whatwg.org/multipage/syntax.html#optional-tags +[1] https://en.wikipedia.org/wiki/Dangling_else + IDRIS2 *ft-idris2-plugin* By default the following options are set: > @@ -744,12 +805,21 @@ Add following lines to $HOME/.vim/ftplugin/json.vim: > import autoload 'dist/json.vim' setl formatexpr=json.FormatExpr() -LUA *ft-lua-plugin* +LUA *ft-lua-plugin* *g:lua_folding* You can enable folding of Lua functions using |fold-expr| by: > let g:lua_folding = 1 +< *g:lua_version* *g:lua_subversion* +Lua filetype's 'includeexpr' and |ft-lua-syntax| highlighting use the global +variables "g:lua_version" and "g:lua_subversion" to determine the version of +Lua to use (5.3 is the default) +For example, to use Lua 5.1, set the variables like this: > + + let g:lua_version = 5 + let g:lua_subversion = 1 +< MAIL *ft-mail-plugin* Options: @@ -762,12 +832,12 @@ Options: You can also format quoted text with |gq|. Local mappings: -q or \\MailQuote +q or \MailQuote Quotes the text selected in Visual mode, or from the cursor position to the end of the file in Normal mode. This means "> " is inserted in each line. -MAN *ft-man-plugin* *:Man* *man.vim* +MAN *ft-man-plugin* *:Man* *:ManReload* *man.vim* This plugin displays a manual page in a nice way. See |find-manpage| in the user manual for more information. @@ -784,6 +854,8 @@ Commands: Man {name} Display the manual page for {name} in a window. Man {number} {name} Display the manual page for {name} in a section {number}. +ManReload Reload the cache of available man pages used for |:Man| argument + completion. Global mapping: K Displays the manual page for the word under the cursor. @@ -814,6 +886,14 @@ desired folding style instead. For example: > If you would like :Man {number} {name} to behave like man {number} {name} by not running man {name} if no page is found, then use this: > let g:ft_man_no_sect_fallback = 1 +< + *g:ft_man_implementation* +The completion for the :Man command tries to guess which implementation of man +the system has. If it guesses wrong, you can set g:ft_man_implementation to +one of these values: + 'man-db' https://man-db.nongnu.org/ + '' Unknown, fall back to completing shell commands + instead of man pages. You may also want to set 'keywordprg' to make the |K| command open a manual page in a Vim window: > @@ -865,6 +945,12 @@ the PDF. The following are treated as tags: These maps can be disabled with > :let g:no_pdf_maps = 1 + +PLSQL *ft-plsql-plugin* + +To enable syntax folding in PL/SQL filetypes, set the following variable: > + + :let g:plsql_fold = 1 < PYTHON *ft-python-plugin* *PEP8* @@ -983,6 +1069,13 @@ functions with [[ and ]]. Move around comments with ]" and [". The mappings can be disabled with: > let g:no_vim_maps = 1 +YAML *ft-yaml-plugin* +By default, the YAML filetype plugin enables the following options: > + setlocal shiftwidth=2 softtabstop=2 + +To disable this, set the following variable: > + let g:yaml_recommended_style = 0 + ZIG *ft-zig-plugin* diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 7b9dd767..4e08d905 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 9.1. Last change: 2025 Jan 11 +*helphelp.txt* For Vim version 9.1. Last change: 2025 May 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -287,9 +287,11 @@ The latter supports the following normal commands: > | select first entry | select last entry -The plugin can also provide a table of contents in man pages, markdown files, -and terminal buffers. In the latter, the entries will be the past executed -shell commands. To find those, the following pattern is used: > +The plugin can also provide a table of contents in buffers of the following +filetypes: asciidoc, html, man, markdown, tex, vim, and xhtml. In addition +it also provide a table of contents for a terminal buffer, which produces +entries that are the past executed shell commands. To find those, by default, +the following pattern is used: > ^\w\+@\w\+:\f\+\$\s @@ -303,6 +305,9 @@ Tip: After inserting a pattern to look for with the `/` command, if you press instead of , you can then get more context for each remaining entry by pressing `J` or `K`. +Refer |helptoc.vim| for more details about helptoc, particularly about using +it with filetypes other than help, and configuring its options. + ============================================================================== 2. Translated help files *help-translated* @@ -383,6 +388,10 @@ standard Vim help files, except for the first line. If you are writing a new help file it's best to copy one of the existing files and use it as a template. +Vim help files generally use 2 spaces after a sentence (since they are written +using a fixed-width font and that was the prefered style in the 70s/80s), like +what is described here: https://english.stackexchange.com/a/2602 + The first line in a help file should have the following format: *plugin_name.txt* {short description of the plugin} @@ -471,8 +480,13 @@ highlighting. So do these: You can find the details in $VIMRUNTIME/syntax/help.vim -GENDER NEUTRAL LANGUAGE +FILETYPE COMPLETION *ft-help-omni* +To get completion for help tags when writing a tag reference, you can use the +|i_CTRL-X_CTRL-O| command. + + +GENDER NEUTRAL LANGUAGE *gender-neutral* *inclusion* Vim is for everybody, no matter race, gender or anything. For new or updated help text, gender neutral language is recommended. Some of the help text is diff --git a/runtime/doc/if_perl.txt b/runtime/doc/if_perl.txt index 86edd05a..85e5a90e 100644 --- a/runtime/doc/if_perl.txt +++ b/runtime/doc/if_perl.txt @@ -1,4 +1,4 @@ -*if_perl.txt* For Vim version 9.1. Last change: 2023 May 14 +*if_perl.txt* For Vim version 9.1. Last change: 2025 Apr 27 VIM REFERENCE MANUAL by Sven Verdoolaege @@ -74,7 +74,7 @@ The ActiveState one should work, Strawberry Perl is a good alternative. |script-here|. -Example vim script: > +Example Vim script: > function! WhitePearl() perl << EOF diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 480ff02c..b17e1e76 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -1,4 +1,4 @@ -*if_pyth.txt* For Vim version 9.1. Last change: 2024 Nov 09 +*if_pyth.txt* For Vim version 9.1. Last change: 2025 Mar 26 VIM REFERENCE MANUAL by Paul Moore @@ -184,8 +184,9 @@ vim.eval(str) *python-eval* evaluator (see |expression|). Returns the expression result as: - a string if the Vim expression evaluates to a string or number - a list if the Vim expression evaluates to a Vim list + - a tuple if the Vim expression evaluates to a Vim tuple - a dictionary if the Vim expression evaluates to a Vim dictionary - Dictionaries and lists are recursively expanded. + Dictionaries, lists and tuples are recursively expanded. Examples: > :" value of the 'textwidth' option :py text_width = vim.eval("&tw") @@ -196,6 +197,8 @@ vim.eval(str) *python-eval* :" Result is a string! Use string.atoi() to convert to a number. :py str = vim.eval("12+12") : + :py tuple = vim.eval('(1, 2, 3)') + : :py tagList = vim.eval('taglist("eval_expr")') < The latter will return a python list of python dicts, for instance: [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ~ @@ -207,8 +210,8 @@ vim.eval(str) *python-eval* vim.bindeval(str) *python-bindeval* Like |python-eval|, but returns special objects described in - |python-bindeval-objects|. These python objects let you modify (|List| - or |Dictionary|) or call (|Funcref|) vim objects. + |python-bindeval-objects|. These python objects let you modify + (|List|, |Tuple| or |Dictionary|) or call (|Funcref|) vim objects. vim.strwidth(str) *python-strwidth* Like |strwidth()|: returns number of display cells str occupies, tab @@ -688,6 +691,22 @@ vim.List object *python-List* print isinstance(l, vim.List) # True class List(vim.List): # Subclassing +vim.Tuple object *python-Tuple* + Sequence-like object providing access to vim |Tuple| type. + Supports `.locked` attribute, see |python-.locked|. Also supports the + following methods: + Method Description ~ + __new__(), __new__(iterable) + You can use `vim.Tuple()` to create new vim tuples. + Without arguments constructs empty list. + Examples: > + t = vim.Tuple("abc") # Constructor, result: ('a', 'b', 'c') + print t[1:] # slicing + print t[0] # getting item + for i in t: # iteration + print isinstance(t, vim.Tuple) # True + class Tuple(vim.Tuple): # Subclassing + vim.Function object *python-Function* Function-like object, acting like vim |Funcref| object. Accepts special keyword argument `self`, see |Dictionary-function|. You can also use diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 06a24e04..024102cd 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 9.1. Last change: 2025 Jan 03 +*index.txt* For Vim version 9.1. Last change: 2025 Mar 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1400,6 +1400,8 @@ tag command action ~ |:inoremenu| :inoreme[nu] like ":noremenu" but for Insert mode |:intro| :int[ro] print the introductory message |:interface| :interface start of an interface declaration +|:iput| :ip[ut] like |:put|, but adjust the indent to the + current line |:isearch| :is[earch] list one line where identifier matches |:isplit| :isp[lit] split window and jump to definition of identifier diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 71ba061d..f3d92b29 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 9.1. Last change: 2025 Feb 14 +*insert.txt* For Vim version 9.1. Last change: 2025 May 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -222,6 +222,10 @@ CTRL-Q Same as CTRL-V. CTRL-SHIFT-V *i_CTRL-SHIFT-V* *i_CTRL-SHIFT-Q* CTRL-SHIFT-Q Works just like CTRL-V, unless |modifyOtherKeys| is active, then it inserts the Escape sequence for a key with modifiers. + Note: When CTRL-SHIFT-V is intercepted by your system (e.g., + to paste text) you can often use CTRL-SHIFT-Q instead. + However, in some terminals (e.g. GNOME Terminal), CTRL-SHIFT-Q + quits the terminal without confirmation. CTRL-X Enter CTRL-X mode. This is a sub-mode where commands can be given to complete words or scroll the window. See @@ -659,8 +663,8 @@ Also see the 'infercase' option if you want to adjust the case of the match. When inserting a selected candidate word from the |popup-menu|, the part of the candidate word that does not match the query is highlighted using -|hl-ComplMatchIns|. If fuzzy is enabled in 'completopt', highlighting will not -be applied. +|hl-ComplMatchIns|. If fuzzy is enabled in 'completeopt', highlighting will +not be applied. *complete_CTRL-E* When completion is active you can use CTRL-E to stop it and go back to the @@ -1163,6 +1167,9 @@ For example, the function can contain this: > let matches = ... list of words ... return {'words': matches, 'refresh': 'always'} < +If looking for matches is time-consuming, |complete_check()| may be used to +maintain responsiveness. + *complete-items* Each list item can either be a string or a Dictionary. When it is a string it is used as the completion. When it is a Dictionary it can contain these @@ -1340,6 +1347,7 @@ use all space available. The 'pumwidth' option can be used to set a minimum width. The default is 15 characters. + *compl-states* There are three states: 1. A complete match has been inserted, e.g., after using CTRL-N or CTRL-P. 2. A cursor key has been used to select another match. The match was not diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 4e57797a..726d15dd 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1,4 +1,4 @@ -*motion.txt* For Vim version 9.1. Last change: 2024 Dec 17 +*motion.txt* For Vim version 9.1. Last change: 2025 Apr 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -895,12 +895,12 @@ Numbered mark should be stored. See |viminfo-file-marks|. *'[* *`[* -'[ `[ To the first character of the previously changed - or yanked text. +'[ `[ To the first character of the previously changed, + or yanked text. Also set when writing the buffer. *']* *`]* '] `] To the last character of the previously changed or - yanked text. + yanked text. Also set when writing the buffer. After executing an operator the Cursor is put at the beginning of the text that was operated upon. After a put command ("p" or "P") the cursor is diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 94fb7399..5563a052 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Feb 08 +*options.txt* For Vim version 9.1. Last change: 2025 May 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -212,7 +212,7 @@ A few examples: > :set makeprg=make,file results in "make,file" :set makeprg=make\\,file results in "make\,file" :set tags=tags,file results in "tags" and "file" - :set tags=tags\\,file results in "tags,file" + :set tags=tags\\,file results in "tags\,file" :let &tags='tags\,file' (same as above) The "|" character separates a ":set" command from a following command. To @@ -1717,6 +1717,19 @@ A jump table for the options with a short description can be found at |Q_op|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. + *'chistory'* *'chi'* +'chistory' 'chi' number (default: 10) + global + {only available when compiled with the |+quickfix| + feature} + Number of quickfix lists that should be remembered for the quickfix + stack. Must be between 1 and 100. If the option is set to a value + that is lower than the amount of entries in the quickfix list stack, + entries will be removed starting from the oldest one. If the current + quickfix list was removed, then the quickfix list at top of the stack + (the most recently created) will be used in its place. For additional + info, see |quickfix-stack|. + *'cindent'* *'cin'* *'nocindent'* *'nocin'* 'cindent' 'cin' boolean (default off) local to buffer @@ -2072,6 +2085,28 @@ A jump table for the options with a short description can be found at |Q_op|. |i_CTRL-X_CTRL-D| ] tag completion t same as "]" + f{func} call the function {func}. Multiple "f" flags may be specified. + Refer to |complete-functions| for details on how the function + is invoked and what it should return. The value can be the + name of a function or a |Funcref|. For |Funcref| values, + spaces must be escaped with a backslash ('\'), and commas with + double backslashes ('\\') (see |option-backslash|). + If the Dict returned by the {func} includes {"refresh": "always"}, + the function will be invoked again whenever the leading text + changes. + Completion matches are always inserted at the keyword + boundary, regardless of the column returned by {func} when + a:findstart is 1. This ensures compatibility with other + completion sources. + To make further modifications to the inserted text, {func} + can make use of |CompleteDonePre|. + If generating matches is potentially slow, |complete_check()| + should be used to avoid blocking and preserve editor + responsiveness. + f equivalent to using "f{func}", where the function is taken from + the 'completefunc' option. + o equivalent to using "f{func}", where the function is taken from + the 'omnifunc' option. Unloaded buffers are not loaded, thus their autocmds |:autocmd| are not executed, this may lead to unexpected completions from some files @@ -2090,6 +2125,13 @@ A jump table for the options with a short description can be found at |Q_op|. based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions). + An optional match limit can be specified for a completion source by + appending a caret ("^") followed by a {count} to the source flag. + For example: ".^9,w,u,t^5" limits matches from the current buffer + to 9 and from tags to 5. Other sources remain unlimited. + Note: The match limit takes effect only during forward completion + (CTRL-N) and is ignored during backward completion (CTRL-P). + *'completefunc'* *'cfu'* 'completefunc' 'cfu' string (default: empty) local to buffer @@ -2104,13 +2146,35 @@ A jump table for the options with a short description can be found at |Q_op|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. + *'completefuzzycollect'* *'cfc'* +'completefuzzycollect' 'cfc' string (default: empty) + global + A comma-separated list of strings to enable fuzzy collection for + specific |ins-completion| modes, affecting how matches are gathered + during completion. For specified modes, fuzzy matching is used to + find completion candidates instead of the standard prefix-based + matching. This option can contain the following values: + + keyword keywords in the current file |i_CTRL-X_CTRL-N| + keywords with flags ".", "w", |i_CTRL-N| |i_CTRL-P| + "b", "u", "U" and "k{dict}" in 'complete' + keywords in 'dictionary' |i_CTRL-X_CTRL-K| + + files file names |i_CTRL-X_CTRL-F| + + whole_line whole lines |i_CTRL-X_CTRL-L| + + When using the 'completeopt' "longest" option value, fuzzy collection + can identify the longest common string among the best fuzzy matches + and insert it automatically. + *'completeitemalign'* *'cia'* 'completeitemalign' 'cia' string (default: "abbr,kind,menu") global - A comma-separated list of |complete-items| that controls the alignment - and display order of items in the popup menu during Insert mode - completion. The supported values are abbr, kind, and menu. These - options allow to customize how the completion items are shown in the + A comma-separated list of strings that controls the alignment and + display order of items in the popup menu during Insert mode + completion. The supported values are "abbr", "kind", and "menu". + These values allow customizing how |complete-items| are shown in the popup menu. Note: must always contain those three values in any order. @@ -2120,6 +2184,22 @@ A jump table for the options with a short description can be found at |Q_op|. A comma-separated list of options for Insert mode completion |ins-completion|. The supported values are: + fuzzy Enable |fuzzy-matching| for completion candidates. This + allows for more flexible and intuitive matching, where + characters can be skipped and matches can be found even + if the exact sequence is not typed. Note: This option + does not affect the collection of candidate list, it only + controls how completion candidates are reduced from the + list of alternatives. If you want to use |fuzzy-matching| + to gather more alternatives for your candidate list, + see |'completefuzzycollect'|. + + longest Only insert the longest common text of the matches. If + the menu is displayed you can use CTRL-L to add more + characters. Whether case is ignored depends on the kind + of completion. For buffer text the 'ignorecase' option is + used. + menu Use a popup menu to show the possible completions. The menu is only shown when there is more than one match and sufficient colors are available. |ins-completion-menu| @@ -2128,15 +2208,23 @@ A jump table for the options with a short description can be found at |Q_op|. Useful when there is additional information about the match, e.g., what file it comes from. - longest Only insert the longest common text of the matches. If - the menu is displayed you can use CTRL-L to add more - characters. Whether case is ignored depends on the kind - of completion. For buffer text the 'ignorecase' option is - used. + nearest Matches are listed based on their proximity to the cursor + position, unlike the default behavior, which only + considers proximity for matches appearing below the + cursor. This applies only to matches from the current + buffer. No effect if "fuzzy" is present. - preview Show extra information about the currently selected - completion in the preview window. Only works in - combination with "menu" or "menuone". + noinsert Do not insert any text for a match until the user selects + a match from the menu. Only works in combination with + "menu" or "menuone". No effect if "longest" is present. + + noselect Same as "noinsert", except that no menu item is + pre-selected. If both "noinsert" and "noselect" are + present, "noselect" has precedence. + + nosort Disable sorting of completion candidates based on fuzzy + scores when "fuzzy" is enabled. Candidates will appear + in their original order. popup Show extra information about the currently selected completion in a popup window. Only works in combination @@ -2151,28 +2239,15 @@ A jump table for the options with a short description can be found at |Q_op|. See the example at |complete-popuphidden|. {only works when compiled with the |+textprop| feature} - noinsert Do not insert any text for a match until the user selects - a match from the menu. Only works in combination with - "menu" or "menuone". No effect if "longest" is present. - - noselect Same as "noinsert", except that no menu item is - pre-selected. If both "noinsert" and "noselect" are - present, "noselect" has precedence. - - fuzzy Enable |fuzzy-matching| for completion candidates. This - allows for more flexible and intuitive matching, where - characters can be skipped and matches can be found even - if the exact sequence is not typed. - - nosort Disable sorting of completion candidates based on fuzzy - scores when "fuzzy" is enabled. Candidates will appear - in their original order. - preinsert Preinsert the portion of the first candidate word that is not part of the current completion leader and using the - |hl-ComplMatchIns| highlight group. Does not work when - "fuzzy" is also included. + |hl-ComplMatchIns| highlight group. In order for it to + work, "fuzzy" must not be set and "menuone" must be set. + + preview Show extra information about the currently selected + completion in the preview window. Only works in + combination with "menu" or "menuone". *'completepopup'* *'cpp'* 'completepopup' 'cpp' string (default empty) @@ -2628,7 +2703,7 @@ A jump table for the options with a short description can be found at |Q_op|. *E1193* *E1194* *E1195* *E1196* *E1230* *E1197* *E1198* *E1199* *E1200* *E1201* xchacha20 XChaCha20 Cipher with Poly1305 Message Authentication - Code. Medium strong till strong encryption. + Code. Medium strong to strong encryption. Encryption is provided by the libsodium library, it requires Vim to be built with |+sodium|. It adds a seed and a message authentication code (MAC) @@ -2883,7 +2958,8 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'dip'* *'diffopt'* -'diffopt' 'dip' string (default "internal,filler,closeoff") +'diffopt' 'dip' string (default + "internal,filler,closeoff,inline:simple") global {not available when compiled without the |+diff| feature} @@ -2948,6 +3024,24 @@ A jump table for the options with a short description can be found at |Q_op|. Use the indent heuristic for the internal diff library. + inline:{text} Highlight inline differences within a change. + See |view-diffs|. Supported values are: + + none Do not perform inline highlighting. + simple Highlight from first different + character to the last one in each + line. This is the default if no + `inline:` value is set. + char Use internal diff to perform a + character-wise diff and highlight the + difference. + word Use internal diff to perform a + |word|-wise diff and highlight the + difference. Non-alphanumeric + multi-byte characters such as emoji + and CJK characters are considered + individual words. + internal Use the internal diff library. This is ignored when 'diffexpr' is set. *E960* When running out of memory when writing a @@ -3544,8 +3638,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'fillchars'* *'fcs'* 'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~,lastline:@") global or local to window |global-local| - Characters to fill the statuslines, vertical separators and special - lines in the window. + Characters to fill the statuslines, vertical separators, special + lines in the window and truncated text in the |ins-completion-menu|. It is a comma-separated list of items. Each item has a name, a colon and the value of that item: |E1511| @@ -3560,15 +3654,17 @@ A jump table for the options with a short description can be found at |Q_op|. diff '-' deleted lines of the 'diff' option eob '~' empty lines below the end of a buffer lastline '@' 'display' contains lastline/truncate + trunc '>' truncated text in the + |ins-completion-menu|. + truncrl '<' same as "trunc" in 'rightleft' mode Any one that is omitted will fall back to the default. Example: > :set fillchars=stl:\ ,stlnc:\ ,vert:\|,fold:-,diff:- < - For the "stl", "stlnc", "foldopen", "foldclose" and "foldsep" items - single-byte and multibyte characters are supported. But double-width - characters are not supported. |E1512| + All items support single-byte and multibyte characters. But + double-width characters are not supported. |E1512| The highlighting used for these items: item name highlight group ~ @@ -3576,9 +3672,15 @@ A jump table for the options with a short description can be found at |Q_op|. stlnc StatusLineNC |hl-StatusLineNC| vert VertSplit |hl-VertSplit| fold Folded |hl-Folded| + foldopen FoldColumn |hl-FoldColumn| + foldclose FoldColumn |hl-FoldColumn| + foldsep FoldColumn |hl-FoldColumn| diff DiffDelete |hl-DiffDelete| eob EndOfBuffer |hl-EndOfBuffer| lastline NonText |hl-NonText| + trunc one of the many Popup menu highlighting groups like + |hl-PmenuSel| + truncrl same as "trunc" *'findfunc'* *'ffu'* *E1514* 'findfunc' 'ffu' string (default empty) @@ -4365,10 +4467,10 @@ A jump table for the options with a short description can be found at |Q_op|. v:Visual,V:VisualNOS,w:WarningMsg, W:WildMenu,f:Folded,F:FoldColumn, A:DiffAdd,C:DiffChange,D:DiffDelete, - T:DiffText,>:SignColumn,-:Conceal, - B:SpellBad,P:SpellCap,R:SpellRare, - L:SpellLocal,+:Pmenu,=:PmenuSel, - k:PmenuMatch,<:PmenuMatchSel, + T:DiffText,E:DiffTextAdd,>:SignColumn, + -:Conceal,B:SpellBad,P:SpellCap, + R:SpellRare, L:SpellLocal,+:Pmenu, + =:PmenuSel, k:PmenuMatch,<:PmenuMatchSel, [:PmenuKind,]:PmenuKindSel, {:PmenuExtra,}:PmenuExtraSel, x:PmenuSbar,X:PmenuThumb,*:TabLine, @@ -4420,7 +4522,8 @@ A jump table for the options with a short description can be found at |Q_op|. |hl-DiffAdd| A added line in diff mode |hl-DiffChange| C changed line in diff mode |hl-DiffDelete| D deleted line in diff mode - |hl-DiffText| T inserted text in diff mode + |hl-DiffText| T changed text in diff mode + |hl-DiffTextAdd| E inserted text in diff mode |hl-SignColumn| > column used for |signs| |hl-Conceal| - the placeholders used for concealed characters (see 'conceallevel') @@ -4741,7 +4844,7 @@ A jump table for the options with a short description can be found at |Q_op|. < Also used for the |gf| command if an unmodified file name can't be found. Allows doing "gf" on the name after an 'include' statement. - Also used for ||. + Note: Not used for ||. If the expression starts with s: or ||, then it is replaced with the script ID (|local-function|). Example: > @@ -4879,6 +4982,23 @@ A jump table for the options with a short description can be found at |Q_op|. and there is a letter before it, the completed part is made uppercase. With 'noinfercase' the match is used as-is. + *'isexpand'* *'ise'* +'isexpand' 'ise' string (default: "") + local to buffer + Defines characters and patterns for completion in insert mode. Used + by the |complete_match()| function to determine the starting position + for completion. This is a comma-separated list of triggers. Each + trigger can be: + - A single character like "." or "/" + - A sequence of characters like "->", "/*", or "/**" + + Note: Use "\\," to add a literal comma as trigger character, see + |option-backslash|. + + Examples: > + set isexpand=.,->,/*,\\, +< + *'insertmode'* *'im'* *'noinsertmode'* *'noim'* 'insertmode' 'im' boolean (default off) global @@ -5269,6 +5389,18 @@ A jump table for the options with a short description can be found at |Q_op|. temporarily when performing an operation where redrawing may cause flickering or cause a slowdown. + *'lhistory'* *'lhi'* +'lhistory' 'lhi' number (default: 10) + local to window + {only available when compiled with the |+quickfix| + feature} + Like 'chistory', but for the location list stack associated with a + window. If the option is changed in either the location list window + itself or the window that is associated with the location list stack, + the new value will also be applied to the other one. This means this + value will always be the same for a given location list window and its + corresponding window. See |quickfix-stack| for additional info. + *'linebreak'* *'lbr'* *'nolinebreak'* *'nolbr'* 'linebreak' 'lbr' boolean (default off) local to window @@ -5905,7 +6037,7 @@ A jump table for the options with a short description can be found at |Q_op|. feature} This option tells Vim what the mouse pointer should look like in different modes. The option is a comma-separated list of parts, much - like used for 'guicursor'. Each part consist of a mode/location-list + like used for 'guicursor'. Each part consists of a mode/location-list and an argument-list: mode-list:shape,mode-list:shape,.. The mode-list is a dash separated list of these modes/locations: @@ -5933,26 +6065,26 @@ A jump table for the options with a short description can be found at |Q_op|. The shape is one of the following: avail name looks like ~ - w x arrow Normal mouse pointer - w x blank no pointer at all (use with care!) - w x beam I-beam - w x updown up-down sizing arrows - w x leftright left-right sizing arrows - w x busy The system's usual busy pointer - w x no The system's usual 'no input' pointer - x udsizing indicates up-down resizing - x lrsizing indicates left-right resizing - x crosshair like a big thin + - x hand1 black hand - x hand2 white hand - x pencil what you write with - x question big ? - x rightup-arrow arrow pointing right-up - w x up-arrow arrow pointing up + w x g arrow Normal mouse pointer + w x blank no pointer at all (use with care!) + w x g beam I-beam + w x g updown up-down sizing arrows + w x g leftright left-right sizing arrows + w x g busy The system's usual busy pointer + w x g no The system's usual 'no input' pointer + x g udsizing indicates up-down resizing + x g lrsizing indicates left-right resizing + x g crosshair like a big thin + + x g hand1 black hand + x g hand2 white hand + x pencil what you write with + x g question big ? + x rightup-arrow arrow pointing right-up + w x up-arrow arrow pointing up x any X11 pointer number (see X11/cursorfont.h) The "avail" column contains a 'w' if the shape is available for Win32, - x for X11. + x for X11 (including GTK+ 2), g for GTK+ 3. Any modes not specified or shapes not available use the normal mouse pointer. @@ -6432,6 +6564,17 @@ A jump table for the options with a short description can be found at |Q_op|. global Determines the maximum number of items to show in the popup menu for Insert mode completion. When zero as much space as available is used. + |ins-completion-menu|. + + *'pummaxwidth'* *'pmw'* +'pummaxwidth' 'pmw' number (default 0) + global + Determines the maximum width to use for the popup menu for completion. + When zero, there is no maximum width limit, otherwise the popup menu + will never be wider than this value. Truncated text will be indicated + by "trunc" value of 'fillchars' option. + + This option takes precedence over 'pumwidth'. |ins-completion-menu|. *'pumwidth'* *'pw'* @@ -7598,9 +7741,11 @@ A jump table for the options with a short description can be found at |Q_op|. Override the 'ignorecase' option if the search pattern contains upper case characters. Only used when the search pattern is typed and 'ignorecase' option is on. Used for the commands "/", "?", "n", "N", - ":g" and ":s". Not used for "*", "#", "gd", tag search, etc. After - "*" and "#" you can make 'smartcase' used by doing a "/" command, - recalling the search pattern from history and hitting . + ":g" and ":s" and when filtering matches for the completion menu + |compl-states|. + Not used for "*", "#", "gd", tag search, etc. After "*" and "#" you + can make 'smartcase' used by doing a "/" command, recalling the search + pattern from history and hitting . NOTE: This option is reset when 'compatible' is set. *'smartindent'* *'si'* *'nosmartindent'* *'nosi'* @@ -8377,7 +8522,8 @@ A jump table for the options with a short description can be found at |Q_op|. local to buffer {not available when compiled without the |+eval| feature} - This option specifies a function to be used to perform tag searches. + This option specifies a function to be used to perform tag searches + (including |taglist()|). The function gets the tag pattern and should return a List of matching tags. See |tag-function| for an explanation of how to write the function and an example. The value can be the name of a function, a @@ -8515,15 +8661,6 @@ A jump table for the options with a short description can be found at |Q_op|. When on, uses |highlight-guifg| and |highlight-guibg| attributes in the terminal (thus using 24-bit color). - Will automatically be enabled, if Vim detects that it runs in a - capable terminal (when the terminal supports the RGB terminfo - capability or when the number of colors |t_Co| supported by the - terminal is 0x1000000, e.g. with $TERM=xterm-direct). Due to the async - nature of querying the terminal, enabling this automatically is - noticable. Use > - set notermguicolors -< to explicitly disable. - Requires a ISO-8613-3 compatible terminal. If setting this option does not work (produces a colorless UI) reading |xterm-true-color| might help. @@ -9557,48 +9694,65 @@ A jump table for the options with a short description can be found at |Q_op|. *'wildmode'* *'wim'* 'wildmode' 'wim' string (Vim default: "full") global - Completion mode that is used for the character specified with - 'wildchar'. It is a comma-separated list of up to four parts. Each - part specifies what to do for each consecutive use of 'wildchar'. The - first part specifies the behavior for the first use of 'wildchar', - The second part for the second use, etc. - - Each part consists of a colon separated list consisting of the - following possible values: - "" Complete only the first match. - "full" Complete the next full match. After the last match, - the original string is used and then the first match - again. Will also start 'wildmenu' if it is enabled. - "longest" Complete till longest common string. If this doesn't - result in a longer string, use the next part. - "list" When more than one match, list all matches. - "lastused" When completing buffer names and more than one buffer - matches, sort buffers by time last used (other than - the current buffer). - When there is only a single match, it is fully completed in all cases. - - Examples of useful colon-separated values: - "longest:full" Like "longest", but also start 'wildmenu' if it is - enabled. Will not complete to the next full match. - "list:full" When more than one match, list all matches and - complete first match. - "list:longest" When more than one match, list all matches and - complete till longest common string. - "list:lastused" When more than one buffer matches, list all matches - and sort buffers by time last used (other than the - current buffer). + Completion mode used for the character specified with 'wildchar'. + This option is a comma-separated list of up to four parts, + corresponding to the first, second, third, and fourth presses of + 'wildchar'. Each part is a colon-separated list of completion + behaviors, which are applied simultaneously during that phase. + + The possible behavior values are: + "" Only complete (insert) the first match. No further + matches are cycled or listed. + "full" Complete the next full match. Cycles through all + matches, returning to the original input after the + last match. If 'wildmenu' is enabled, it will be + shown. + "longest" Complete to the longest common substring. If this + doesn't extend the input, the next 'wildmode' part is + used. + "list" If multiple matches are found, list all of them. + "lastused" When completing buffer names, sort them by most + recently used (excluding the current buffer). Only + applies to buffer name completion. + "noselect" If 'wildmenu' is enabled, show the menu but do not + preselect the first item. + If only one match exists, it is completed fully, unless "noselect" is + specified. + + Some useful combinations of colon-separated values: + "longest:full" Start with the longest common string and show + 'wildmenu' (if enabled). Does not cycle + through full matches. + "list:full" List all matches and complete first match. + "list:longest" List all matches and complete till the longest + common prefix. + "list:lastused" List all matches. When completing buffers, + sort them by most recently used (excluding the + current buffer). + "noselect:lastused" Do not preselect the first item in 'wildmenu' + if it is active. When completing buffers, + sort them by most recently used (excluding the + current buffer). Examples: > :set wildmode=full -< Complete first full match, next match, etc. (the default) > +< Complete full match on every press (default behavior) > :set wildmode=longest,full -< Complete longest common string, then each full match > +< First press: longest common substring + Second press: cycle through full matches > :set wildmode=list:full -< List all matches and complete each full match > +< First press: list all matches and complete the first one > :set wildmode=list,full -< List all matches without completing, then each full match > +< First press: list matches only + Second press: complete full matches > :set wildmode=longest,list -< Complete longest common string, then list alternatives. +< First press: longest common substring + Second press: list all matches > + :set wildmode=noselect:full +< First press: show 'wildmenu' without completing or selecting + Second press: cycle full matches > + :set wildmode=noselect:lastused,full +< Same as above, but buffer matches are sorted by time last used More info here: |cmdline-completion|. *'wildoptions'* *'wop'* diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 39eb5442..857a3e64 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 9.1. Last change: 2024 Dec 26 +*pattern.txt* For Vim version 9.1. Last change: 2025 Mar 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -141,6 +141,7 @@ CTRL-C Interrupt current (search) command. Use CTRL-Break on help users who use "vim file | grep word" and don't know how to get out (blindly typing :qa would work). + If a popup is open, the active popup will be closed. *:noh* *:nohlsearch* :noh[lsearch] Stop the highlighting for the 'hlsearch' option. It @@ -1221,7 +1222,8 @@ x A single character, with no special meaning, matches itself \o40 octal number of character up to 0o377 \x20 hexadecimal number of character up to 0xff \u20AC hex. number of multibyte character up to 0xffff - \U1234 hex. number of multibyte character up to 0xffffffff + \U1234 hex. number of multibyte character up to 8 characters + 0xffffffff |E1541| NOTE: The other backslash codes mentioned above do not work inside []! - Matching with a collection can be slow, because each character in @@ -1262,7 +1264,8 @@ x A single character, with no special meaning, matches itself \%u20AC Matches the character specified with up to four hexadecimal characters. \%U1234abcd Matches the character specified with up to eight hexadecimal - characters, up to 0x7fffffff + characters, up to 0x7fffffff (the maximum allowed value is INT_MAX + |E1541|, but the maximum valid Unicode codepoint is U+10FFFF). ============================================================================== 7. Ignoring case in a pattern */ignorecase* diff --git a/runtime/doc/pi_getscript.txt b/runtime/doc/pi_getscript.txt index 869314ca..e549ea64 100644 --- a/runtime/doc/pi_getscript.txt +++ b/runtime/doc/pi_getscript.txt @@ -1,4 +1,4 @@ -*pi_getscript.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*pi_getscript.txt* For Vim version 9.1. Last change: 2025 Apr 27 > GETSCRIPT REFERENCE MANUAL by Charles E. Campbell < @@ -156,7 +156,7 @@ may have. As an example, consider: > " GetLatestVimScripts: 884 1 :AutoInstall: AutoAlign.vim -This comment line tells getscript.vim to check vimscript #884 and that the +This comment line tells getscript.vim to check Vim script #884 and that the script is automatically installable. Getscript will also use this line to help build the GetLatestVimScripts.dat file, by including a line such as: > @@ -348,38 +348,43 @@ after/syntax/c.vim contained in it to overwrite a user's c.vim. Doesn't override vimball installation. > g:GetLatestVimScripts_scriptaddr -< default='https://www.vim.org/scripts/script.php?script_id=' +< default='https://www.vim.org/scripts/script.php?script_id=' Override this if your system needs ... ='http://vim.sourceforge.net/script.php?script_id=' > g:GetLatestVimScripts_downloadaddr -< default='https://www.vim.org/scripts/download_script.php?src_id=' +< default='https://www.vim.org/scripts/download_script.php?src_id=' Override this if your system needs ... ='http://vim.sourceforge.net/scripts/download_script.php?src_id=' > g:GetLatestVimScripts_bunzip2 -< default= bunzip2 +< default= bunzip2 This variable holds the name of the command to decompress .bz2 files +> + g:GetLatestVimScripts_bunzip3 +< default= bunzip3 + This variable holds the name of the command to decompress .bz3 + files > g:GetLatestVimScripts_gunzip -< default= gunzip +< default= gunzip This variable holds the name of the command to decompress .gz files > g:GetLatestVimScripts_unxz -< default= unxz +< default= unxz This variable holds the name of the command to decompress .xz files > g:GetLatestVimScripts_unzip -< default= unzip +< default= unzip This variable holds the name of the command to decompress .zip files Note: The variables associated with decompression commands help workaround - crossplatform issues. For example, on Windows is possible to delegate this - calls into `wsl` by doing: > + crossplatform issues. For example, on Windows is possible to delegate + this calls into `wsl` by doing: > let g:GetLatestVimScripts_bunzip2= "wsl -e bunzip2" let g:GetLatestVimScripts_gunzip= "wsl -e gunzip" @@ -409,6 +414,8 @@ The AutoInstall process will: Windows: $HOME\vimfiles if the downloaded file ends with ".bz2" bunzip2 it + else if the downloaded file ends with ".bz3" + bunzip3 it else if the downloaded file ends with ".gz" gunzip it if the resulting file ends with ".zip" @@ -422,6 +429,7 @@ The AutoInstall process will: ============================================================================== 9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1 +v38 Feb 25, 2025 : * handles additional decompression option for .bzip3 files. v37 Sep 23, 2024 : * Support for the new vimball's .vmb extension (old .vba extension conflicted with visual basic). * Support for |glvs-autoinstall| in ftplugins and packages. diff --git a/runtime/doc/pi_gzip.txt b/runtime/doc/pi_gzip.txt index 63c547b4..cb4fc6b3 100644 --- a/runtime/doc/pi_gzip.txt +++ b/runtime/doc/pi_gzip.txt @@ -1,4 +1,4 @@ -*pi_gzip.txt* For Vim version 9.1. Last change: 2025 Feb 06 +*pi_gzip.txt* For Vim version 9.1. Last change: 2025 Mar 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -29,6 +29,7 @@ with these extensions: extension compression ~ *.bz2 bzip2 + *.bz3 bzip3 *.gz gzip *.lz lzip *.lz4 lz4 diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt deleted file mode 120000 index 9a5c117e..00000000 --- a/runtime/doc/pi_netrw.txt +++ /dev/null @@ -1 +0,0 @@ -../pack/dist/opt/netrw/doc/netrw.txt \ No newline at end of file diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt new file mode 100644 index 00000000..00799911 --- /dev/null +++ b/runtime/doc/pi_netrw.txt @@ -0,0 +1,3652 @@ +*netrw.txt* *pi_netrw.txt* + + ------------------------------------------------ + NETRW REFERENCE MANUAL by Charles E. Campbell + ------------------------------------------------ +Original Author: Charles E. Campbell + +Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright* + The VIM LICENSE applies to the files in this package, including + netrw.vim, netrw.txt, netrwSettings.vim, and + syntax/netrw.vim. Like anything else that's free, netrw.vim and its + associated files are provided *as is* and comes with no warranty of + any kind, either expressed or implied. No guarantees of + merchantability. No guarantees of suitability for any purpose. By + using this plugin, you agree that in no event will the copyright + holder be liable for any damages resulting from the use of this + software. Use at your own risk! For bug reports, see |bugs|. + + *netrw* + *dav* *ftp* *netrw-file* *rcp* *scp* + *davs* *http* *netrw.vim* *rsync* *sftp* + *fetch* *network* + +============================================================================== +1. Contents *netrw-contents* {{{1 + +1. Contents..............................................|netrw-contents| +2. Starting With Netrw...................................|netrw-start| +3. Netrw Reference.......................................|netrw-ref| + EXTERNAL APPLICATIONS AND PROTOCOLS.................|netrw-externapp| + READING.............................................|netrw-read| + WRITING.............................................|netrw-write| + SOURCING............................................|netrw-source| + DIRECTORY LISTING...................................|netrw-dirlist| + CHANGING THE USERID AND PASSWORD....................|netrw-chgup| + VARIABLES AND SETTINGS..............................|netrw-variables| + PATHS...............................................|netrw-path| +4. Network-Oriented File Transfer........................|netrw-xfer| + NETRC...............................................|netrw-netrc| + PASSWORD............................................|netrw-passwd| +5. Activation............................................|netrw-activate| +6. Transparent Remote File Editing.......................|netrw-transparent| +7. Ex Commands...........................................|netrw-ex| +8. Variables and Options.................................|netrw-variables| +9. Browsing..............................................|netrw-browse| + Introduction To Browsing............................|netrw-intro-browse| + Quick Reference: Maps...............................|netrw-browse-maps| + Quick Reference: Commands...........................|netrw-browse-cmds| + Banner Display......................................|netrw-I| + Bookmarking A Directory.............................|netrw-mb| + Browsing............................................|netrw-cr| + Squeezing the Current Tree-Listing Directory........|netrw-s-cr| + Browsing With A Horizontally Split Window...........|netrw-o| + Browsing With A New Tab.............................|netrw-t| + Browsing With A Vertically Split Window.............|netrw-v| + Change Listing Style (thin wide long tree)..........|netrw-i| + Changing To A Bookmarked Directory..................|netrw-gb| + Quick hide/unhide of dot-files......................|netrw-gh| + Changing local-only File Permission.................|netrw-gp| + Changing To A Predecessor Directory.................|netrw-u| + Changing To A Successor Directory...................|netrw-U| + Deleting Bookmarks..................................|netrw-mB| + Deleting Files Or Directories.......................|netrw-D| + Directory Exploring Commands........................|netrw-explore| + Exploring With Stars and Patterns...................|netrw-star| + Displaying Information About File...................|netrw-qf| + Edit File Or Directory Hiding List..................|netrw-ctrl-h| + Editing The Sorting Sequence........................|netrw-S| + Forcing treatment as a file or directory............|netrw-gd| |netrw-gf| + Going Up............................................|netrw--| + Hiding Files Or Directories.........................|netrw-a| + Improving Browsing..................................|netrw-ssh-hack| + Listing Bookmarks And History.......................|netrw-qb| + Making A New Directory..............................|netrw-d| + Making The Browsing Directory The Current Directory.|netrw-cd| + Marking Files.......................................|netrw-mf| + Unmarking Files.....................................|netrw-mF| + Marking Files By Location List......................|netrw-qL| + Marking Files By QuickFix List......................|netrw-qF| + Marking Files By Regular Expression.................|netrw-mr| + Marked Files: Arbitrary Shell Command...............|netrw-mx| + Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX| + Marked Files: Arbitrary Vim Command.................|netrw-mv| + Marked Files: Argument List.........................|netrw-ma| |netrw-mA| + Marked Files: Buffer List...........................|netrw-cb| |netrw-cB| + Marked Files: Compression And Decompression.........|netrw-mz| + Marked Files: Copying...............................|netrw-mc| + Marked Files: Diff..................................|netrw-md| + Marked Files: Editing...............................|netrw-me| + Marked Files: Grep..................................|netrw-mg| + Marked Files: Hiding and Unhiding by Suffix.........|netrw-mh| + Marked Files: Moving................................|netrw-mm| + Marked Files: Printing..............................|netrw-mp| + Marked Files: Sourcing..............................|netrw-ms| + Marked Files: Setting the Target Directory..........|netrw-mt| + Marked Files: Tagging...............................|netrw-mT| + Marked Files: Target Directory Using Bookmarks......|netrw-Tb| + Marked Files: Target Directory Using History........|netrw-Th| + Marked Files: Unmarking.............................|netrw-mu| + Netrw Browser Variables.............................|netrw-browser-var| + Netrw Browsing And Option Incompatibilities.........|netrw-incompatible| + Netrw Settings Window...............................|netrw-settings-window| + Obtaining A File....................................|netrw-O| + Preview Window......................................|netrw-p| + Previous Window.....................................|netrw-P| + Refreshing The Listing..............................|netrw-ctrl-l| + Reversing Sorting Order.............................|netrw-r| + Renaming Files Or Directories.......................|netrw-R| + Selecting Sorting Style.............................|netrw-s| + Setting Editing Window..............................|netrw-C| +10. Problems and Fixes....................................|netrw-problems| +11. Credits...............................................|netrw-credits| + +============================================================================== +2. Starting With Netrw *netrw-start* {{{1 + +Netrw makes reading files, writing files, browsing over a network, and +local browsing easy! First, make sure that you have plugins enabled, so +you'll need to have at least the following in your <.vimrc>: +(or see |netrw-activate|) > + + set nocp " 'compatible' is not set + filetype plugin on " plugins are enabled +< +(see |'cp'| and |:filetype-plugin-on|) + +Netrw supports "transparent" editing of files on other machines using urls +(see |netrw-transparent|). As an example of this, let's assume you have an +account on some other machine; if you can use scp, try: > + + vim scp://hostname/path/to/file +< +Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|! + +So, what if you have ftp, not ssh/scp? That's easy, too; try > + + vim ftp://hostname/path/to/file +< +Want to make ftp simpler to use? See if your ftp supports a file called +<.netrc> -- typically it goes in your home directory, has read/write +permissions for only the user to read (ie. not group, world, other, etc), +and has lines resembling > + + machine HOSTNAME login USERID password "PASSWORD" + machine HOSTNAME login USERID password "PASSWORD" + ... + default login USERID password "PASSWORD" +< +Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: > + + let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE' +< +Netrw will substitute the host's machine name for "MACHINE" from the URL it is +attempting to open, and so one may specify > + userid + password +for each site in a separate file: c:\Users\MyUserName\MachineName. + +Now about browsing -- when you just want to look around before editing a +file. For browsing on your current host, just "edit" a directory: > + + vim . + vim /home/userid/path +< +For browsing on a remote host, "edit" a directory (but make sure that +the directory name is followed by a "/"): > + + vim scp://hostname/ + vim ftp://hostname/path/to/dir/ +< +See |netrw-browse| for more! + +There are more protocols supported by netrw than just scp and ftp, too: see the +next section, |netrw-externapp|, on how to use these external applications with +netrw and vim. + +PREVENTING LOADING *netrw-noload* + +If you want to use plugins, but for some reason don't wish to use netrw, then +you need to avoid loading both the plugin and the autoload portions of netrw. +You may do so by placing the following two lines in your <.vimrc>: > + + :let g:loaded_netrw = 1 + :let g:loaded_netrwPlugin = 1 +< + +============================================================================== +3. Netrw Reference *netrw-ref* {{{1 + + Netrw supports several protocols in addition to scp and ftp as mentioned + in |netrw-start|. These include dav, fetch, http,... well, just look + at the list in |netrw-externapp|. Each protocol is associated with a + variable which holds the default command supporting that protocol. + +EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2 + + Protocol Variable Default Value + -------- ---------------- ------------- + dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable + dav: g:netrw_dav_cmd = "curl -o" elseif curl is available + fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available + ftp: *g:netrw_ftp_cmd* = "ftp" + http: *g:netrw_http_cmd* = "elinks" if elinks is available + http: g:netrw_http_cmd = "links" elseif links is available + http: g:netrw_http_cmd = "curl" elseif curl is available + http: g:netrw_http_cmd = "wget" elseif wget is available + http: g:netrw_http_cmd = "fetch" elseif fetch is available + http: *g:netrw_http_put_cmd* = "curl -T" + rcp: *g:netrw_rcp_cmd* = "rcp" + rsync: *g:netrw_rsync_cmd* = "rsync" (see |g:netrw_rsync_sep|) + scp: *g:netrw_scp_cmd* = "scp -q" + sftp: *g:netrw_sftp_cmd* = "sftp" + file: *g:netrw_file_cmd* = "elinks" or "links" + + *g:netrw_http_xcmd* : the option string for http://... protocols are + specified via this variable and may be independently overridden. By + default, the option arguments for the http-handling commands are: > + + elinks : "-source >" + links : "-dump >" + curl : "-L -o" + wget : "-q -O" + fetch : "-o" +< + For example, if your system has elinks, and you'd rather see the + page using an attempt at rendering the text, you may wish to have > + let g:netrw_http_xcmd= "-dump >" +< in your .vimrc. + + g:netrw_http_put_cmd: this option specifies both the executable and + any needed options. This command does a PUT operation to the url. + + +READING *netrw-read* *netrw-nread* {{{2 + + Generally, one may just use the URL notation with a normal editing + command, such as > + + :e ftp://[user@]machine/path +< + Netrw also provides the Nread command: + + :Nread ? give help + :Nread "machine:path" uses rcp + :Nread "machine path" uses ftp w/ <.netrc> + :Nread "machine id password path" uses ftp + :Nread "dav://machine[:port]/path" uses cadaver + :Nread "fetch://[user@]machine/path" uses fetch + :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nread "http://[user@]machine/path" uses http uses wget + :Nread "rcp://[user@]machine/path" uses rcp + :Nread "rsync://[user@]machine[:port]/path" uses rsync + :Nread "scp://[user@]machine[[:#]port]/path" uses scp + :Nread "sftp://[user@]machine/path" uses sftp + +WRITING *netrw-write* *netrw-nwrite* {{{2 + + One may just use the URL notation with a normal file writing + command, such as > + + :w ftp://[user@]machine/path +< + Netrw also provides the Nwrite command: + + :Nwrite ? give help + :Nwrite "machine:path" uses rcp + :Nwrite "machine path" uses ftp w/ <.netrc> + :Nwrite "machine id password path" uses ftp + :Nwrite "dav://machine[:port]/path" uses cadaver + :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nwrite "rcp://[user@]machine/path" uses rcp + :Nwrite "rsync://[user@]machine[:port]/path" uses rsync + :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp + :Nwrite "sftp://[user@]machine/path" uses sftp + http: not supported! + +SOURCING *netrw-source* {{{2 + + One may just use the URL notation with the normal file sourcing + command, such as > + + :so ftp://[user@]machine/path +< + Netrw also provides the Nsource command: + + :Nsource ? give help + :Nsource "dav://machine[:port]/path" uses cadaver + :Nsource "fetch://[user@]machine/path" uses fetch + :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nsource "http://[user@]machine/path" uses http uses wget + :Nsource "rcp://[user@]machine/path" uses rcp + :Nsource "rsync://[user@]machine[:port]/path" uses rsync + :Nsource "scp://[user@]machine[[:#]port]/path" uses scp + :Nsource "sftp://[user@]machine/path" uses sftp + +DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2 + + One may browse a directory to get a listing by simply attempting to + edit the directory: > + + :e scp://[user]@hostname/path/ + :e ftp://[user]@hostname/path/ +< + For remote directory listings (ie. those using scp or ftp), that + trailing "/" is necessary (the slash tells netrw to treat the argument + as a directory to browse instead of as a file to download). + + The Nread command may also be used to accomplish this (again, that + trailing slash is necessary): > + + :Nread [protocol]://[user]@hostname/path/ +< + *netrw-login* *netrw-password* +CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2 + + Attempts to use ftp will prompt you for a user-id and a password. + These will be saved in global variables |g:netrw_uid| and + |s:netrw_passwd|; subsequent use of ftp will re-use those two strings, + thereby simplifying use of ftp. However, if you need to use a + different user id and/or password, you'll want to call |NetUserPass()| + first. To work around the need to enter passwords, check if your ftp + supports a <.netrc> file in your home directory. Also see + |netrw-passwd| (and if you're using ssh/scp hoping to figure out how + to not need to use passwords for scp, look at |netrw-ssh-hack|). + + :NetUserPass [uid [password]] -- prompts as needed + :call NetUserPass() -- prompts for uid and password + :call NetUserPass("uid") -- prompts for password + :call NetUserPass("uid","password") -- sets global uid and password + +(Related topics: |ftp| |netrw-userpass| |netrw-start|) + +NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2 + (Also see: + |netrw-browser-var| : netrw browser option variables + |netrw-protocol| : file transfer protocol option variables + |netrw-settings| : additional file transfer options + |netrw-browser-options| : these options affect browsing directories + ) + +Netrw provides a lot of variables which allow you to customize netrw to your +preferences. One way to look at them is via the command :NetrwSettings (see +|netrw-settings|) which will display your current netrw settings. Most such +settings are described below, in |netrw-browser-options|, and in +|netrw-externapp|: + + *b:netrw_lastfile* last file Network-read/written retained on a + per-buffer basis (supports plain :Nw ) + + *g:netrw_bufsettings* the settings that netrw buffers have + (default) noma nomod nonu nowrap ro nobl + + *g:netrw_chgwin* specifies a window number where subsequent file edits + will take place. (also see |netrw-C|) + (default) -1 + + *g:Netrw_funcref* specifies a function (or functions) to be called when + netrw edits a file. The file is first edited, and + then the function reference (|Funcref|) is called. + This variable may also hold a |List| of Funcrefs. + (default) not defined. (the capital in g:Netrw... + is required by its holding a function reference) +> + Example: place in .vimrc; affects all file opening + fun! MyFuncRef() + endfun + let g:Netrw_funcref= function("MyFuncRef") + +< + *g:Netrw_UserMaps* specifies a function or |List| of functions which can + be used to set up user-specified maps and functionality. + See |netrw-usermaps| + + *g:netrw_ftp* if it doesn't exist, use default ftp + =0 use default ftp (uid password) + =1 use alternate ftp method (user uid password) + If you're having trouble with ftp, try changing the + value of this variable to see if the alternate ftp + method works for your setup. + + *g:netrw_ftp_options* Chosen by default, these options are supposed to + turn interactive prompting off and to restrain ftp + from attempting auto-login upon initial connection. + However, it appears that not all ftp implementations + support this (ex. ncftp). + ="-i -n" + + *g:netrw_ftpextracmd* default: doesn't exist + If this variable exists, then any string it contains + will be placed into the commands set to your ftp + client. As an example: + ="passive" + + *g:netrw_ftpmode* ="binary" (default) + ="ascii" + + *g:netrw_ignorenetrc* =0 (default for linux, cygwin) + =1 If you have a <.netrc> file but it doesn't work and + you want it ignored, then set this variable as + shown. (default for Windows + cmd.exe) + + *g:netrw_menu* =0 disable netrw's menu + =1 (default) netrw's menu enabled + + *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis + *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis + + *g:netrw_preview* =0 (default) preview window shown in a horizontally + split window + =1 preview window shown in a vertically split window. + Also affects the "previous window" (see |netrw-P|) + in the same way. + The |g:netrw_alto| variable may be used to provide + additional splitting control: + g:netrw_preview g:netrw_alto result + 0 0 |:aboveleft| + 0 1 |:belowright| + 1 0 |:topleft| + 1 1 |:botright| + To control sizing, see |g:netrw_winsize| + + *g:netrw_scpport* = "-P" : option to use to set port for scp + *g:netrw_sshport* = "-p" : option to use to set port for ssh + + *g:netrw_sepchr* =\0xff + =\0x01 for enc == euc-jp (and perhaps it should be for + others, too, please let me know) + Separates priority codes from filenames internally. + See |netrw-p12|. + + *g:netrw_silent* =0 : transfers done normally + =1 : transfers done silently + + *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also + permits network browsing to use ls with time and + size sorting (default if windows) + =0 assume Windows' scp accepts windows-style paths + Network browsing uses dir instead of ls + This option is ignored if you're using unix + + *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP + =1 use WinNT's rcp in binary mode (default) + +PATHS *netrw-path* {{{2 + +Paths to files are generally user-directory relative for most protocols. +It is possible that some protocol will make paths relative to some +associated directory, however. +> + example: vim scp://user@host/somefile + example: vim scp://user@host/subdir1/subdir2/somefile +< +where "somefile" is in the "user"'s home directory. If you wish to get a +file using root-relative paths, use the full path: +> + example: vim scp://user@host//somefile + example: vim scp://user@host//subdir1/subdir2/somefile +< + +============================================================================== +4. Network-Oriented File Transfer *netrw-xfer* {{{1 + +Network-oriented file transfer under Vim is implemented by a Vim script +() using plugin techniques. It currently supports both reading and +writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, +dav/cadaver, rsync, or sftp. + +http is currently supported read-only via use of wget or fetch. + + is a standard plugin which acts as glue between Vim and the +various file transfer programs. It uses autocommand events (BufReadCmd, +FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. > + + ex. vim ftp://hostname/path/to/file +< +The characters preceding the colon specify the protocol to use; in the +example, it's ftp. The script then formulates a command or a +series of commands (typically ftp) which it issues to an external program +(ftp, scp, etc) which does the actual file transfer/protocol. Files are read +from/written to a temporary file (under Unix/Linux, /tmp/...) which the + script will clean up. + +Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first, +ftp is not a secure protocol. User names and passwords are transmitted "in +the clear" over the internet; any snooper tool can pick these up; this is not +a netrw thing, this is a ftp thing. If you're concerned about this, please +try to use scp or sftp instead. + +Netrw re-uses the user id and password during the same vim session and so long +as the remote hostname remains the same. + +Jan seems to be a bit confused about how netrw handles ftp; normally multiple +commands are performed in a "ftp session", and he seems to feel that the +uid/password should only be retained over one ftp session. However, netrw +does every ftp operation in a separate "ftp session"; so remembering the +uid/password for just one "ftp session" would be the same as not remembering +the uid/password at all. IMHO this would rapidly grow tiresome as one +browsed remote directories, for example. + +On the other hand, thanks go to Jan M. for pointing out the many +vulnerabilities that netrw (and vim itself) had had in handling "crafted" +filenames. The |shellescape()| and |fnameescape()| functions were written in +response by Bram Moolenaar to handle these sort of problems, and netrw has +been modified to use them. Still, my advice is, if the "filename" looks like +a vim command that you aren't comfortable with having executed, don't open it. + + *netrw-putty* *netrw-pscp* *netrw-psftp* +One may modify any protocol's implementing external application by setting a +variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to +"scp -q"). As an example, consider using PuTTY: > + + let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch' + let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"' +< +(note: it has been reported that windows 7 with putty v0.6's "-batch" option + doesn't work, so its best to leave it off for that system) + +See |netrw-p8| for more about putty, pscp, psftp, etc. + +Ftp, an old protocol, seems to be blessed by numerous implementations. +Unfortunately, some implementations are noisy (ie., add junk to the end of the +file). Thus, concerned users may decide to write a NetReadFixup() function +that will clean up after reading with their ftp. Some Unix systems (ie., +FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is +not noisy and more convenient, actually, for to use. +Consequently, if "fetch" is available (ie. executable), it may be preferable +to use it for ftp://... based transfers. + +For rcp, scp, sftp, and http, one may use network-oriented file transfers +transparently; ie. +> + vim rcp://[user@]machine/path + vim scp://[user@]machine/path +< +If your ftp supports <.netrc>, then it too can be transparently used +if the needed triad of machine name, user id, and password are present in +that file. Your ftp must be able to use the <.netrc> file on its own, however. +> + vim ftp://[user@]machine[[:#]portnumber]/path +< +Windows provides an ftp (typically c:\Windows\System32\ftp.exe) which uses +an option, -s:filename (filename can and probably should be a full path) +which contains ftp commands which will be automatically run whenever ftp +starts. You may use this feature to enter a user and password for one site: > + userid + password +< *netrw-windows-netrc* *netrw-windows-s* +If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines +only) netrw will substitute the current machine name requested for ftp +connections for MACHINE. Hence one can have multiple machine.ftp files +containing login and password for ftp. Example: > + + let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' + vim ftp://myhost.somewhere.net/ + +will use a file > + + C:\Users\Myself\myhost.ftp +< +Often, ftp will need to query the user for the userid and password. +The latter will be done "silently"; ie. asterisks will show up instead of +the actually-typed-in password. Netrw will retain the userid and password +for subsequent read/writes from the most recent transfer so subsequent +transfers (read/write) to or from that machine will take place without +additional prompting. + + *netrw-urls* + +=================================+============================+============+ + | Reading | Writing | Uses | + +=================================+============================+============+ + | DAV: | | | + | dav://host/path | | cadaver | + | :Nread dav://host/path | :Nwrite dav://host/path | cadaver | + +---------------------------------+----------------------------+------------+ + | DAV + SSL: | | | + | davs://host/path | | cadaver | + | :Nread davs://host/path | :Nwrite davs://host/path | cadaver | + +---------------------------------+----------------------------+------------+ + | FETCH: | | | + | fetch://[user@]host/path | | | + | fetch://[user@]host:http/path | Not Available | fetch | + | :Nread fetch://[user@]host/path| | | + +---------------------------------+----------------------------+------------+ + | FILE: | | | + | file:///* | file:///* | | + | file://localhost/* | file://localhost/* | | + +---------------------------------+----------------------------+------------+ + | FTP: (*3) | (*3) | | + | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) | + | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc | + | :Nread host path | :Nwrite host path | ftp+.netrc | + | :Nread host uid pass path | :Nwrite host uid pass path | ftp | + +---------------------------------+----------------------------+------------+ + | HTTP: wget is executable: (*4) | | | + | http://[user@]host/path | Not Available | wget | + +---------------------------------+----------------------------+------------+ + | HTTP: fetch is executable (*4) | | | + | http://[user@]host/path | Not Available | fetch | + +---------------------------------+----------------------------+------------+ + | RCP: | | | + | rcp://[user@]host/path | rcp://[user@]host/path | rcp | + +---------------------------------+----------------------------+------------+ + | RSYNC: | | | + | rsync://[user@]host/path | rsync://[user@]host/path | rsync | + | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync | + | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp | + +---------------------------------+----------------------------+------------+ + | SCP: | | | + | scp://[user@]host/path | scp://[user@]host/path | scp | + | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) | + +---------------------------------+----------------------------+------------+ + | SFTP: | | | + | sftp://[user@]host/path | sftp://[user@]host/path | sftp | + | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) | + +=================================+============================+============+ + + (*1) For an absolute path use scp://machine//path. + + (*2) if <.netrc> is present, it is assumed that it will + work with your ftp client. Otherwise the script will + prompt for user-id and password. + + (*3) for ftp, "machine" may be machine#port or machine:port + if a different port is needed than the standard ftp port + + (*4) for http:..., if wget is available it will be used. Otherwise, + if fetch is available it will be used. + +Both the :Nread and the :Nwrite ex-commands can accept multiple filenames. + + +NETRC *netrw-netrc* + +The <.netrc> file, typically located in your home directory, contains lines +therein which map a hostname (machine name) to the user id and password you +prefer to use with it. + +The typical syntax for lines in a <.netrc> file is given as shown below. +Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't. +> + machine {full machine name} login {user-id} password "{password}" + default login {user-id} password "{password}" + +Your ftp client must handle the use of <.netrc> on its own, but if the +<.netrc> file exists, an ftp transfer will not ask for the user-id or +password. + + Note: + Since this file contains passwords, make very sure nobody else can + read this file! Most programs will refuse to use a .netrc that is + readable for others. Don't forget that the system administrator can + still read the file! Ie. for Linux/Unix: chmod 600 .netrc + +Even though Windows' ftp clients typically do not support .netrc, netrw has +a work-around: see |netrw-windows-s|. + + +PASSWORD *netrw-passwd* + +The script attempts to get passwords for ftp invisibly using |inputsecret()|, +a built-in Vim function. See |netrw-userpass| for how to change the password +after one has set it. + +Unfortunately there doesn't appear to be a way for netrw to feed a password to +scp. Thus every transfer via scp will require re-entry of the password. +However, |netrw-ssh-hack| can help with this problem. + + +============================================================================== +5. Activation *netrw-activate* {{{1 + +Network-oriented file transfers are available by default whenever Vim's +|'nocompatible'| mode is enabled. Netrw's script files reside in your +system's plugin, autoload, and syntax directories; just the +plugin/netrwPlugin.vim script is sourced automatically whenever you bring up +vim. The main script in autoload/netrw.vim is only loaded when you actually +use netrw. I suggest that, at a minimum, you have at least the following in +your <.vimrc> customization file: > + + set nocp + if version >= 600 + filetype plugin indent on + endif +< +By also including the following lines in your .vimrc, one may have netrw +immediately activate when using [g]vim without any filenames, showing the +current directory: > + + " Augroup VimStartup: + augroup VimStartup + au! + au VimEnter * if expand("%") == "" | e . | endif + augroup END +< + +============================================================================== +6. Transparent Remote File Editing *netrw-transparent* {{{1 + +Transparent file transfers occur whenever a regular file read or write +(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd| +events) is made. Thus one may read, write, or source files across networks +just as easily as if they were local files! > + + vim ftp://[user@]machine/path + ... + :wq + +See |netrw-activate| for more on how to encourage your vim to use plugins +such as netrw. + +For password-free use of scp:, see |netrw-ssh-hack|. + + +============================================================================== +7. Ex Commands *netrw-ex* {{{1 + +The usual read/write commands are supported. There are also a few +additional commands available. Often you won't need to use Nwrite or +Nread as shown in |netrw-transparent| (ie. simply use > + :e URL + :r URL + :w URL +instead, as appropriate) -- see |netrw-urls|. In the explanations +below, a {netfile} is a URL to a remote file. + + *:Nwrite* *:Nw* +:[range]Nw[rite] Write the specified lines to the current + file as specified in b:netrw_lastfile. + (related: |netrw-nwrite|) + +:[range]Nw[rite] {netfile} [{netfile}]... + Write the specified lines to the {netfile}. + + *:Nread* *:Nr* +:Nr[ead] Read the lines from the file specified in b:netrw_lastfile + into the current buffer. (related: |netrw-nread|) + +:Nr[ead] {netfile} {netfile}... + Read the {netfile} after the current line. + + *:Nsource* *:Ns* +:Ns[ource] {netfile} + Source the {netfile}. + To start up vim using a remote .vimrc, one may use + the following (all on one line) (tnx to Antoine Mechelynck) > + vim -u NORC -N + --cmd "runtime plugin/netrwPlugin.vim" + --cmd "source scp://HOSTNAME/.vimrc" +< (related: |netrw-source|) + +:call NetUserPass() *NetUserPass()* + If g:netrw_uid and s:netrw_passwd don't exist, + this function will query the user for them. + (related: |netrw-userpass|) + +:call NetUserPass("userid") + This call will set the g:netrw_uid and, if + the password doesn't exist, will query the user for it. + (related: |netrw-userpass|) + +:call NetUserPass("userid","passwd") + This call will set both the g:netrw_uid and s:netrw_passwd. + The user-id and password are used by ftp transfers. One may + effectively remove the user-id and password by using empty + strings (ie. ""). + (related: |netrw-userpass|) + +:NetrwSettings This command is described in |netrw-settings| -- used to + display netrw settings and change netrw behavior. + + +============================================================================== +8. Variables and Options *netrw-var* *netrw-settings* {{{1 + +(also see: |netrw-options| |netrw-variables| |netrw-protocol| + |netrw-browser-settings| |netrw-browser-options| ) + +The script provides several variables which act as options to +affect 's file transfer behavior. These variables typically may be +set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|) + *netrw-options* +> + ------------- + Netrw Options + ------------- + Option Meaning + -------------- ----------------------------------------------- +< + b:netrw_col Holds current cursor position (during NetWrite) + g:netrw_cygwin =1 assume scp under windows is from cygwin + (default/windows) + =0 assume scp under windows accepts windows + style paths (default/else) + g:netrw_ftp =0 use default ftp (uid password) + g:netrw_ftpmode ="binary" (default) + ="ascii" (your choice) + g:netrw_ignorenetrc =1 (default) + if you have a <.netrc> file but you don't + want it used, then set this variable. Its + mere existence is enough to cause <.netrc> + to be ignored. + b:netrw_lastfile Holds latest method/machine/path. + b:netrw_line Holds current line number (during NetWrite) + g:netrw_silent =0 transfers done normally + =1 transfers done silently + g:netrw_uid Holds current user-id for ftp. + g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) + =1 use WinNT/2K/XP's rcp, binary mode + ----------------------------------------------------------------------- +< + *netrw-internal-variables* +The script will also make use of the following variables internally, albeit +temporarily. +> + ------------------- + Temporary Variables + ------------------- + Variable Meaning + -------- ------------------------------------ +< + b:netrw_method Index indicating rcp/ftp+.netrc/ftp + w:netrw_method (same as b:netrw_method) + g:netrw_machine Holds machine name parsed from input + b:netrw_fname Holds filename being accessed > + ------------------------------------------------------------ +< + *netrw-protocol* + +Netrw supports a number of protocols. These protocols are invoked using the +variables listed below, and may be modified by the user. +> + ------------------------ + Protocol Control Options + ------------------------ + Option Type Setting Meaning + --------- -------- -------------- --------------------------- +< netrw_ftp variable =doesn't exist userid set by "user userid" + =0 userid set by "user userid" + =1 userid set by "userid" + NetReadFixup function =doesn't exist no change + =exists Allows user to have files + read via ftp automatically + transformed however they wish + by NetReadFixup() + g:netrw_dav_cmd var ="cadaver" if cadaver is executable + g:netrw_dav_cmd var ="curl -o" elseif curl is executable + g:netrw_fetch_cmd var ="fetch -o" if fetch is available + g:netrw_ftp_cmd var ="ftp" + g:netrw_http_cmd var ="fetch -o" if fetch is available + g:netrw_http_cmd var ="wget -O" else if wget is available + g:netrw_http_put_cmd var ="curl -T" + |g:netrw_list_cmd| var ="ssh USEPORT HOSTNAME ls -Fa" + g:netrw_rcp_cmd var ="rcp" + g:netrw_rsync_cmd var ="rsync" + *g:netrw_rsync_sep* var ="/" used to separate the hostname + from the file spec + g:netrw_scp_cmd var ="scp -q" + g:netrw_sftp_cmd var ="sftp" > + ------------------------------------------------------------------------- +< + *netrw-ftp* + +The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|) +specify the external program to use handle the ftp protocol. They may +include command line options (such as -p for passive mode). Example: > + + let g:netrw_ftp_cmd= "ftp -p" +< +Browsing is supported by using the |g:netrw_list_cmd|; the substring +"HOSTNAME" will be changed via substitution with whatever the current request +is for a hostname. + +Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's +that give trouble . In order to best understand how to use these options if +ftp is giving you troubles, a bit of discussion is provided on how netrw does +ftp reads. + +For ftp, netrw typically builds up lines of one of the following formats in a +temporary file: +> + IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 + ---------------------------------- ------------------------------ +< + open machine [port] open machine [port] + user userid password userid password + [g:netrw_ftpmode] password + [g:netrw_ftpextracmd] [g:netrw_ftpmode] + get filename tempfile [g:netrw_extracmd] + get filename tempfile > + --------------------------------------------------------------------- +< +The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional. + +Netrw then executes the lines above by use of a filter: +> + :%! {g:netrw_ftp_cmd} -i [-n] +< +where + g:netrw_ftp_cmd is usually "ftp", + -i tells ftp not to be interactive + -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>) + +If <.netrc> exists it will be used to avoid having to query the user for +userid and password. The transferred file is put into a temporary file. +The temporary file is then read into the main editing session window that +requested it and the temporary file deleted. + +If your ftp doesn't accept the "user" command and immediately just demands a +userid, then try putting "let netrw_ftp=1" in your <.vimrc>. + + *netrw-cadaver* +To handle the SSL certificate dialog for untrusted servers, one may pull +down the certificate and place it into /usr/ssl/cert.pem. This operation +renders the server treatment as "trusted". + + *netrw-fixup* *netreadfixup* +If your ftp for whatever reason generates unwanted lines (such as AUTH +messages) you may write a NetReadFixup() function: +> + function! NetReadFixup(method,line1,line2) + " a:line1: first new line in current file + " a:line2: last new line in current file + if a:method == 1 "rcp + elseif a:method == 2 "ftp + <.netrc> + elseif a:method == 3 "ftp + machine,uid,password,filename + elseif a:method == 4 "scp + elseif a:method == 5 "http/wget + elseif a:method == 6 "dav/cadaver + elseif a:method == 7 "rsync + elseif a:method == 8 "fetch + elseif a:method == 9 "sftp + else " complain + endif + endfunction +> +The NetReadFixup() function will be called if it exists and thus allows you to +customize your reading process. + +(Related topics: |ftp| |netrw-userpass| |netrw-start|) + +============================================================================== +9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1 + *netrw-browser* *netrw-dir* *netrw-list* + +INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2 + (Quick References: |netrw-quickmaps| |netrw-quickcoms|) + +Netrw supports the browsing of directories on your local system and on remote +hosts; browsing includes listing files and directories, entering directories, +editing files therein, deleting files/directories, making new directories, +moving (renaming) files and directories, copying files and directories, etc. +One may mark files and execute any system command on them! The Netrw browser +generally implements the previous explorer's maps and commands for remote +directories, although details (such as pertinent global variable names) +necessarily differ. To browse a directory, simply "edit" it! > + + vim /your/directory/ + vim . + vim c:\your\directory\ +< +(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t| + |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| ) + +The Netrw remote file and directory browser handles two protocols: ssh and +ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp +in its remote browsing. Specifying any other protocol will cause it to be +used for file transfers; but the ssh protocol will be used to do remote +browsing. + +To use Netrw's remote directory browser, simply attempt to read a "file" with +a trailing slash and it will be interpreted as a request to list a directory: +> + vim [protocol]://[user@]hostname/path/ +< +where [protocol] is typically scp or ftp. As an example, try: > + + vim ftp://ftp.home.vim.org/pub/vim/ +< +For local directories, the trailing slash is not required. Again, because it's +easy to miss: to browse remote directories, the URL must terminate with a +slash! + +If you'd like to avoid entering the password repeatedly for remote directory +listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with +ftp, see |netrw-netrc| (if your ftp supports it). + +There are several things you can do to affect the browser's display of files: + + * To change the listing style, press the "i" key (|netrw-i|). + Currently there are four styles: thin, long, wide, and tree. + To make that change "permanent", see |g:netrw_liststyle|. + + * To hide files (don't want to see those xyz~ files anymore?) see + |netrw-ctrl-h|. + + * Press s to sort files by name, time, or size. + +See |netrw-browse-cmds| for all the things you can do with netrw! + + *netrw-getftype* *netrw-filigree* *netrw-ftype* +The |getftype()| function is used to append a bit of filigree to indicate +filetype to locally listed files: + + directory : / + executable : * + fifo : | + links : @ + sockets : = + +The filigree also affects the |g:netrw_sort_sequence|. + + +QUICK HELP *netrw-quickhelp* {{{2 + (Use ctrl-] to select a topic)~ + Intro to Browsing...............................|netrw-intro-browse| + Quick Reference: Maps.........................|netrw-quickmap| + Quick Reference: Commands.....................|netrw-browse-cmds| + Hiding + Edit hiding list..............................|netrw-ctrl-h| + Hiding Files or Directories...................|netrw-a| + Hiding/Unhiding by suffix.....................|netrw-mh| + Hiding dot-files.............................|netrw-gh| + Listing Style + Select listing style (thin/long/wide/tree)....|netrw-i| + Associated setting variable...................|g:netrw_liststyle| + Shell command used to perform listing.........|g:netrw_list_cmd| + Quick file info...............................|netrw-qf| + Sorted by + Select sorting style (name/time/size).........|netrw-s| + Editing the sorting sequence..................|netrw-S| + Sorting options...............................|g:netrw_sort_options| + Associated setting variable...................|g:netrw_sort_sequence| + Reverse sorting order.........................|netrw-r| + + + *netrw-quickmap* *netrw-quickmaps* +QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 +> + --- ----------------- ---- + Map Quick Explanation Link + --- ----------------- ---- +< Causes Netrw to issue help + Netrw will enter the directory or read the file |netrw-cr| + Netrw will attempt to remove the file/directory |netrw-del| + Edit file hiding list |netrw-ctrl-h| + Causes Netrw to refresh the directory listing |netrw-ctrl-l| + Browse using a gvim server |netrw-ctrl-r| + Shrink/expand a netrw/explore window |netrw-c-tab| + - Makes Netrw go up one directory |netrw--| + a Cycles between normal display, |netrw-a| + hiding (suppress display of files matching g:netrw_list_hide) + and showing (display only files which match g:netrw_list_hide) + cd Make browsing directory the current directory |netrw-cd| + C Setting the editing window |netrw-C| + d Make a directory |netrw-d| + D Attempt to remove the file(s)/directory(ies) |netrw-D| + gb Go to previous bookmarked directory |netrw-gb| + gd Force treatment as directory |netrw-gd| + gf Force treatment as file |netrw-gf| + gh Quick hide/unhide of dot-files |netrw-gh| + gn Make top of tree the directory below the cursor |netrw-gn| + gp Change local-only file permissions |netrw-gp| + i Cycle between thin, long, wide, and tree listings |netrw-i| + I Toggle the displaying of the banner |netrw-I| + mb Bookmark current directory |netrw-mb| + mc Copy marked files to marked-file target directory |netrw-mc| + md Apply diff to marked files (up to 3) |netrw-md| + me Place marked files on arg list and edit them |netrw-me| + mf Mark a file |netrw-mf| + mF Unmark files |netrw-mF| + mg Apply vimgrep to marked files |netrw-mg| + mh Toggle marked file suffices' presence on hiding list |netrw-mh| + mm Move marked files to marked-file target directory |netrw-mm| + mp Print marked files |netrw-mp| + mr Mark files using a shell-style |regexp| |netrw-mr| + mt Current browsing directory becomes markfile target |netrw-mt| + mT Apply ctags to marked files |netrw-mT| + mu Unmark all marked files |netrw-mu| + mv Apply arbitrary vim command to marked files |netrw-mv| + mx Apply arbitrary shell command to marked files |netrw-mx| + mX Apply arbitrary shell command to marked files en bloc|netrw-mX| + mz Compress/decompress marked files |netrw-mz| + o Enter the file/directory under the cursor in a new |netrw-o| + browser window. A horizontal split is used. + O Obtain a file specified by cursor |netrw-O| + p Preview the file |netrw-p| + P Browse in the previously used window |netrw-P| + qb List bookmarked directories and history |netrw-qb| + qf Display information on file |netrw-qf| + qF Mark files using a quickfix list |netrw-qF| + qL Mark files using a |location-list| |netrw-qL| + r Reverse sorting order |netrw-r| + R Rename the designated file(s)/directory(ies) |netrw-R| + s Select sorting style: by name, time, or file size |netrw-s| + S Specify suffix priority for name-sorting |netrw-S| + t Enter the file/directory under the cursor in a new tab|netrw-t| + u Change to recently-visited directory |netrw-u| + U Change to subsequently-visited directory |netrw-U| + v Enter the file/directory under the cursor in a new |netrw-v| + browser window. A vertical split is used. + x View file with an associated program |:Open| + X Execute filename under cursor via |system()| |netrw-X| + + % Open a new file in netrw's current directory |netrw-%| + + *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse* + (gvim only) selects word under mouse as if a + had been pressed (ie. edit file, change directory) + (gvim only) same as P selecting word under mouse; + see |netrw-P| + (gvim only) delete file/directory using word under + mouse + <2-leftmouse> (gvim only) when: + * in a netrw-selected file, AND + * |g:netrw_retmap| == 1 AND + * the user doesn't already have a <2-leftmouse> + mapping defined before netrw is autoloaded, + then a double clicked leftmouse button will return + to the netrw browser window. See |g:netrw_retmap|. + (gvim only) like mf, will mark files. Dragging + the shifted leftmouse will mark multiple files. + (see |netrw-mf|) + + (to disable mouse buttons while browsing: |g:netrw_mousemaps|) + + *netrw-quickcom* *netrw-quickcoms* +QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2 + :NetrwSettings............................................|netrw-settings| + :Ntree....................................................|netrw-ntree| + :Explore[!] [dir] Explore directory of current file......|netrw-explore| + :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore| + :Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore| + :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + :Rexplore Return to Explorer.....................|netrw-explore| + :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore| + :Texplore[!] [dir] Tab & Explore..........................|netrw-explore| + :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + + +BANNER DISPLAY *netrw-I* + +One may toggle the displaying of the banner by pressing "I". + +Also See: |g:netrw_banner| + + +BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2 + +One may easily "bookmark" the currently browsed directory by using > + + mb +< + *.netrwbook* +Bookmarks are retained in between sessions of vim in a file called .netrwbook +as a |List|, which is typically stored in the first directory on the user's +'runtimepath'; entries are kept in sorted order. + +If there are marked files and/or directories, mb will add them to the bookmark +list. + + *netrw-:NetrwMB* +Additionally, one may use :NetrwMB to bookmark files or directories. > + + :NetrwMB[!] [files/directories] + +< No bang: enters files/directories into Netrw's bookmark system + + No argument and in netrw buffer: + if there are marked files : bookmark marked files + otherwise : bookmark file/directory under cursor + No argument and not in netrw buffer: bookmarks current open file + Has arguments : |glob()|s each arg and bookmarks them + + With bang: deletes files/directories from Netrw's bookmark system + +The :NetrwMB command is available outside of netrw buffers (once netrw has been +invoked in the session). + +The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By +default, its stored on the first directory on the user's |'runtimepath'|. + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mB| how to delete bookmarks + |netrw-qb| how to list bookmarks + |g:netrw_home| controls where .netrwbook is kept + + +BROWSING *netrw-enter* *netrw-cr* {{{2 + +Browsing is simple: move the cursor onto a file or directory of interest. +Hitting the (the return key) will select the file or directory. +Directories will themselves be listed, and files will be opened using the +protocol given in the original read request. + + CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that + two or more spaces delimit filenames and directory names for the long and + wide listing formats. Thus, if your filename or directory name has two or + more sequential spaces embedded in it, or any trailing spaces, then you'll + need to use the "thin" format to select it. + +The |g:netrw_browse_split| option, which is zero by default, may be used to +cause the opening of files to be done in a new window or tab instead of the +default. When the option is one or two, the splitting will be taken +horizontally or vertically, respectively. When the option is set to three, a + will cause the file to appear in a new tab. + + +When using the gui (gvim), one may select a file by pressing the +button. In addition, if + + * |g:netrw_retmap| == 1 AND (its default value is 0) + * in a netrw-selected file, AND + * the user doesn't already have a <2-leftmouse> mapping defined before + netrw is loaded + +then a doubly-clicked leftmouse button will return to the netrw browser +window. + +Netrw attempts to speed up browsing, especially for remote browsing where one +may have to enter passwords, by keeping and re-using previously obtained +directory listing buffers. The |g:netrw_fastbrowse| variable is used to +control this behavior; one may have slow browsing (no buffer re-use), medium +speed browsing (re-use directory buffer listings only for remote directories), +and fast browsing (re-use directory buffer listings as often as possible). +The price for such re-use is that when changes are made (such as new files +are introduced into a directory), the listing may become out-of-date. One may +always refresh directory listing buffers by pressing ctrl-L (see +|netrw-ctrl-l|). + + *netrw-s-cr* +Squeezing the Current Tree-Listing Directory~ + +When the tree listing style is enabled (see |netrw-i|) and one is using +gvim, then the mapping may be used to squeeze (close) the +directory currently containing the cursor. + +Otherwise, one may remap a key combination of one's own choice to get +this effect: > + + nmap YOURKEYCOMBO NetrwTreeSqueeze +< +Put this line in $HOME/ftplugin/netrw/netrw.vim; it needs to be generated +for netrw buffers only. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_browse_split| |g:netrw_fastbrowse| + |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| + |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_browse_reject| + |g:netrw_ssh_cmd| |g:netrw_use_noswf| + + +BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2 + +Normally one enters a file or directory using the . However, the "o" map +allows one to open a new window to hold the new directory listing or file. A +horizontal split is used. (for vertical splitting, see |netrw-v|) + +Normally, the o key splits the window horizontally with the new window and +cursor at the top. + +Associated setting variables: |g:netrw_alto| |g:netrw_winsize| + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_alto| control above/below splitting + |g:netrw_winsize| control initial sizing + +BROWSING WITH A NEW TAB *netrw-t* {{{2 + +Normally one enters a file or directory using the . The "t" map +allows one to open a new window holding the new directory listing or file in +a new tab. + +If you'd like to have the new listing in a background tab, use |gT|. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_winsize| control initial sizing + +BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2 + +Normally one enters a file or directory using the . However, the "v" map +allows one to open a new window to hold the new directory listing or file. A +vertical split is used. (for horizontal splitting, see |netrw-o|) + +Normally, the v key splits the window vertically with the new window and +cursor at the left. + +There is only one tree listing buffer; using "v" on a displayed subdirectory +will split the screen, but the same buffer will be shown twice. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_altv| control right/left splitting + |g:netrw_winsize| control initial sizing + + +BROWSING USING A GVIM SERVER *netrw-ctrl-r* {{{2 + +One may keep a browsing gvim separate from the gvim being used to edit. +Use the map on a file (not a directory) in the netrw browser, and it +will use a gvim server (see |g:netrw_servername|). Subsequent use of +(see |netrw-cr|) will re-use that server for editing files. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_servername| : sets name of server + |g:netrw_browse_split| : controls how will open files + + +CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2 + +The "i" map cycles between the thin, long, wide, and tree listing formats. + +The thin listing format gives just the files' and directories' names. + +The long listing is either based on the "ls" command via ssh for remote +directories or displays the filename, file size (in bytes), and the time and +date of last modification for local directories. With the long listing +format, netrw is not able to recognize filenames which have trailing spaces. +Use the thin listing format for such files. + +The wide listing format uses two or more contiguous spaces to delineate +filenames; when using that format, netrw won't be able to recognize or use +filenames which have two or more contiguous spaces embedded in the name or any +trailing spaces. The thin listing format will, however, work with such files. +The wide listing format is the most compact. + +The tree listing format has a top directory followed by files and directories +preceded by one or more "|"s, which indicate the directory depth. One may +open and close directories by pressing the key while atop the directory +name. + +One may make a preferred listing style your default; see |g:netrw_liststyle|. +As an example, by putting the following line in your .vimrc, > + let g:netrw_liststyle= 3 +the tree style will become your default listing style. + +One typical way to use the netrw tree display is to: > + + vim . + (use i until a tree display shows) + navigate to a file + v (edit as desired in vertically split window) + ctrl-w h (to return to the netrw listing) + P (edit newly selected file in the previous window) + ctrl-w h (to return to the netrw listing) + P (edit newly selected file in the previous window) + ...etc... +< +Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen| + |g:netrw_timefmt| |g:netrw_list_cmd| + +CHANGE FILE PERMISSION *netrw-gp* {{{2 + +"gp" will ask you for a new permission for the file named under the cursor. +Currently, this only works for local files. + +Associated setting variables: |g:netrw_chgperm| + + +CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2 + +To change directory back to a bookmarked directory, use + + {cnt}gb + +Any count may be used to reference any of the bookmarks. +Note that |netrw-qb| shows both bookmarks and history; to go +to a location stored in the history see |netrw-u| and |netrw-U|. + +Related Topics: + |netrw-mB| how to delete bookmarks + |netrw-mb| how to make a bookmark + |netrw-qb| how to list bookmarks + + +CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2 + +Every time you change to a new directory (new for the current session), netrw +will save the directory in a recently-visited directory history list (unless +|g:netrw_dirhistmax| is zero; by default, it holds ten entries). With the "u" +map, one can change to an earlier directory (predecessor). To do the +opposite, see |netrw-U|. + +The "u" map also accepts counts to go back in the history several slots. For +your convenience, qb (see |netrw-qb|) lists the history number which may be +used in that count. + + *.netrwhist* +See |g:netrw_dirhistmax| for how to control the quantity of history stack +slots. The file ".netrwhist" holds history when netrw (and vim) is not +active. By default, its stored on the first directory on the user's +|'runtimepath'|. + +Related Topics: + |netrw-U| changing to a successor directory + |g:netrw_home| controls where .netrwhist is kept + + +CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2 + +With the "U" map, one can change to a later directory (successor). +This map is the opposite of the "u" map. (see |netrw-u|) Use the +qb map to list both the bookmarks and history. (see |netrw-qb|) + +The "U" map also accepts counts to go forward in the history several slots. + +See |g:netrw_dirhistmax| for how to control the quantity of history stack +slots. + + +CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2 + +One may specify a new tree top for tree listings using > + + :Ntree [dirname] + +Without a "dirname", the current line is used (and any leading depth +information is elided). +With a "dirname", the specified directory name is used. + +The "gn" map will take the word below the cursor and use that for +changing the top of the tree listing. + + *netrw-curdir* +DELETING BOOKMARKS *netrw-mB* {{{2 + +To delete a bookmark, use > + + {cnt}mB + +If there are marked files, then mB will remove them from the +bookmark list. + +Alternatively, one may use :NetrwMB! (see |netrw-:NetrwMB|). > + + :NetrwMB! [files/directories] + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mb| how to make a bookmark + |netrw-qb| how to list bookmarks + + +DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2 + +If files have not been marked with |netrw-mf|: (local marked file list) + + Deleting/removing files and directories involves moving the cursor to the + file/directory to be deleted and pressing "D". Directories must be empty + first before they can be successfully removed. If the directory is a + softlink to a directory, then netrw will make two requests to remove the + directory before succeeding. Netrw will ask for confirmation before doing + the removal(s). You may select a range of lines with the "V" command + (visual selection), and then pressing "D". + +If files have been marked with |netrw-mf|: (local marked file list) + + Marked files (and empty directories) will be deleted; again, you'll be + asked to confirm the deletion before it actually takes place. + +A further approach is to delete files which match a pattern. + + * use :MF pattern (see |netrw-:MF|); then press "D". + + * use mr (see |netrw-mr|) which will prompt you for pattern. + This will cause the matching files to be marked. Then, + press "D". + +Please note that only empty directories may be deleted with the "D" mapping. +Regular files are deleted with |delete()|, too. + +The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are +used to control the attempts to remove remote files and directories. The +g:netrw_rm_cmd is used with files, and its default value is: + + g:netrw_rm_cmd: ssh HOSTNAME rm + +The g:netrw_rmdir_cmd variable is used to support the removal of directories. +Its default value is: + + |g:netrw_rmdir_cmd|: ssh HOSTNAME rmdir + +If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt +to remove it again using the g:netrw_rmf_cmd variable. Its default value is: + + |g:netrw_rmf_cmd|: ssh HOSTNAME rm -f + +Related topics: |netrw-d| +Associated setting variable: |g:netrw_rm_cmd| |g:netrw_ssh_cmd| + + +*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore* +*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore* *netrw-lexplore* +DIRECTORY EXPLORATION COMMANDS {{{2 + + :[N]Explore[!] [dir]... Explore directory of current file *:Explore* + :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore* + :[N]Lexplore[!] [dir]... Left Explorer Toggle *:Lexplore* + :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore* + :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore* + :Texplore [dir]... Tab & Explore *:Texplore* + :Rexplore ... Return to/from Explorer *:Rexplore* + + Used with :Explore **/pattern : (also see |netrw-starstar|) + :Nexplore............. go to next matching file *:Nexplore* + :Pexplore............. go to previous matching file *:Pexplore* + + *netrw-:Explore* +:Explore will open the local-directory browser on the current file's + directory (or on directory [dir] if specified). The window will be + split only if the file has been modified and |'hidden'| is not set, + otherwise the browsing window will take over that window. Normally + the splitting is taken horizontally. + Also see: |netrw-:Rexplore| +:Explore! is like :Explore, but will use vertical splitting. + + *netrw-:Hexplore* +:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting. +:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting. + + *netrw-:Lexplore* +:[N]Lexplore [dir] toggles a full height Explorer window on the left hand side + of the current tab. It will open a netrw window on the current + directory if [dir] is omitted; a :Lexplore [dir] will show the + specified directory in the left-hand side browser display no matter + from which window the command is issued. + + By default, :Lexplore will change an uninitialized |g:netrw_chgwin| + to 2; edits will thus preferentially be made in window#2. + + The [N] specifies a |g:netrw_winsize| just for the new :Lexplore + window. That means that + if [N] < 0 : use |N| columns for the Lexplore window + if [N] = 0 : a normal split is made + if [N] > 0 : use N% of the current window will be used for the + new window + + Those who like this method often also like tree style displays; + see |g:netrw_liststyle|. + +:[N]Lexplore! [dir] is similar to :Lexplore, except that the full-height + Explorer window will open on the right hand side and an + uninitialized |g:netrw_chgwin| will be set to 1 (eg. edits will + preferentially occur in the leftmost window). + + Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw| + |netrw-p| |netrw-P| |g:netrw_chgwin| + |netrw-c-tab| |g:netrw_winsize| + + *netrw-:Sexplore* +:[N]Sexplore will always split the window before invoking the local-directory + browser. As with Explore, the splitting is normally done + horizontally. +:[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically. + + *netrw-:Texplore* +:Texplore [dir] does a |:tabnew| before generating the browser window + + *netrw-:Vexplore* +:[N]Vexplore [dir] does an :Explore with |:leftabove| vertical splitting. +:[N]Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting. + +The optional parameters are: + + [N]: This parameter will override |g:netrw_winsize| to specify the quantity of + rows and/or columns the new explorer window should have. + Otherwise, the |g:netrw_winsize| variable, if it has been specified by the + user, is used to control the quantity of rows and/or columns new + explorer windows should have. + + [dir]: By default, these explorer commands use the current file's directory. + However, one may explicitly provide a directory (path) to use instead; + ie. > + + :Explore /some/path +< + *netrw-:Rexplore* +:Rexplore This command is a little different from the other Explore commands + as it doesn't necessarily open an Explorer window. + + Return to Explorer~ + When one edits a file using netrw which can occur, for example, + when pressing while the cursor is atop a filename in a netrw + browser window, a :Rexplore issued while editing that file will + return the display to that of the last netrw browser display in + that window. + + Return from Explorer~ + Conversely, when one is editing a directory, issuing a :Rexplore + will return to editing the file that was last edited in that + window. + + The <2-leftmouse> map (which is only available under gvim and + cooperative terms) does the same as :Rexplore. + +Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize| + + +*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* *netrw-grep* +EXPLORING WITH STARS AND PATTERNS {{{2 + +When Explore, Sexplore, Hexplore, or Vexplore are used with one of the +following four patterns Explore generates a list of files which satisfy the +request for the local file system. These exploration patterns will not work +with remote file browsing. + + */filepat files in current directory which satisfy filepat + **/filepat files in current directory or below which satisfy the + file pattern + *//pattern files in the current directory which contain the + pattern (vimgrep is used) + **//pattern files in the current directory or below which contain + the pattern (vimgrep is used) +< +The cursor will be placed on the first file in the list. One may then +continue to go to subsequent files on that list via |:Nexplore| or to +preceding files on that list with |:Pexplore|. Explore will update the +directory and place the cursor appropriately. + +A plain > + :Explore +will clear the explore list. + +If your console or gui produces recognizable shift-up or shift-down sequences, +then you'll likely find using shift-downarrow and shift-uparrow convenient. +They're mapped by netrw as follows: + + == Nexplore, and + == Pexplore. + +As an example, consider +> + :Explore */*.c + :Nexplore + :Nexplore + :Pexplore +< +The status line will show, on the right hand side of the status line, a +message like "Match 3 of 20". + +Associated setting variables: + |g:netrw_keepdir| |g:netrw_browse_split| + |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject| + |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| + |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd| + |g:netrw_liststyle| + + +DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2 + +With the cursor atop a filename, pressing "qf" will reveal the file's size +and last modification timestamp. Currently this capability is only available +for local files. + + +EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2 + +The "" map brings up a requestor allowing the user to change the +file/directory hiding list contained in |g:netrw_list_hide|. The hiding list +consists of one or more patterns delimited by commas. Files and/or +directories satisfying these patterns will either be hidden (ie. not shown) or +be the only ones displayed (see |netrw-a|). + +The "gh" mapping (see |netrw-gh|) quickly alternates between the usual +hiding list and the hiding of files or directories that begin with ".". + +As an example, > + let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' +Effectively, this makes the effect of a |netrw-gh| command the initial setting. +What it means: + + \(^\|\s\s\) : if the line begins with the following, -or- + two consecutive spaces are encountered + \zs : start the hiding match now + \. : if it now begins with a dot + \S\+ : and is followed by one or more non-whitespace + characters + +Associated setting variables: |g:netrw_hide| |g:netrw_list_hide| +Associated topics: |netrw-a| |netrw-gh| |netrw-mh| + + *netrw-sort-sequence* +EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2 + +When "Sorted by" is name, one may specify priority via the sorting sequence +(g:netrw_sort_sequence). The sorting sequence typically prioritizes the +name-listing by suffix, although any pattern will do. Patterns are delimited +by commas. The default sorting sequence is (all one line): + +For Unix: > + '[\/]$,\ + '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$, + \.swp$,\.bak$,\~$' +< +The lone * is where all filenames not covered by one of the other patterns +will end up. One may change the sorting sequence by modifying the +g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by +using the "S" map. + +Related topics: |netrw-s| |netrw-S| +Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options| + + +EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X* {{{2 + +Pressing X while the cursor is atop an executable file will yield a prompt +using the filename asking for any arguments. Upon pressing a [return], netrw +will then call |system()| with that command and arguments. The result will be +displayed by |:echomsg|, and so |:messages| will repeat display of the result. +Ansi escape sequences will be stripped out. + +See |cmdline-window| for directions for more on how to edit the arguments. + + +FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2 + +Remote symbolic links (ie. those listed via ssh or ftp) are problematic +in that it is difficult to tell whether they link to a file or to a +directory. + +To force treatment as a file: use > + gf +< +To force treatment as a directory: use > + gd +< + +GOING UP *netrw--* {{{2 + +To go up a directory, press "-" or press the when atop the ../ directory +entry in the listing. + +Netrw will use the command in |g:netrw_list_cmd| to perform the directory +listing operation after changing HOSTNAME to the host specified by the +user-prpvided url. By default netrw provides the command as: > + + ssh HOSTNAME ls -FLa +< +where the HOSTNAME becomes the [user@]hostname as requested by the attempt to +read. Naturally, the user may override this command with whatever is +preferred. The NetList function which implements remote browsing +expects that directories will be flagged by a trailing slash. + + +HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2 + +Netrw's browsing facility allows one to use the hiding list in one of three +ways: ignore it, hide files which match, and show only those files which +match. + +If no files have been marked via |netrw-mf|: + +The "a" map allows the user to cycle through the three hiding modes. + +The |g:netrw_list_hide| variable holds a comma delimited list of patterns +based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list. +(also see |netrw-ctrl-h|) To set the hiding list, use the map. As an +example, to hide files which begin with a ".", one may use the map to +set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*' +in one's <.vimrc>). One may then use the "a" key to show all files, hide +matching files, or to show only the matching files. + + Example: \.[ch]$ + This hiding list command will hide/show all *.c and *.h files. + + Example: \.c$,\.h$ + This hiding list command will also hide/show all *.c and *.h + files. + +Don't forget to use the "a" map to select the mode (normal/hiding/show) you +want! + +If files have been marked using |netrw-mf|, then this command will: + + if showing all files or non-hidden files: + modify the g:netrw_list_hide list by appending the marked files to it + and showing only non-hidden files. + + else if showing hidden files only: + modify the g:netrw_list_hide list by removing the marked files from it + and showing only non-hidden files. + endif + + *netrw-gh* *netrw-hide* +As a quick shortcut, one may press > + gh +to toggle between hiding files which begin with a period (dot) and not hiding +them. + +Associated setting variables: |g:netrw_list_hide| |g:netrw_hide| +Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh| + + *netrw-gitignore* +Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with +|g:netrw_list_hide| automatically hides all git-ignored files. + +'netrw_gitignore#Hide' searches for patterns in the following files: > + + './.gitignore' + './.git/info/exclude' + global gitignore file: `git config --global core.excludesfile` + system gitignore file: `git config --system core.excludesfile` +< +Files that do not exist, are ignored. +Git-ignore patterns are taken from existing files, and converted to patterns for +hiding files. For example, if you had '*.log' in your '.gitignore' file, it +would be converted to '.*\.log'. + +To use this function, simply assign its output to |g:netrw_list_hide| option. > + + Example: let g:netrw_list_hide= netrw_gitignore#Hide() + Git-ignored files are hidden in Netrw. + + Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file') + Function can take additional files with git-ignore patterns. + + Example: let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' + Combining 'netrw_gitignore#Hide' with custom patterns. +< + +IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2 + +Especially with the remote directory browser, constantly entering the password +is tedious. + +For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength +tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip +for setting up no-password ssh and scp and discusses associated security +issues. It used to be available at http://hacks.oreilly.com/pub/h/66 , +but apparently that address is now being redirected to some "hackzine". +I'll attempt a summary based on that article and on a communication from +Ben Schmidt: + + 1. Generate a public/private key pair on the local machine + (ssh client): > + ssh-keygen -t rsa + (saving the file in ~/.ssh/id_rsa as prompted) +< + 2. Just hit the when asked for passphrase (twice) for no + passphrase. If you do use a passphrase, you will also need to use + ssh-agent so you only have to type the passphrase once per session. + If you don't use a passphrase, simply logging onto your local + computer or getting access to the keyfile in any way will suffice + to access any ssh servers which have that key authorized for login. + + 3. This creates two files: > + ~/.ssh/id_rsa + ~/.ssh/id_rsa.pub +< + 4. On the target machine (ssh server): > + cd + mkdir -p .ssh + chmod 0700 .ssh +< + 5. On your local machine (ssh client): (one line) > + ssh {serverhostname} + cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub +< + or, for OpenSSH, (one line) > + ssh {serverhostname} + cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub +< +You can test it out with > + ssh {serverhostname} +and you should be log onto the server machine without further need to type +anything. + +If you decided to use a passphrase, do: > + ssh-agent $SHELL + ssh-add + ssh {serverhostname} +You will be prompted for your key passphrase when you use ssh-add, but not +subsequently when you use ssh. For use with vim, you can use > + ssh-agent vim +and, when next within vim, use > + :!ssh-add +Alternatively, you can apply ssh-agent to the terminal you're planning on +running vim in: > + ssh-agent xterm & +and do ssh-add whenever you need. + +For Windows, folks on the vim mailing list have mentioned that Pageant helps +with avoiding the constant need to enter the password. + +Kingston Fung wrote about another way to avoid constantly needing to enter +passwords: + + In order to avoid the need to type in the password for scp each time, you + provide a hack in the docs to set up a non password ssh account. I found a + better way to do that: I can use a regular ssh account which uses a + password to access the material without the need to key-in the password + each time. It's good for security and convenience. I tried ssh public key + authorization + ssh-agent, implementing this, and it works! + + + Ssh hints: + + Thomer Gil has provided a hint on how to speed up netrw+ssh: + http://thomer.com/howtos/netrw_ssh.html + + Alex Young has several hints on speeding ssh up: + http://usevim.com/2012/03/16/editing-remote-files/ + + +LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2 + +Pressing "qb" (query bookmarks) will list both the bookmarked directories and +directory traversal history. + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mb| how to make a bookmark + |netrw-mB| how to delete bookmarks + |netrw-u| change to a predecessor directory via the history stack + |netrw-U| change to a successor directory via the history stack + +MAKING A NEW DIRECTORY *netrw-d* {{{2 + +With the "d" map one may make a new directory either remotely (which depends +on the global variable g:netrw_mkdir_cmd) or locally (which depends on the +global variable g:netrw_localmkdir). Netrw will issue a request for the new +directory's name. A bare at that point will abort the making of the +directory. Attempts to make a local directory that already exists (as either +a file or a directory) will be detected, reported on, and ignored. + +Related topics: |netrw-D| +Associated setting variables: |g:netrw_localmkdir| |g:netrw_mkdir_cmd| + |g:netrw_remote_mkdir| |netrw-%| + + +MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-cd* {{{2 + +By default, |g:netrw_keepdir| is 1. This setting means that the current +directory will not track the browsing directory. (done for backwards +compatibility with v6's file explorer). + +Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory +track netrw's browsing directory. + +However, given the default setting for g:netrw_keepdir of 1 where netrw +maintains its own separate notion of the current directory, in order to make +the two directories the same, use the "cd" map (type cd). That map will +set Vim's notion of the current directory to netrw's current browsing +directory. + +|netrw-cd| : This map's name was changed from "c" to cd (see |netrw-cd|). + This change was done to allow for |netrw-cb| and |netrw-cB| maps. + +Associated setting variable: |g:netrw_keepdir| + +MARKING FILES *netrw-:MF* *netrw-mf* {{{2 + (also see |netrw-mr|) + +Netrw provides several ways to mark files: + + * One may mark files with the cursor atop a filename and + then pressing "mf". + + * With gvim, in addition one may mark files with + . (see |netrw-mouse|) + + * One may use the :MF command, which takes a list of + files (for local directories, the list may include + wildcards -- see |glob()|) > + + :MF *.c +< + (Note that :MF uses || to break the line + at spaces) + + * Mark files using the |argument-list| (|netrw-mA|) + + * Mark files based upon a |location-list| (|netrw-qL|) + + * Mark files based upon the quickfix list (|netrw-qF|) + (|quickfix-error-lists|) + +The following netrw maps make use of marked files: + + |netrw-a| Hide marked files/directories + |netrw-D| Delete marked files/directories + |netrw-ma| Move marked files' names to |arglist| + |netrw-mA| Move |arglist| filenames to marked file list + |netrw-mb| Append marked files to bookmarks + |netrw-mB| Delete marked files from bookmarks + |netrw-mc| Copy marked files to target + |netrw-md| Apply vimdiff to marked files + |netrw-me| Edit marked files + |netrw-mF| Unmark marked files + |netrw-mg| Apply vimgrep to marked files + |netrw-mm| Move marked files to target + |netrw-mp| Print marked files + |netrw-ms| Netrw will source marked files + |netrw-mt| Set target for |netrw-mm| and |netrw-mc| + |netrw-mT| Generate tags using marked files + |netrw-mv| Apply vim command to marked files + |netrw-mx| Apply shell command to marked files + |netrw-mX| Apply shell command to marked files, en bloc + |netrw-mz| Compress/Decompress marked files + |netrw-O| Obtain marked files + |netrw-R| Rename marked files + +One may unmark files one at a time the same way one marks them; ie. place +the cursor atop a marked file and press "mf". This process also works +with using gvim. One may unmark all files by pressing +"mu" (see |netrw-mu|). + +Marked files are highlighted using the "netrwMarkFile" highlighting group, +which by default is linked to "Identifier" (see Identifier under +|group-name|). You may change the highlighting group by putting something +like > + + highlight clear netrwMarkFile + hi link netrwMarkFile ..whatever.. +< +into $HOME/.vim/after/syntax/netrw.vim . + +If the mouse is enabled and works with your vim, you may use to +mark one or more files. You may mark multiple files by dragging the shifted +leftmouse. (see |netrw-mouse|) + + *markfilelist* *global_markfilelist* *local_markfilelist* +All marked files are entered onto the global marked file list; there is only +one such list. In addition, every netrw buffer also has its own buffer-local +marked file list; since netrw buffers are associated with specific +directories, this means that each directory has its own local marked file +list. The various commands which operate on marked files use one or the other +of the marked file lists. + +Known Problem: if one is using tree mode (|g:netrw_liststyle|) and several +directories have files with the same name, then marking such a file will +result in all such files being highlighted as if they were all marked. The +|markfilelist|, however, will only have the selected file in it. This problem +is unlikely to be fixed. + + +UNMARKING FILES *netrw-mF* {{{2 + (also see |netrw-mf|, |netrw-mu|) + +The "mF" command will unmark all files in the current buffer. One may also use +mf (|netrw-mf|) on a specific, already marked, file to unmark just that file. + +MARKING FILES BY LOCATION LIST *netrw-qL* {{{2 + (also see |netrw-mf|) + +One may convert |location-list|s into a marked file list using "qL". +You may then proceed with commands such as me (|netrw-me|) to edit them. + + +MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2 + (also see |netrw-mf|) + +One may convert |quickfix-error-lists| into a marked file list using "qF". +You may then proceed with commands such as me (|netrw-me|) to edit them. +Quickfix error lists are generated, for example, by calls to |:vimgrep|. + + +MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2 + (also see |netrw-mf|) + +One may also mark files by pressing "mr"; netrw will then issue a prompt, +"Enter regexp: ". You may then enter a shell-style regular expression such +as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw +converts "*" into ".*" (see |regexp|) and marks files based on that. In the +future I may make it possible to use |regexp|s instead of glob()-style +expressions (yet-another-option). + +See |cmdline-window| for directions on more on how to edit the regular +expression. + + +MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked-file list) + +The "mv" map causes netrw to execute an arbitrary vim command on each file on +the local marked file list, individually: + + * 1split + * sil! keepalt e file + * run vim command + * sil! keepalt wq! + +A prompt, "Enter vim command: ", will be issued to elicit the vim command you +wish used. See |cmdline-window| for directions for more on how to edit the +command. + + +MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked-file list) + +Upon activation of the "mx" map, netrw will query the user for some (external) +command to be applied to all marked files. All "%"s in the command will be +substituted with the name of each marked file in turn. If no "%"s are in the +command, then the command will be followed by a space and a marked filename. + +Example: + (mark files) + mx + Enter command: cat + + The result is a series of shell commands: + cat 'file1' + cat 'file2' + ... + + +MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked-file list) + +Upon activation of the 'mX' map, netrw will query the user for some (external) +command to be applied to all marked files on the global marked file list. The +"en bloc" means that one command will be executed on all the files at once: > + + command files + +This approach is useful, for example, to select files and make a tarball: > + + (mark files) + mX + Enter command: tar cf mynewtarball.tar +< +The command that will be run with this example: + + tar cf mynewtarball.tar 'file1' 'file2' ... + + +MARKED FILES: ARGUMENT LIST *netrw-ma* *netrw-mA* + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked-file list) + +Using ma, one moves filenames from the marked file list to the argument list. +Using mA, one moves filenames from the argument list to the marked file list. + +See Also: |netrw-cb| |netrw-cB| |netrw-qF| |argument-list| |:args| + + +MARKED FILES: BUFFER LIST *netrw-cb* *netrw-cB* + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked-file list) + +Using cb, one moves filenames from the marked file list to the buffer list. +Using cB, one copies filenames from the buffer list to the marked file list. + +See Also: |netrw-ma| |netrw-mA| |netrw-qF| |buffer-list| |:buffers| + + +MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +If any marked files are compressed, then "mz" will decompress them. +If any marked files are decompressed, then "mz" will compress them +using the command specified by |g:netrw_compress|; by default, +that's "gzip". + +For decompression, netrw uses a |Dictionary| of suffices and their +associated decompressing utilities; see |g:netrw_decompress|. + +Remember that one can mark multiple files by regular expression +(see |netrw-mr|); this is particularly useful to facilitate compressing and +decompressing a large number of files. + +Associated setting variables: |g:netrw_compress| |g:netrw_decompress| + +MARKED FILES: COPYING *netrw-mc* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (Uses the global marked file list) + +Select a target directory with mt (|netrw-mt|). Then change directory, +select file(s) (see |netrw-mf|), and press "mc". The copy is done +from the current window (where one does the mf) to the target. + +If one does not have a target directory set with |netrw-mt|, then netrw +will query you for a directory to copy to. + +One may also copy directories and their contents (local only) to a target +directory. + +Associated setting variables: + |g:netrw_localcopycmd| |g:netrw_localcopycmdopt| + |g:netrw_localcopydircmd| |g:netrw_localcopydircmdopt| + |g:netrw_ssh_cmd| + +MARKED FILES: DIFF *netrw-md* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +Use |vimdiff| to visualize difference between selected files (two or +three may be selected for this). Uses the global marked file list. + +MARKED FILES: EDITING *netrw-me* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +The "me" command will place the marked files on the |arglist| and commence +editing them. One may return the to explorer window with |:Rexplore|. +(use |:n| and |:p| to edit next and previous files in the arglist) + +MARKED FILES: GREP *netrw-mg* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +The "mg" command will apply |:vimgrep| to the marked files. +The command will ask for the requested pattern; one may then enter: > + + /pattern/[g][j] + ! /pattern/[g][j] + pattern +< +With /pattern/, editing will start with the first item on the |quickfix| list +that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|, |:cclose|). The |:vimgrep| +command is in use, so without 'g' each line is added to quickfix list only +once; with 'g' every match is included. + +With /pattern/j, "mg" will winnow the current marked file list to just those +marked files also possessing the specified pattern. Thus, one may use > + + mr ...file-pattern... + mg /pattern/j +< +to have a marked file list satisfying the file-pattern but also restricted to +files containing some desired pattern. + + +MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +The "mh" command extracts the suffices of the marked files and toggles their +presence on the hiding list. Please note that marking the same suffix +this way multiple times will result in the suffix's presence being toggled +for each file (so an even quantity of marked files having the same suffix +is the same as not having bothered to select them at all). + +Related topics: |netrw-a| |g:netrw_list_hide| + +MARKED FILES: MOVING *netrw-mm* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + + WARNING: moving files is more dangerous than copying them. + A file being moved is first copied and then deleted; if the + copy operation fails and the delete succeeds, you will lose + the file. Either try things out with unimportant files + first or do the copy and then delete yourself using mc and D. + Use at your own risk! + +Select a target directory with mt (|netrw-mt|). Then change directory, +select file(s) (see |netrw-mf|), and press "mm". The move is done +from the current window (where one does the mf) to the target. + +Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd| + +MARKED FILES: PRINTING *netrw-mp* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +When "mp" is used, netrw will apply the |:hardcopy| command to marked files. +What netrw does is open each file in a one-line window, execute hardcopy, then +close the one-line window. + + +MARKED FILES: SOURCING *netrw-ms* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +With "ms", netrw will source the marked files (using vim's |:source| command) + + +MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + +Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|): + + * If the cursor is atop a file name, then the netrw window's currently + displayed directory is used for the copy/move-to target. + + * Also, if the cursor is in the banner, then the netrw window's currently + displayed directory is used for the copy/move-to target. + Unless the target already is the current directory. In which case, + typing "mf" clears the target. + + * However, if the cursor is atop a directory name, then that directory is + used for the copy/move-to target + + * One may use the :MT [directory] command to set the target *netrw-:MT* + This command uses ||, so spaces in the directory name are + permitted without escaping. + + * With mouse-enabled vim or with gvim, one may select a target by using + + +There is only one copy/move-to target at a time in a vim session; ie. the +target is a script variable (see |s:var|) and is shared between all netrw +windows (in an instance of vim). + +When using menus and gvim, netrw provides a "Targets" entry which allows one +to pick a target from the list of bookmarks and history. + +Related topics: + Marking Files......................................|netrw-mf| + Marking Files by Regular Expression................|netrw-mr| + Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| + Marked Files: Target Directory Using History.......|netrw-Th| + + +MARKED FILES: TAGGING *netrw-mT* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is +"ctags") to marked files. For remote browsing, in order to create a tags file +netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for +this to work on remote systems. For your local system, see |ctags| on how to +get a version. I myself use hdrtags, currently available at +http://www.drchip.org/astronaut/src/index.html , and have > + + let g:netrw_ctags= "hdrtag" +< +in my <.vimrc>. + +When a remote set of files are tagged, the resulting tags file is "obtained"; +ie. a copy is transferred to the local system's directory. The now local tags +file is then modified so that one may use it through the network. The +modification made concerns the names of the files in the tags; each filename is +preceded by the netrw-compatible URL used to obtain it. When one subsequently +uses one of the go to tag actions (|tags|), the URL will be used by netrw to +edit the desired file and go to the tag. + +Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd| + +MARKED FILES: TARGET DIRECTORY USING BOOKMARKS *netrw-Tb* {{{2 + +Sets the marked file copy/move-to target. + +The |netrw-qb| map will give you a list of bookmarks (and history). +One may choose one of the bookmarks to become your marked file +target by using [count]Tb (default count: 1). + +Related topics: + Copying files to target............................|netrw-mc| + Listing Bookmarks and History......................|netrw-qb| + Marked Files: Setting The Target Directory.........|netrw-mt| + Marked Files: Target Directory Using History.......|netrw-Th| + Marking Files......................................|netrw-mf| + Marking Files by Regular Expression................|netrw-mr| + Moving files to target.............................|netrw-mm| + + +MARKED FILES: TARGET DIRECTORY USING HISTORY *netrw-Th* {{{2 + +Sets the marked file copy/move-to target. + +The |netrw-qb| map will give you a list of history (and bookmarks). +One may choose one of the history entries to become your marked file +target by using [count]Th (default count: 0; ie. the current directory). + +Related topics: + Copying files to target............................|netrw-mc| + Listing Bookmarks and History......................|netrw-qb| + Marked Files: Setting The Target Directory.........|netrw-mt| + Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| + Marking Files......................................|netrw-mf| + Marking Files by Regular Expression................|netrw-mr| + Moving files to target.............................|netrw-mm| + + +MARKED FILES: UNMARKING *netrw-mu* {{{2 + (See |netrw-mf|, |netrw-mF|) + +The "mu" mapping will unmark all currently marked files. This command differs +from "mF" as the latter only unmarks files in the current directory whereas +"mu" will unmark global and all buffer-local marked files. +(see |netrw-mF|) + + + *netrw-browser-settings* +NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2 + +(if you're interested in the netrw file transfer settings, see |netrw-options| + and |netrw-protocol|) + +The browser provides settings in the form of variables which +you may modify; by placing these settings in your <.vimrc>, you may customize +your browsing preferences. (see also: |netrw-settings|) +> + --- ----------- + Var Explanation + --- ----------- +< *g:netrw_altfile* some like |CTRL-^| to return to the last + edited file. Choose that by setting this + parameter to 1. + Others like |CTRL-^| to return to the + netrw browsing buffer. Choose that by setting + this parameter to 0. + default: =0 + + *g:netrw_alto* change from above splitting to below splitting + by setting this variable (see |netrw-o|) + default: =&sb (see |'sb'|) + + *g:netrw_altv* change from left splitting to right splitting + by setting this variable (see |netrw-v|) + default: =&spr (see |'spr'|) + + *g:netrw_banner* enable/suppress the banner + =0: suppress the banner + =1: banner is enabled (default) + + *g:netrw_bannerbackslash* if this variable exists and is not zero, the + banner will be displayed with backslashes + rather than forward slashes. + + *g:netrw_browse_split* when browsing, will open the file by: + =0: re-using the same window (default) + =1: horizontally splitting the window first + =2: vertically splitting the window first + =3: open file in new tab + =4: act like "P" (ie. open previous window) + Note that |g:netrw_preview| may be used + to get vertical splitting instead of + horizontal splitting. + =[servername,tab-number,window-number] + Given a |List| such as this, a remote server + named by the "servername" will be used for + editing. It will also use the specified tab + and window numbers to perform editing + (see |clientserver|, |netrw-ctrl-r|) + This option does not affect the production of + |:Lexplore| windows. + + Related topics: + |g:netrw_alto| |g:netrw_altv| + |netrw-C| |netrw-cr| + |netrw-ctrl-r| + + *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME" + Windows: "cacls FILENAME /e /p PERM" + Used to change access permission for a file. + + *g:netrw_clipboard* =1 + By default, netrw will attempt to insure that + the clipboard's values will remain unchanged. + However, some users report that they have + speed problems with this; consequently, this + option, when set to zero, lets such users + prevent netrw from saving and restoring the + clipboard (the latter is done only as needed). + That means that if the clipboard is changed + (inadvertently) by normal netrw operation that + it will not be restored to its prior state. + + *g:netrw_compress* ="gzip" + Will compress marked files with this + command + + *g:Netrw_corehandler* Allows one to specify something additional + to do when handling files via netrw's + browser's "x" command. If present, + g:Netrw_corehandler specifies either one or + more function references (see |Funcref|). + (the capital g:Netrw... is required its + holding a function reference) + + + *g:netrw_ctags* ="ctags" + The default external program used to create + tags + + *g:netrw_cursor* = 2 (default) + This option controls the use of the + |'cursorline'| (cul) and |'cursorcolumn'| + (cuc) settings by netrw: + + Value Thin-Long-Tree Wide + =0 u-cul u-cuc u-cul u-cuc + =1 u-cul u-cuc cul u-cuc + =2 cul u-cuc cul u-cuc + =3 cul u-cuc cul cuc + =4 cul cuc cul cuc + =5 U-cul U-cuc U-cul U-cuc + =6 U-cul U-cuc cul U-cuc + =7 cul U-cuc cul U-cuc + =8 cul U-cuc cul cuc + + Where + u-cul : user's |'cursorline'| initial setting used + u-cuc : user's |'cursorcolumn'| initial setting used + U-cul : user's |'cursorline'| current setting used + U-cuc : user's |'cursorcolumn'| current setting used + cul : |'cursorline'| will be locally set + cuc : |'cursorcolumn'| will be locally set + + The "initial setting" means the values of + the |'cuc'| and |'cul'| settings in effect when + netrw last saw |g:netrw_cursor| >= 5 or when + netrw was initially run. + + *g:netrw_decompress* = { '.lz4': 'lz4 -d', + '.lzo': 'lzop -d', + '.lz': 'lzip -dk', + '.7z': '7za x', + '.001': '7za x', + '.tar.bz': 'tar -xvjf', + '.tar.bz2': 'tar -xvjf', + '.tbz': 'tar -xvjf', + '.tbz2': 'tar -xvjf', + '.tar.gz': 'tar -xvzf', + '.tgz': 'tar -xvzf', + '.tar.zst': 'tar --use-compress-program=unzstd -xvf', + '.tzst': 'tar --use-compress-program=unzstd -xvf', + '.tar': 'tar -xvf', + '.zip': 'unzip', + '.bz': 'bunzip2 -k', + '.bz2': 'bunzip2 -k', + '.gz': 'gunzip -k', + '.lzma': 'unlzma -T0 -k', + '.xz': 'unxz -T0 -k', + '.zst': 'zstd -T0 -d', + '.Z': 'uncompress -k', + '.rar': 'unrar x -ad', + '.tar.lzma': 'tar --lzma -xvf', + '.tlz': 'tar --lzma -xvf', + '.tar.xz': 'tar -xvJf', + '.txz': 'tar -xvJf'} + + A dictionary mapping suffices to + decompression programs. + + *g:netrw_dirhistmax* =10: controls maximum quantity of past + history. May be zero to suppress + history. + (related: |netrw-qb| |netrw-u| |netrw-U|) + + *g:netrw_dynamic_maxfilenamelen* =32: enables dynamic determination of + |g:netrw_maxfilenamelen|, which affects + local file long listing. + + *g:netrw_errorlvl* =0: error levels greater than or equal to + this are permitted to be displayed + 0: notes + 1: warnings + 2: errors + + *g:netrw_fastbrowse* =0: slow speed directory browsing; + never re-uses directory listings; + always obtains directory listings. + =1: medium speed directory browsing; + re-use directory listings only + when remote directory browsing. + (default value) + =2: fast directory browsing; + only obtains directory listings when the + directory hasn't been seen before + (or |netrw-ctrl-l| is used). + + Fast browsing retains old directory listing + buffers so that they don't need to be + re-acquired. This feature is especially + important for remote browsing. However, if + a file is introduced or deleted into or from + such directories, the old directory buffer + becomes out-of-date. One may always refresh + such a directory listing with |netrw-ctrl-l|. + This option gives the user the choice of + trading off accuracy (ie. up-to-date listing) + versus speed. + + *g:netrw_ffkeep* (default: doesn't exist) + If this variable exists and is zero, then + netrw will not do a save and restore for + |'fileformat'|. + + *g:netrw_fname_escape* =' ?&;%' + Used on filenames before remote reading/writing + + *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings + that can show up as "directories" and "files" + in the listing. This pattern is used to + remove such embedded messages. By default its + value is: + '^total\s\+\d\+$\| + ^Trying\s\+\d\+.*$\| + ^KERBEROS_V\d rejected\| + ^Security extensions not\| + No such file\| + : connect to address [0-9a-fA-F:]* + : No route to host$' + + *g:netrw_ftp_list_cmd* options for passing along to ftp for directory + listing. Defaults: + unix or g:netrw_cygwin set: : "ls -lF" + otherwise "dir" + + + *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory + listing, sorted by size of file. + Defaults: + unix or g:netrw_cygwin set: : "ls -slF" + otherwise "dir" + + *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory + listing, sorted by time of last modification. + Defaults: + unix or g:netrw_cygwin set: : "ls -tlF" + otherwise "dir" + + *g:netrw_glob_escape* ='[]*?`{~$' (unix) + ='[]*?`{$' (windows + These characters in directory names are + escaped before applying glob() + + *g:netrw_hide* Controlled by the "a" map (see |netrw-a|) + =0 : show all + =1 : show not-hidden files + =2 : show hidden files only + default: =1 + + *g:netrw_home* The home directory for where bookmarks and + history are saved (as .netrwbook and + .netrwhist). + Netrw uses |expand()|on the string. + default: the first directory on the + |'runtimepath'| + + *g:netrw_keepdir* =1 (default) keep current directory immune from + the browsing directory. + =0 keep the current directory the same as the + browsing directory. + The current browsing directory is contained in + b:netrw_curdir (also see |netrw-cd|) + + *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the + |:jumps| table unaffected. + ="" netrw will not use |:keepjumps| with + exceptions only for the + saving/restoration of position. + + *g:netrw_list_cmd* command for listing remote directories + default: (if ssh is executable) + "ssh HOSTNAME ls -FLa" + + *g:netrw_list_cmd_options* If this variable exists, then its contents are + appended to the g:netrw_list_cmd. For + example, use "2>/dev/null" to get rid of banner + messages on unix systems. + + + *g:netrw_liststyle* Set the default listing style: + = 0: thin listing (one file per line) + = 1: long listing (one file per line with time + stamp information and file size) + = 2: wide listing (multiple files in columns) + = 3: tree style listing + + *g:netrw_list_hide* comma-separated pattern list for hiding files + Patterns are regular expressions (see |regexp|) + There's some special support for git-ignore + files: you may add the output from the helper + function 'netrw_gitignore#Hide() automatically + hiding all gitignored files. + For more details see |netrw-gitignore|. + + Examples: + let g:netrw_list_hide= '.*\.swp$' + let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' + default: "" + + *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + Copies marked files (|netrw-mf|) to target + directory (|netrw-mt|, |netrw-mc|) + + *g:netrw_localcopycmdopt* ='' Linux/Unix/MacOS/Cygwin + =' \c copy' Windows + Options for the |g:netrw_localcopycmd| + + *g:netrw_localcopydircmd* ="cp" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + Copies directories to target directory. + (|netrw-mc|, |netrw-mt|) + + *g:netrw_localcopydircmdopt* =" -R" Linux/Unix/MacOS/Cygwin + =" /c xcopy /e /c /h/ /i /k" Windows + Options for |g:netrw_localcopydircmd| + + *g:netrw_localmkdir* ="mkdir" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + command for making a local directory + + *g:netrw_localmkdiropt* ="" Linux/Unix/MacOS/Cygwin + =" /c mkdir" Windows + Options for |g:netrw_localmkdir| + + *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + Moves marked files (|netrw-mf|) to target + directory (|netrw-mt|, |netrw-mm|) + + *g:netrw_localmovecmdopt* ="" Linux/Unix/MacOS/Cygwin + =" /c move" Windows + Options for |g:netrw_localmovecmd| + + *g:netrw_maxfilenamelen* =32 by default, selected so as to make long + listings fit on 80 column displays. + If your screen is wider, and you have file + or directory names longer than 32 bytes, + you may set this option to keep listings + columnar. + + *g:netrw_mkdir_cmd* command for making a remote directory + via ssh (also see |g:netrw_remote_mkdir|) + default: "ssh USEPORT HOSTNAME mkdir" + + *g:netrw_mousemaps* =1 (default) enables mouse buttons while + browsing to: + leftmouse : open file/directory + shift-leftmouse : mark file + middlemouse : same as P + rightmouse : remove file/directory + =0: disables mouse maps + + *g:netrw_nobeval* doesn't exist (default) + If this variable exists, then balloon + evaluation will be suppressed + (see |'ballooneval'|) + + *g:netrw_sizestyle* not defined: actual bytes (default) + ="b" : actual bytes (default) + ="h" : human-readable (ex. 5k, 4m, 3g) + uses 1000 base + ="H" : human-readable (ex. 5K, 4M, 3G) + uses 1024 base + The long listing (|netrw-i|) and query-file + maps (|netrw-qf|) will display file size + using the specified style. + + *g:netrw_usetab* if this variable exists and is non-zero, then + the map supporting shrinking/expanding a + Lexplore or netrw window will be enabled. + (see |netrw-c-tab|) + + *g:netrw_remote_mkdir* command for making a remote directory + via ftp (also see |g:netrw_mkdir_cmd|) + default: "mkdir" + + *g:netrw_retmap* if it exists and is set to one, then: + * if in a netrw-selected file, AND + * no normal-mode <2-leftmouse> mapping exists, + then the <2-leftmouse> will be mapped for easy + return to the netrw browser window. + example: click once to select and open a file, + double-click to return. + + Note that one may instead choose to: + * let g:netrw_retmap= 1, AND + * nmap YourChoice NetrwReturn + and have another mapping instead of + <2-leftmouse> to invoke the return. + + You may also use the |:Rexplore| command to do + the same thing. + + default: =0 + + *g:netrw_rm_cmd* command for removing remote files + default: "ssh USEPORT HOSTNAME rm" + + *g:netrw_rmdir_cmd* command for removing remote directories + default: "ssh USEPORT HOSTNAME rmdir" + + *g:netrw_rmf_cmd* command for removing remote softlinks + default: "ssh USEPORT HOSTNAME rm -f" + + *g:netrw_servername* use this variable to provide a name for + |netrw-ctrl-r| to use for its server. + default: "NETRWSERVER" + + *g:netrw_sort_by* sort by "name", "time", "size", or + "exten". + default: "name" + + *g:netrw_sort_direction* sorting direction: "normal" or "reverse" + default: "normal" + + *g:netrw_sort_options* sorting is done using |:sort|; this + variable's value is appended to the + sort command. Thus one may ignore case, + for example, with the following in your + .vimrc: > + let g:netrw_sort_options="i" +< default: "" + + *g:netrw_sort_sequence* when sorting by name, first sort by the + comma-separated pattern sequence. Note that + any filigree added to indicate filetypes + should be accounted for in your pattern. + default: '[\/]$,*,\.bak$,\.o$,\.h$, + \.info$,\.swp$,\.obj$' + + *g:netrw_special_syntax* If true, then certain files will be shown + using special syntax in the browser: + + netrwBak : *.bak + netrwCompress: *.gz *.bz2 *.Z *.zip + netrwCoreDump: core.\d\+ + netrwData : *.dat + netrwDoc : *.doc,*.txt,*.pdf, + *.pdf,*.docx + netrwHdr : *.h + netrwLex : *.l *.lex + netrwLib : *.a *.so *.lib *.dll + netrwMakefile: [mM]akefile *.mak + netrwObj : *.o *.obj + netrwPix : *.bmp,*.fit,*.fits,*.gif, + *.jpg,*.jpeg,*.pcx,*.ppc + *.pgm,*.png,*.psd,*.rgb + *.tif,*.xbm,*.xcf + netrwTags : tags ANmenu ANtags + netrwTilde : * + netrwTmp : tmp* *tmp + netrwYacc : *.y + + In addition, those groups mentioned in + |'suffixes'| are also added to the special + file highlighting group. + These syntax highlighting groups are linked + to netrwGray or Folded by default + (see |hl-Folded|), but one may put lines like > + hi link netrwCompress Visual +< into one's <.vimrc> to use one's own + preferences. Alternatively, one may + put such specifications into > + .vim/after/syntax/netrw.vim. +< The netrwGray highlighting is set up by + netrw when > + * netrwGray has not been previously + defined + * the gui is running +< As an example, I myself use a dark-background + colorscheme with the following in + .vim/after/syntax/netrw.vim: > + + hi netrwCompress term=NONE cterm=NONE gui=NONE ctermfg=10 guifg=green ctermbg=0 guibg=black + hi netrwData term=NONE cterm=NONE gui=NONE ctermfg=9 guifg=blue ctermbg=0 guibg=black + hi netrwHdr term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 + hi netrwLex term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 + hi netrwYacc term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 + hi netrwLib term=NONE cterm=NONE gui=NONE ctermfg=14 guifg=yellow + hi netrwObj term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwTilde term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwTmp term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwTags term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwDoc term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=yellow2 guibg=Blue3 + hi netrwSymLink term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=grey60 +< + *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines, + messages, banners, and whatnot that one doesn't + want masquerading as "directories" and "files". + Use this pattern to remove such embedded + messages. By default its value is: + '^total\s\+\d\+$' + + *g:netrw_ssh_cmd* One may specify an executable command + to use instead of ssh for remote actions + such as listing, file removal, etc. + default: ssh + + *g:netrw_tmpfile_escape* =' &;' + escape() is applied to all temporary files + to escape these characters. + + *g:netrw_timefmt* specify format string to vim's strftime(). + The default, "%c", is "the preferred date + and time representation for the current + locale" according to my manpage entry for + strftime(); however, not all are satisfied + with it. Some alternatives: + "%a %d %b %Y %T", + " %a %Y-%m-%d %I-%M-%S %p" + default: "%c" + + *g:netrw_use_noswf* netrw normally avoids writing swapfiles + for browser buffers. However, under some + systems this apparently is causing nasty + ml_get errors to appear; if you're getting + ml_get errors, try putting + let g:netrw_use_noswf= 0 + in your .vimrc. + default: 1 + + *g:netrw_winsize* specify initial size of new windows made with + "o" (see |netrw-o|), "v" (see |netrw-v|), + |:Hexplore| or |:Vexplore|. The g:netrw_winsize + is an integer describing the percentage of the + current netrw buffer's window to be used for + the new window. + If g:netrw_winsize is less than zero, then + the absolute value of g:netrw_winsize will be + used to specify the quantity of lines or + columns for the new window. + If g:netrw_winsize is zero, then a normal + split will be made (ie. |'equalalways'| will + take effect, for example). + default: 50 (for 50%) + + *g:netrw_wiw* =1 specifies the minimum window width to use + when shrinking a netrw/Lexplore window + (see |netrw-c-tab|). + + *g:netrw_xstrlen* Controls how netrw computes string lengths, + including multi-byte characters' string + length. (thanks to N Weibull, T Mechelynck) + =0: uses Vim's built-in strlen() + =1: number of codepoints (Latin a + combining + circumflex is two codepoints) (DEFAULT) + =2: number of spacing codepoints (Latin a + + combining circumflex is one spacing + codepoint; a hard tab is one; wide and + narrow CJK are one each; etc.) + =3: virtual length (counting tabs as anything + between 1 and |'tabstop'|, wide CJK as 2 + rather than 1, Arabic alif as zero when + immediately preceded by lam, one + otherwise, etc) + + *g:NetrwTopLvlMenu* This variable specifies the top level + menu name; by default, it's "Netrw.". If + you wish to change this, do so in your + .vimrc. + +NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2 + +Netrw has been designed to handle user options by saving them, setting the +options to something that's compatible with netrw's needs, and then restoring +them. However, the autochdir option: > + :set acd +is problematic. Autochdir sets the current directory to that containing the +file you edit; this apparently also applies to directories. In other words, +autochdir sets the current directory to that containing the "file" (even if +that "file" is itself a directory). + +NETRW SETTINGS WINDOW *netrw-settings-window* {{{2 + +With the NetrwSettings.vim plugin, > + :NetrwSettings +will bring up a window with the many variables that netrw uses for its +settings. You may change any of their values; when you save the file, the +settings therein will be used. One may also press "?" on any of the lines for +help on what each of the variables do. + +(also see: |netrw-browser-var| |netrw-protocol| |netrw-variables|) + + +============================================================================== +OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2 + +If there are no marked files: + + When browsing a remote directory, one may obtain a file under the cursor + (ie. get a copy on your local machine, but not edit it) by pressing the O + key. + +If there are marked files: + + The marked files will be obtained (ie. a copy will be transferred to your + local machine, but not set up for editing). + +Only ftp and scp are supported for this operation (but since these two are +available for browsing, that shouldn't be a problem). The status bar will +then show, on its right hand side, a message like "Obtaining filename". The +statusline will be restored after the transfer is complete. + +Netrw can also "obtain" a file using the local browser. Netrw's display +of a directory is not necessarily the same as Vim's "current directory", +unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select +a file using the local browser (by putting the cursor on it) and pressing +"O" will then "obtain" the file; ie. copy it to Vim's current directory. + +Related topics: + * To see what the current directory is, use |:pwd| + * To make the currently browsed directory the current directory, see + |netrw-cd| + * To automatically make the currently browsed directory the current + directory, see |g:netrw_keepdir|. + + *netrw-newfile* *netrw-createfile* +OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2 + +To open a new file in netrw's current directory, press "%". This map +will query the user for a new filename; an empty file by that name will +be placed in the netrw's current directory (ie. b:netrw_curdir). + +If Lexplore (|netrw-:Lexplore|) is in use, the new file will be generated +in the |g:netrw_chgwin| window. + +Related topics: |netrw-d| + + +PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2 + +One may use a preview window by using the "p" key when the cursor is atop the +desired filename to be previewed. The display will then split to show both +the browser (where the cursor will remain) and the file (see |:pedit|). By +default, the split will be taken horizontally; one may use vertical splitting +if one has set |g:netrw_preview| first. + +An interesting set of netrw settings is: > + + let g:netrw_preview = 1 + let g:netrw_liststyle = 3 + let g:netrw_winsize = 30 + +These will: + + 1. Make vertical splitting the default for previewing files + 2. Make the default listing style "tree" + 3. When a vertical preview window is opened, the directory listing + will use only 30% of the columns available; the rest of the window + is used for the preview window. + + Related: if you like this idea, you may also find :Lexplore + (|netrw-:Lexplore|) or |g:netrw_chgwin| of interest + +Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| |CTRL-W_z| |:pclose| + + +PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2 + +To edit a file or directory under the cursor in the previously used (last +accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one +window, then the one window will be horizontally split (by default). + +If there's more than one window, the previous window will be re-used on +the selected file/directory. If the previous window's associated buffer +has been modified, and there's only one window with that buffer, then +the user will be asked if s/he wishes to save the buffer first (yes, +no, or cancel). + +Related Actions |netrw-cr| |netrw-o| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_alto| control above/below splitting + |g:netrw_altv| control right/left splitting + |g:netrw_preview| control horizontal vs vertical splitting + |g:netrw_winsize| control initial sizing + +Also see: |g:netrw_chgwin| |netrw-p| + + +REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2 + +To refresh either a local or remote directory listing, press ctrl-l () or +hit the when atop the ./ directory entry in the listing. One may also +refresh a local directory by using ":e .". + + +REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2 + +One may toggle between normal and reverse sorting order by pressing the +"r" key. + +Related topics: |netrw-s| +Associated setting variable: |g:netrw_sort_direction| + + +RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2 + +If there are no marked files: (see |netrw-mf|) + + Renaming files and directories involves moving the cursor to the + file/directory to be moved (renamed) and pressing "R". You will then be + queried for what you want the file/directory to be renamed to. You may + select a range of lines with the "V" command (visual selection), and then + press "R"; you will be queried for each file as to what you want it + renamed to. + +If there are marked files: (see |netrw-mf|) + + Marked files will be renamed (moved). You will be queried as above in + order to specify where you want the file/directory to be moved. + + If you answer a renaming query with a "s/frompattern/topattern/", then + subsequent files on the marked file list will be renamed by taking each + name, applying that substitute, and renaming each file to the result. + As an example : > + + mr [query: reply with *.c] + R [query: reply with s/^\(.*\)\.c$/\1.cpp/] +< + This example will mark all *.c files and then rename them to *.cpp + files. Netrw will protect you from overwriting local files without + confirmation, but not remote ones. + + The ctrl-X character has special meaning for renaming files: > + + : a single ctrl-x tells netrw to ignore the portion of the response + lying between the last '/' and the ctrl-x. + + : a pair of contiguous ctrl-x's tells netrw to ignore any + portion of the string preceding the double ctrl-x's. +< + WARNING:~ + + Note that moving files is a dangerous operation; copies are safer. That's + because a "move" for remote files is actually a copy + delete -- and if + the copy fails and the delete succeeds you may lose the file. + Use at your own risk. + +The *g:netrw_rename_cmd* variable is used to implement remote renaming. By +default its value is: > + + ssh HOSTNAME mv +< +One may rename a block of files and directories by selecting them with +V (|linewise-visual|) when using thin style. + +See |cmdline-editing| for more on how to edit the command line; in particular, +you'll find (initiates cmdline window editing) and (uses the +command line under the cursor) useful in conjunction with the R command. + + +SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2 + +One may select the sorting style by name, time, or (file) size. The "s" map +allows one to circulate amongst the three choices; the directory listing will +automatically be refreshed to reflect the selected style. + +Related topics: |netrw-r| |netrw-S| +Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence| + + +SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2 + +One may select a netrw window for editing with the "C" mapping, using the +:NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window +number. Subsequent selection of a file to edit (|netrw-cr|) will use that +window. + + * C : by itself, will select the current window holding a netrw buffer + for subsequent editing via |netrw-cr|. The C mapping is only available + while in netrw buffers. + + * [count]C : the count will be used as the window number to be used + for subsequent editing via |netrw-cr|. + + * :NetrwC will set |g:netrw_chgwin| to the current window + + * :NetrwC win# will set |g:netrw_chgwin| to the specified window + number + +Using > + let g:netrw_chgwin= -1 +will restore the default editing behavior +(ie. subsequent editing will use the current window). + +Related topics: |netrw-cr| |g:netrw_browse_split| +Associated setting variables: |g:netrw_chgwin| + + +SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2 + +The key will toggle a netrw or |:Lexplore| window's width, +but only if |g:netrw_usetab| exists and is non-zero (and, of course, +only if your terminal supports differentiating from a plain +). + + * If the current window is a netrw window, toggle its width + (between |g:netrw_wiw| and its original width) + + * Else if there is a |:Lexplore| window in the current tab, toggle + its width + + * Else bring up a |:Lexplore| window + +If |g:netrw_usetab| exists and is zero, or if there is a pre-existing mapping +for , then the will not be mapped. One may map something other +than a , too: (but you'll still need to have had |g:netrw_usetab| set). > + + nmap (whatever) NetrwShrink +< +Related topics: |:Lexplore| +Associated setting variable: |g:netrw_usetab| + + +USER SPECIFIED MAPS *netrw-usermaps* {{{1 + +One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|, +to hold a |List| of lists of keymap strings and function names: > + + [["keymap-sequence","ExampleUserMapFunc"],...] +< +When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps| +exists, then the internal function netrw#UserMaps(islocal) is called. +This function goes through all the entries in the |g:Netrw_UserMaps| list: + + * sets up maps: > + nno KEYMAP-SEQUENCE + :call s:UserMaps(islocal,"ExampleUserMapFunc") +< * refreshes if result from that function call is the string + "refresh" + * if the result string is not "", then that string will be + executed (:exe result) + * if the result is a List, then the above two actions on results + will be taken for every string in the result List + +The user function is passed one argument; it resembles > + + fun! ExampleUserMapFunc(islocal) +< +where a:islocal is 1 if its a local-directory system call or 0 when +remote-directory system call. + + *netrw-call* *netrw-expose* *netrw-modify* +Use netrw#Expose("varname") to access netrw-internal (script-local) + variables. +Use netrw#Modify("varname",newvalue) to change netrw-internal variables. +Use netrw#Call("funcname"[,args]) to call a netrw-internal function with + specified arguments. + +Example: Get a copy of netrw's marked file list: > + + let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist") +< +Example: Modify the value of netrw's marked file list: > + + call netrw#Modify("netrwmarkfilelist",[]) +< +Example: Clear netrw's marked file list via a mapping on gu > + " ExampleUserMap: {{{2 + fun! ExampleUserMap(islocal) + call netrw#Modify("netrwmarkfilelist",[]) + call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"") + let retval= ["refresh"] + return retval + endfun + let g:Netrw_UserMaps= [["gu","ExampleUserMap"]] +< + +10. Problems and Fixes *netrw-problems* {{{1 + + (This section is likely to grow as I get feedback) + *netrw-p1* + P1. I use Windows, and my network browsing with ftp doesn't sort by {{{2 + time or size! -or- The remote system is a Windows server; why + don't I get sorts by time or size? + + Windows' ftp has a minimal support for ls (ie. it doesn't + accept sorting options). It doesn't support the -F which + gives an explanatory character (ABC/ for "ABC is a directory"). + Netrw then uses "dir" to get both its thin and long listings. + If you think your ftp does support a full-up ls, put the + following into your <.vimrc>: > + + let g:netrw_ftp_list_cmd = "ls -lF" + let g:netrw_ftp_timelist_cmd= "ls -tlF" + let g:netrw_ftp_sizelist_cmd= "ls -slF" +< + Alternatively, if you have cygwin on your Windows box, put + into your <.vimrc>: > + + let g:netrw_cygwin= 1 +< + This problem also occurs when the remote system is Windows. + In this situation, the various g:netrw_ftp_[time|size]list_cmds + are as shown above, but the remote system will not correctly + modify its listing behavior. + + + *netrw-p2* + P2. I tried rcp://user@host/ (or protocol other than ftp) and netrw {{{2 + used ssh! That wasn't what I asked for... + + Netrw has two methods for browsing remote directories: ssh + and ftp. Unless you specify ftp specifically, ssh is used. + When it comes time to do download a file (not just a directory + listing), netrw will use the given protocol to do so. + + *netrw-p3* + P3. I would like long listings to be the default. {{{2 + + Put the following statement into your |.vimrc|: > + + let g:netrw_liststyle= 1 +< + Check out |netrw-browser-var| for more customizations that + you can set. + + *netrw-p4* + P4. My times come up oddly in local browsing {{{2 + + Does your system's strftime() accept the "%c" to yield dates + such as "Sun Apr 27 11:49:23 1997"? If not, do a + "man strftime" and find out what option should be used. Then + put it into your |.vimrc|: > + + let g:netrw_timefmt= "%X" (where X is the option) +< + *netrw-p5* + P5. I want my current directory to track my browsing. {{{2 + How do I do that? + + Put the following line in your |.vimrc|: +> + let g:netrw_keepdir= 0 +< + *netrw-p6* + P6. I use Chinese (or other non-ascii) characters in my filenames, {{{2 + and netrw (Explore, Sexplore, Hexplore, etc) doesn't display them! + + (taken from an answer provided by Wu Yongwei on the vim + mailing list) + I now see the problem. Your code page is not 936, right? Vim + seems only able to open files with names that are valid in the + current code page, as are many other applications that do not + use the Unicode version of Windows APIs. This is an OS-related + issue. You should not have such problems when the system + locale uses UTF-8, such as modern Linux distros. + + (...it is one more reason to recommend that people use utf-8!) + + *netrw-p7* + P7. I'm getting "ssh is not executable on your system" -- what do I {{{2 + do? + + (Dudley Fox) Most people I know use putty for windows ssh. It + is a free ssh/telnet application. You can read more about it + here: + + http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also: + + (Marlin Unruh) This program also works for me. It's a single + executable, so he/she can copy it into the Windows\System32 + folder and create a shortcut to it. + + (Dudley Fox) You might also wish to consider plink, as it + sounds most similar to what you are looking for. plink is an + application in the putty suite. + + http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink + + (Vissale Neang) Maybe you can try OpenSSH for windows, which + can be obtained from: + + http://sshwindows.sourceforge.net/ + + It doesn't need the full Cygwin package. + + (Antoine Mechelynck) For individual Unix-like programs needed + for work in a native-Windows environment, I recommend getting + them from the GnuWin32 project on sourceforge if it has them: + + http://gnuwin32.sourceforge.net/ + + Unlike Cygwin, which sets up a Unix-like virtual machine on + top of Windows, GnuWin32 is a rewrite of Unix utilities with + Windows system calls, and its programs works quite well in the + cmd.exe "Dos box". + + (dave) Download WinSCP and use that to connect to the server. + In Preferences > Editors, set gvim as your editor: + + - Click "Add..." + - Set External Editor (adjust path as needed, include + the quotes and !.! at the end): + "c:\Program Files\Vim\vim82\gvim.exe" !.! + - Check that the filetype in the box below is + {asterisk}.{asterisk} (all files), or whatever types + you want (cec: change {asterisk} to * ; I had to + write it that way because otherwise the helptags + system thinks it's a tag) + - Make sure it's at the top of the listbox (click it, + then click "Up" if it's not) + If using the Norton Commander style, you just have to hit + to edit a file in a local copy of gvim. + + (Vit Gottwald) How to generate public/private key and save + public key it on server: > + http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready + (8.3 Getting ready for public key authentication) +< + How to use a private key with 'pscp': > + + http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html + (5.2.4 Using public key authentication with PSCP) +< + (Ben Schmidt) I find the ssh included with cwRsync is + brilliant, and install cwRsync or cwRsyncServer on most + Windows systems I come across these days. I guess COPSSH, + packed by the same person, is probably even better for use as + just ssh on Windows, and probably includes sftp, etc. which I + suspect the cwRsync doesn't, though it might + + (cec) To make proper use of these suggestions above, you will + need to modify the following user-settable variables in your + .vimrc: + + |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd| + |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd| + + The first one (|g:netrw_ssh_cmd|) is the most important; most + of the others will use the string in g:netrw_ssh_cmd by + default. + + *netrw-p8* *netrw-ml_get* + P8. I'm browsing, changing directory, and bang! ml_get errors {{{2 + appear and I have to kill vim. Any way around this? + + Normally netrw attempts to avoid writing swapfiles for + its temporary directory buffers. However, on some systems + this attempt appears to be causing ml_get errors to + appear. Please try setting |g:netrw_use_noswf| to 0 + in your <.vimrc>: > + let g:netrw_use_noswf= 0 +< + *netrw-p9* + P9. I'm being pestered with "[something] is a directory" and {{{2 + "Press ENTER or type command to continue" prompts... + + The "[something] is a directory" prompt is issued by Vim, + not by netrw, and there appears to be no way to work around + it. Coupled with the default cmdheight of 1, this message + causes the "Press ENTER..." prompt. So: read |hit-enter|; + I also suggest that you set your |'cmdheight'| to 2 (or more) in + your <.vimrc> file. + + *netrw-p10* + P10. I want to have two windows; a thin one on the left and my {{{2 + editing window on the right. How may I accomplish this? + + You probably want netrw running as in a side window. If so, you + will likely find that ":[N]Lexplore" does what you want. The + optional "[N]" allows you to select the quantity of columns you + wish the |:Lexplore|r window to start with (see |g:netrw_winsize| + for how this parameter works). + + Previous solution: + + * Put the following line in your <.vimrc>: + let g:netrw_altv = 1 + * Edit the current directory: :e . + * Select some file, press v + * Resize the windows as you wish (see |CTRL-W_<| and + |CTRL-W_>|). If you're using gvim, you can drag + the separating bar with your mouse. + * When you want a new file, use ctrl-w h to go back to the + netrw browser, select a file, then press P (see |CTRL-W_h| + and |netrw-P|). If you're using gvim, you can press + in the browser window and then press the + to select the file. + + + *netrw-p11* + P11. My directory isn't sorting correctly, or unwanted letters are {{{2 + appearing in the listed filenames, or things aren't lining + up properly in the wide listing, ... + + This may be due to an encoding problem. I myself usually use + utf-8, but really only use ascii (ie. bytes from 32-126). + Multibyte encodings use two (or more) bytes per character. + You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|. + + *netrw-p12* + P12. I'm a Windows + putty + ssh user, and when I attempt to {{{2 + browse, the directories are missing trailing "/"s so netrw treats + them as file transfers instead of as attempts to browse + subdirectories. How may I fix this? + + (mikeyao) If you want to use vim via ssh and putty under Windows, + try combining the use of pscp/psftp with plink. pscp/psftp will + be used to connect and plink will be used to execute commands on + the server, for example: list files and directory using 'ls'. + + These are the settings I use to do this: +> + " list files, it's the key setting, if you haven't set, + " you will get a blank buffer + let g:netrw_list_cmd = "plink HOSTNAME ls -Fa" + " if you haven't add putty directory in system path, you should + " specify scp/sftp command. For examples: + "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe" + "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe" +< + *netrw-p13* + P13. I would like to speed up writes using Nwrite and scp/ssh {{{2 + style connections. How? (Thomer M. Gil) + + Try using ssh's ControlMaster and ControlPath (see the ssh_config + man page) to share multiple ssh connections over a single network + connection. That cuts out the cryptographic handshake on each + file write, sometimes speeding it up by an order of magnitude. + (see http://thomer.com/howtos/netrw_ssh.html) + (included by permission) + + Add the following to your ~/.ssh/config: > + + # you change "*" to the hostname you care about + Host * + ControlMaster auto + ControlPath /tmp/%r@%h:%p + +< Then create an ssh connection to the host and leave it running: > + + ssh -N host.domain.com + +< Now remotely open a file with Vim's Netrw and enjoy the + zippiness: > + + vim scp://host.domain.com//home/user/.bashrc +< + *netrw-p14* + P14. How may I use a double-click instead of netrw's usual single {{{2 + click to open a file or directory? (Ben Fritz) + + First, disable netrw's mapping with > + let g:netrw_mousemaps= 0 +< and then create a netrw buffer only mapping in + $HOME/.vim/after/ftplugin/netrw.vim: > + nmap <2-leftmouse> +< Note that setting g:netrw_mousemaps to zero will turn off + all netrw's mouse mappings, not just the one. + (see |g:netrw_mousemaps|) + + *netrw-p15* + P15. When editing remote files (ex. :e ftp://hostname/path/file), {{{2 + under Windows I get an |E303| message complaining that its unable + to open a swap file. + + (romainl) It looks like you are starting Vim from a protected + directory. Start netrw from your $HOME or other writable + directory. + + *netrw-p16* + P16. Netrw is closing buffers on its own. {{{2 + What steps will reproduce the problem? + 1. :Explore, navigate directories, open a file + 2. :Explore, open another file + 3. Buffer opened in step 1 will be closed. o + What is the expected output? What do you see instead? + I expect both buffers to exist, but only the last one does. + + (Lance) Problem is caused by "set autochdir" in .vimrc. + (drchip) I am able to duplicate this problem with |'acd'| set. + It appears that the buffers are not exactly closed; + a ":ls!" will show them (although ":ls" does not). + + *netrw-P17* + P17. How to locally edit a file that's only available via {{{2 + another server accessible via ssh? + See http://stackoverflow.com/questions/12469645/ + "Using Vim to Remotely Edit A File on ServerB Only + Accessible From ServerA" + + *netrw-P18* + P18. How do I get numbering on in directory listings? {{{2 + With |g:netrw_bufsettings|, you can control netrw's buffer + settings; try putting > + let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu" +< in your .vimrc. If you'd like to have relative numbering + instead, try > + let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu" +< + *netrw-P19* + P19. How may I have gvim start up showing a directory listing? {{{2 + Try putting the following code snippet into your .vimrc: > + augroup VimStartup + au! + au VimEnter * if expand("%") == "" && argc() == 0 && + \ (v:servername =~ 'GVIM\d*' || v:servername == "") + \ | e . | endif + augroup END +< You may use Lexplore instead of "e" if you're so inclined. + This snippet assumes that you have client-server enabled + (ie. a "huge" vim version). + + *netrw-P20* + P20. I've made a directory (or file) with an accented character, {{{2 + but netrw isn't letting me enter that directory/read that file: + + Its likely that the shell or o/s is using a different encoding + than you have vim (netrw) using. A patch to vim supporting + "systemencoding" may address this issue in the future; for + now, just have netrw use the proper encoding. For example: > + + au FileType netrw set enc=latin1 +< + *netrw-P21* + P21. I get an error message when I try to copy or move a file: {{{2 + + **error** (netrw) tried using g:netrw_localcopycmd; it doesn't work! + + What's wrong? + + Netrw uses several system level commands to do things (see + + |g:netrw_localcopycmd|, |g:netrw_localmovecmd|, + |g:netrw_mkdir_cmd|). + + You may need to adjust the default commands for one or more of + these commands by setting them properly in your .vimrc. Another + source of difficulty is that these commands use vim's local + directory, which may not be the same as the browsing directory + shown by netrw (see |g:netrw_keepdir|). + + +============================================================================== +11. Credits *netrw-credits* {{{1 + + Vim editor by Bram Moolenaar (Thanks, Bram!) + dav support by C Campbell + fetch support by Bram Moolenaar and C Campbell + ftp support by C Campbell + http support by Bram Moolenaar + rcp + rsync support by C Campbell (suggested by Erik Warendorph) + scp support by raf + sftp support by C Campbell + + inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell + + Jérôme Augé -- also using new buffer method with ftp+.netrc + Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, + fetch,... + Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution + Erik Warendorph -- for several suggestions (g:netrw_..._cmd + variables, rsync etc) + Doug Claar -- modifications to test for success with ftp + operation + +============================================================================== +Modelines: {{{1 +vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker diff --git a/runtime/doc/pi_tar.txt b/runtime/doc/pi_tar.txt index 5b317d60..6d49928d 100644 --- a/runtime/doc/pi_tar.txt +++ b/runtime/doc/pi_tar.txt @@ -1,4 +1,4 @@ -*pi_tar.txt* For Vim version 9.1. Last change: 2024 May 11 +*pi_tar.txt* For Vim version 9.1. Last change: 2025 Mar 16 +====================+ | Tar File Interface | @@ -74,6 +74,15 @@ Copyright 2005-2017: *tar-copyright* let g:loaded_tarPlugin= 1 let g:loaded_tar = 1 < + *tar-mappings* + MAPPINGS~ + + The following (buffer-local) mappings are available in a tar buffer: + + Open selected file for editing, any changes will be + written back to the archive. + same as + x Extract selected file. ============================================================================== 3. Options *tar-options* diff --git a/runtime/doc/pi_zip.txt b/runtime/doc/pi_zip.txt index 2e98becf..afc2d0ee 100644 --- a/runtime/doc/pi_zip.txt +++ b/runtime/doc/pi_zip.txt @@ -1,4 +1,4 @@ -*pi_zip.txt* For Vim version 9.1. Last change: 2023 Nov 05 +*pi_zip.txt* For Vim version 9.1. Last change: 2025 Apr 02 +====================+ | Zip File Interface | @@ -100,12 +100,14 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright* should be treated as zip files. Alternatively, one may change *g:zipPlugin_ext* in one's .vimrc. - Currently (11/30/15) it holds: > - - let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip, - \ *.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm, - \ *.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm, - \ *.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx,*.epub' + Currently (as of April 2025) it holds: > + + let g:zipPlugin_ext='*.aar,*.apk,*.celzip,*.crtx,*.docm,*.docx, + \ *.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz, + \ *.odb,*.odc,*.odf,*.odg,*.odi,*.odm,*.odp,*.ods,*.odt,*.otc,*.otf, + \ *.otg,*.oth,*.oti,*.otp,*.ots,*.ott,*.oxt,*.potm,*.potx,*.ppam, + \ *.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.whl,*.wsz, + \ *.xap,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip' ============================================================================== 4. History *zip-history* {{{1 diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt index 06acf391..ba87b31f 100644 --- a/runtime/doc/popup.txt +++ b/runtime/doc/popup.txt @@ -1,4 +1,4 @@ -*popup.txt* For Vim version 9.1. Last change: 2025 Jan 08 +*popup.txt* For Vim version 9.1. Last change: 2025 Feb 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -504,7 +504,7 @@ popup_menu({what}, {options}) *popup_menu()* \ mapping: 0, \ }) < The current line is highlighted with a match using - "PopupSelected", or "PmenuSel" if that is not defined. + |hl-PopupSelected| which is linked to "PmenuSel" by default. Use {options} to change the properties. Should at least set "callback" to a function that handles the selected item. @@ -559,7 +559,7 @@ popup_notification({what}, {options}) *popup_notification()* \ close: 'click', \ padding: [0,1,0,1], \ }) -< The PopupNotification highlight group is used instead of +< The |hl-PopupNotification| highlight group is used instead of WarningMsg if it is defined. Without the |+timers| feature the popup will not disappear diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 834f0e1b..a9a43fed 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 9.1. Last change: 2025 Jan 11 +*quickfix.txt* For Vim version 9.1. Last change: 2025 Apr 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -43,12 +43,12 @@ From inside Vim an easy way to run a command and handle the output is with the The 'errorformat' option should be set to match the error messages from your compiler (see |errorformat| below). - *quickfix-ID* + *quickfix-stack* *quickfix-ID* Each quickfix list has a unique identifier called the quickfix ID and this number will not change within a Vim session. The |getqflist()| function can be used to get the identifier assigned to a list. There is also a quickfix list -number which may change whenever more than ten lists are added to a quickfix -stack. +number which may change whenever more than 'chistory' lists are added to a +quickfix stack. *location-list* *E776* A location list is a window-local quickfix list. You get one after commands @@ -860,10 +860,12 @@ using these functions are below: ============================================================================= 3. Using more than one list of errors *quickfix-error-lists* -So far has been assumed that there is only one list of errors. Actually the -ten last used lists are remembered. When starting a new list, the previous -ones are automatically kept. Two commands can be used to access older error -lists. They set one of the existing error lists as the current one. +So far it has been assumed that there is only one list of errors. Actually +there can be multiple used lists that are remembered; see 'chistory' and +'lhistory'. +When starting a new list, the previous ones are automatically kept. Two +commands can be used to access older error lists. They set one of the +existing error lists as the current one. *:colder* *:col* *E380* :col[der] [count] Go to older error list. When [count] is given, do @@ -1722,6 +1724,13 @@ shells and OSes and also does not allow to use other available TeX options, if any. If your TeX doesn't support "-interaction=nonstopmode", please report it with different means to express \nonstopmode from the command line. +TSC COMPILER *compiler-tsc* + +The executable and compiler options can be added to 'makeprg' by setting the +b/g:tsc_makeprg variable. For example: > + + let b:tsc_makeprg = "npx tsc --noEmit" + TYPST COMPILER *compiler-typst* Vim includes a compiler plugin for Typst files. This compiler is enabled diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 87764a29..349c1af8 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 9.1. Last change: 2025 Feb 08 +*quickref.txt* For Vim version 9.1. Last change: 2025 Apr 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -639,6 +639,7 @@ Short explanation of each option: *option-list* 'cdpath' 'cd' list of directories searched with ":cd" 'cedit' key used to open the command-line window 'charconvert' 'ccv' expression for character encoding conversion +'chistory' 'chi' maximum number of quickfix lists in history 'cindent' 'cin' do C program indenting 'cinkeys' 'cink' keys that trigger indent when 'cindent' is set 'cinoptions' 'cino' how to do indenting when 'cindent' is set @@ -786,6 +787,7 @@ Short explanation of each option: *option-list* 'langremap' 'lrm' do apply 'langmap' to mapped characters 'laststatus' 'ls' tells when last window has status lines 'lazyredraw' 'lz' don't redraw while executing macros +'lhistory' 'lhi' maximum number of location lists in history 'linebreak' 'lbr' wrap long lines at a blank 'lines' number of lines in the display 'linespace' 'lsp' number of pixel lines to use between characters diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 94ed836f..ccedc1ad 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 9.1. Last change: 2024 Dec 19 +*starting.txt* For Vim version 9.1. Last change: 2025 Feb 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -828,8 +828,9 @@ accordingly. Vim proceeds in this order: easy to copy it to another system. If Vim was started with "-u filename", the file "filename" is used. - All following initializations until 4. are skipped. $MYVIMRC and - $MYVIMDIR are not set. + All following initializations until 4. are skipped. `$MYVIMRC` and + `$MYVIMDIR` are not set (but `$MYVIMDIR` will be set, if 'rtp' is + updated). "vim -u NORC" can be used to skip these initializations without reading a file. "vim -u NONE" also skips loading plugins. |-u| @@ -850,9 +851,9 @@ accordingly. Vim proceeds in this order: *VIMINIT* *.vimrc* *_vimrc* *EXINIT* *.exrc* *_exrc* *$MYVIMRC* *$MYVIMDIR* c. Five places are searched for initializations. The first that exists - is used, the others are ignored. The $MYVIMRC environment variable is - set to the file that was first found, unless $MYVIMRC was already set - and when using VIMINIT. The $MYVIMDIR environment variable is + is used, the others are ignored. The `$MYVIMRC` environment variable is + set to the file that was first found, unless `$MYVIMRC` was already set + when using VIMINIT. The `$MYVIMDIR` environment variable is set to the personal 'rtp' directory, however it is not verified that the directory actually exists. I The environment variable VIMINIT (see also |compatible-default|) (*) @@ -973,9 +974,10 @@ accordingly. Vim proceeds in this order: The |v:vim_did_enter| variable is set to 1. The |VimEnter| autocommands are executed. -The $MYVIMRC or $MYGVIMRC environment variable will be set to the first found -vimrc and/or gvimrc file while $MYVIMDIR is set to the users personal runtime -directory 'rtp' (typically the first entry in 'runtimepath'). +The `$MYVIMRC` or `$MYGVIMRC` environment variable will be set to the first found +vimrc and/or gvimrc file while `$MYVIMDIR` is set to the users personal runtime +directory 'rtp' (typically the first entry in 'runtimepath'). If 'rtp' +changes, `$MYVIMDIR` will be updated. Note: These environment variables resolve symbolic links, but 'rtp' does not. diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 38f764f7..ed728301 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 9.1. Last change: 2025 Jan 20 +*syntax.txt* For Vim version 9.1. Last change: 2025 Apr 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1056,8 +1056,12 @@ Variable Highlight ~ *c_ansi_typedefs* ... but do standard ANSI types *c_ansi_constants* ... but do standard ANSI constants *c_no_utf* don't highlight \u and \U in strings -*c_syntax_for_h* for *.h files use C syntax instead of C++ and use objc - syntax instead of objcpp +*c_syntax_for_h* use C syntax for *.h files instead of C++/ObjC/ObjC++ + (NOTE: This variable is deprecated and no longer + necessary, as *.h files now default to C, unless the + file contains C++ or Objective-C syntax. If the + automated detection fails, the default filetype can + be adjusted using `g:filetype_h`.) *c_no_if0* don't highlight "#if 0" blocks as comments *c_no_cformat* don't highlight %-formats in strings *c_no_c99* don't highlight C99 standard items @@ -1116,8 +1120,11 @@ the C syntax file. See |c.vim| for all the settings that are available for C. By setting a variable you can tell Vim to use Ch syntax for *.h files, instead of C or C++: > - :let ch_syntax_for_h = 1 + :let g:filetype_h = 'ch' +NOTE: In previous versions of Vim, the following (now-deprecated) variable was +used, but is no longer the preferred approach: > + :let ch_syntax_for_h = 1 CHILL *chill.vim* *ft-chill-syntax* @@ -1286,6 +1293,21 @@ doesn't work for you, or you don't edit Progress at all, use this in your startup vimrc: > :let filetype_w = "cweb" +CSHARP *cs.vim* *ft-cs-syntax* + +C# raw string literals may use any number of quote marks to encapsulate the +block, and raw interpolated string literals may use any number of braces to +encapsulate the interpolation, e.g. > + + $$$""""Hello {{{name}}}"""" +< +By default, Vim highlights 3-8 quote marks, and 1-8 interpolation braces. +The maximum numbers of quotes and braces recognized can configured using the +following variables: + + Variable Default ~ + g:cs_raw_string_quote_count 8 + g:cs_raw_string_interpolation_brace_count 8 DART *dart.vim* *ft-dart-syntax* @@ -2153,6 +2175,13 @@ line for any comments written in this way, and showing the contents of a first line otherwise, with > :let g:java_foldtext_show_first_or_second_line = 1 +HTML tags in Javadoc comments can additionally be folded by following the +instructions listed under |html-folding| and giving explicit consent with > + :let g:java_consent_to_html_syntax_folding = 1 +Do not default to this kind of folding unless ALL start tags and optional end +tags are balanced in Javadoc comments; otherwise, put up with creating runaway +folds that break syntax highlighting. + Trailing whitespace characters or a run of space characters before a tab character can be marked as an error with > :let g:java_space_errors = 1 @@ -2187,12 +2216,12 @@ cycles for such a feature to become either integrated into the platform or withdrawn from this effort. To cater for early adopters, there is optional support in Vim for syntax related preview features that are implemented. You can request it by specifying a list of preview feature numbers as follows: > - :let g:java_syntax_previews = [455, 476] + :let g:java_syntax_previews = [488, 494] The supported JEP numbers are to be drawn from this table: `430`: String Templates [JDK 21] - `455`: Primitive types in Patterns, instanceof, and switch - `476`: Module Import Declarations + `488`: Primitive types in Patterns, instanceof, and switch + `494`: Module Import Declarations Note that as soon as the particular preview feature will have been integrated into the Java platform, its entry will be removed from the table and related @@ -2343,13 +2372,9 @@ instead, and the name of your source file should be *.pike LUA *lua.vim* *ft-lua-syntax* -The Lua syntax file can be used for versions 4.0, 5.0, 5.1 and 5.2 (5.2 is -the default). You can select one of these versions using the global variables -lua_version and lua_subversion. For example, to activate Lua -5.1 syntax highlighting, set the variables like this: > - - :let lua_version = 5 - :let lua_subversion = 1 +The Lua syntax file can be used for versions 4.0, 5.0+. You can select one of +these versions using the global variables |g:lua_version| and +|g:lua_subversion|. MAIL *mail.vim* *ft-mail.vim* @@ -2382,11 +2407,16 @@ Comments are also highlighted by default. You can turn this off by using: > :let make_no_comments = 1 -Microsoft Makefile handles variable expansion and comments differently -(backslashes are not used for escape). If you see any wrong highlights -because of this, you can try this: > +There are various Make implementations, which add extensions other than the +POSIX specification and thus are mutually incompatible. If the filename is +BSDmakefile or GNUmakefile, the corresponding implementation is automatically +determined; otherwise vim tries to detect it by the file contents. If you see +any wrong highlights because of this, you can enforce a flavor by setting one +of the following: > - :let make_microsoft = 1 + :let g:make_flavor = 'bsd' " or + :let g:make_flavor = 'gnu' " or + :let g:make_flavor = 'microsoft' MAPLE *maple.vim* *ft-maple-syntax* @@ -2440,6 +2470,12 @@ have the following in your .vimrc: > let filetype_m = "mma" +MBSYNC *mbsync.vim* *ft-mbsync-syntax* + +The mbsync application uses a configuration file to setup mailboxes names, +user and password. All files ending with `.mbsyncrc` or with the name +`isyncrc` will be recognized as mbsync configuration files. + MEDIAWIKI *ft-mediawiki-syntax* By default, syntax highlighting includes basic HTML tags like style and @@ -3501,25 +3537,25 @@ cases pertain, then the first line of the file is examined (ex. looking for /bin/sh /bin/ksh /bin/bash). If the first line specifies a shelltype, then that shelltype is used. However some files (ex. .profile) are known to be shell files but the type is not apparent. Furthermore, on many systems sh is -symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix). +symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (POSIX). One may specify a global default by instantiating one of the following variables in your <.vimrc>: ksh: > let g:is_kornshell = 1 -< posix: (using this is nearly the same as setting g:is_kornshell to 1) > +< posix: (default) > let g:is_posix = 1 < bash: > let g:is_bash = 1 -< sh: (default) Bourne shell > +< dash: > + let g:is_dash = 1 +< sh: Bourne shell > let g:is_sh = 1 -< (dash users should use posix) - If there's no "#! ..." line, and the user hasn't availed himself/herself of a default sh.vim syntax setting as just shown, then syntax/sh.vim will assume -the Bourne shell syntax. No need to quote RFCs or market penetration +the POSIX shell syntax. No need to quote RFCs or market penetration statistics in error reports, please -- just select the default version of the sh your system uses and install the associated "let..." in your <.vimrc>. @@ -4021,7 +4057,29 @@ highlighting is to put the following line in your |vimrc|: > let g:vimsyn_noerror = 1 < +To suppress only specific errors, define the following variables: > + + g:vimsyn_nobehaveerror = 1 " :behave error + g:vimsyn_vimFTError = 1 " :filetype error + g:vimsyn_noaugrouperror = 1 " :augroup error + g:vimsyn_noopererror = 1 " operator error + g:vimsyn_notypealiaserror = 1 " Vim9 type alias error + g:vimsyn_novimfunctionerror = 1 " Vim9 method error + g:vimsyn_nousercmderror = 1 " :com error + g:vimsyn_novimsynerror = 1 " :syn error + g:vimsyn_novimsyncaseerror = 1 " :syn case error + g:vimsyn_novimsynconcealerror = 1 " :syn conceal error + g:vimsyn_novimsynfoldlevelerror = 1 " :syn foldlevel error + g:vimsyn_novimsynspellerror = 1 " :syn spell error + g:vimsyn_novimsyncerror = 1 " :syn sync error + g:vimsyn_novimhictermerror = 1 " :hi error + g:vimsyn_vimhikeyerror = 1 " :hi key=arg error +< +To force highlighting of Neovim specific Vim script elements (even if not +using Neovim), set > + let g:vimsyn_vim_features = ['nvim'] +< WDL *wdl.vim* *wdl-syntax* @@ -5432,6 +5490,10 @@ in their own color. See |:highlight-default| for the optional [default] argument. +:hi[ghlight][!] [default] link {from-group} {to-group} +:hi[ghlight][!] [default] link {from-group} NONE + See |:hi-link|. + Normally a highlight group is added once when starting up. This sets the default values for the highlighting. After that, you can use additional highlight commands to change the arguments that you want to set to non-default @@ -5795,6 +5857,9 @@ DiffChange Diff mode: Changed line. |diff.txt| DiffDelete Diff mode: Deleted line. |diff.txt| *hl-DiffText* DiffText Diff mode: Changed text within a changed line. |diff.txt| + *hl-DiffTextAdd* +DiffTextAdd Diff mode: Added text within a changed line. Linked to + |hl-DiffText| by default. |diff.txt| *hl-EndOfBuffer* EndOfBuffer Filler lines (~) after the last line in the buffer. By default, this is highlighted like |hl-NonText|. @@ -5831,8 +5896,8 @@ CursorLineSign Like SignColumn when 'cursorline' is set for the cursor line. MatchParen Character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt| *hl-MessageWindow* -MessageWindow Messages popup window used by `:echowindow`. If not defined - |hl-WarningMsg| is used. +MessageWindow Messages popup window used by `:echowindow`. Linked to + |hl-WarningMsg| by default. *hl-ModeMsg* ModeMsg 'showmode' message (e.g., "-- INSERT --"). *hl-MsgArea* @@ -5872,10 +5937,13 @@ PmenuMatchSel Popup menu: Matched text in selected item. Applied in combination with |hl-PmenuSel|. *hl-ComplMatchIns* ComplMatchIns Matched text of the currently inserted completion. + *hl-PopupSelected* +PopupSelected Popup window created with |popup_menu()|. Linked to + |hl-PmenuSel| by default. *hl-PopupNotification* PopupNotification - Popup window created with |popup_notification()|. If not - defined |hl-WarningMsg| is used. + Popup window created with |popup_notification()|. Linked to + |hl-WarningMsg| by default. *hl-Question* Question |hit-enter| prompt and yes/no questions. *hl-QuickFixLine* diff --git a/runtime/doc/tags b/runtime/doc/tags index eb9c48c2..b820c960 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -129,10 +129,13 @@ $quote eval.txt /*$quote* 'cdpath' options.txt /*'cdpath'* 'cedit' options.txt /*'cedit'* 'cf' options.txt /*'cf'* +'cfc' options.txt /*'cfc'* 'cfu' options.txt /*'cfu'* 'ch' options.txt /*'ch'* 'character' intro.txt /*'character'* 'charconvert' options.txt /*'charconvert'* +'chi' options.txt /*'chi'* +'chistory' options.txt /*'chistory'* 'ci' options.txt /*'ci'* 'cia' options.txt /*'cia'* 'cin' options.txt /*'cin'* @@ -162,6 +165,7 @@ $quote eval.txt /*$quote* 'compatible' options.txt /*'compatible'* 'complete' options.txt /*'complete'* 'completefunc' options.txt /*'completefunc'* +'completefuzzycollect' options.txt /*'completefuzzycollect'* 'completeitemalign' options.txt /*'completeitemalign'* 'completeopt' options.txt /*'completeopt'* 'completepopup' options.txt /*'completepopup'* @@ -432,6 +436,8 @@ $quote eval.txt /*$quote* 'infercase' options.txt /*'infercase'* 'insertmode' options.txt /*'insertmode'* 'is' options.txt /*'is'* +'ise' options.txt /*'ise'* +'isexpand' options.txt /*'isexpand'* 'isf' options.txt /*'isf'* 'isfname' options.txt /*'isfname'* 'isi' options.txt /*'isi'* @@ -461,6 +467,8 @@ $quote eval.txt /*$quote* 'lazyredraw' options.txt /*'lazyredraw'* 'lbr' options.txt /*'lbr'* 'lcs' options.txt /*'lcs'* +'lhi' options.txt /*'lhi'* +'lhistory' options.txt /*'lhistory'* 'linebreak' options.txt /*'linebreak'* 'lines' options.txt /*'lines'* 'linespace' options.txt /*'linespace'* @@ -841,6 +849,7 @@ $quote eval.txt /*$quote* 'pm' options.txt /*'pm'* 'pmbcs' options.txt /*'pmbcs'* 'pmbfn' options.txt /*'pmbfn'* +'pmw' options.txt /*'pmw'* 'popt' options.txt /*'popt'* 'pp' options.txt /*'pp'* 'preserveindent' options.txt /*'preserveindent'* @@ -858,6 +867,7 @@ $quote eval.txt /*$quote* 'prompt' options.txt /*'prompt'* 'pt' options.txt /*'pt'* 'pumheight' options.txt /*'pumheight'* +'pummaxwidth' options.txt /*'pummaxwidth'* 'pumwidth' options.txt /*'pumwidth'* 'pvh' options.txt /*'pvh'* 'pvp' options.txt /*'pvp'* @@ -2140,6 +2150,7 @@ $quote eval.txt /*$quote* :Lfilter quickfix.txt /*:Lfilter* :LogiPat pi_logipat.txt /*:LogiPat* :Man filetype.txt /*:Man* +:ManReload filetype.txt /*:ManReload* :MkVimball pi_vimball.txt /*:MkVimball* :N editing.txt /*:N* :Nexplore pi_netrw.txt /*:Nexplore* @@ -2183,6 +2194,7 @@ $quote eval.txt /*$quote* :TermdebugCommand terminal.txt /*:TermdebugCommand* :Texplore pi_netrw.txt /*:Texplore* :Tutor pi_tutor.txt /*:Tutor* +:URLOpen eval.txt /*:URLOpen* :Until terminal.txt /*:Until* :Up terminal.txt /*:Up* :UseVimball pi_vimball.txt /*:UseVimball* @@ -2707,6 +2719,8 @@ $quote eval.txt /*$quote* :insert insert.txt /*:insert* :interface vim9class.txt /*:interface* :intro starting.txt /*:intro* +:ip change.txt /*:ip* +:iput change.txt /*:iput* :is tagsrch.txt /*:is* :isearch tagsrch.txt /*:isearch* :isp tagsrch.txt /*:isp* @@ -4067,6 +4081,7 @@ Cmdline-mode cmdline.txt /*Cmdline-mode* CmdlineChanged autocmd.txt /*CmdlineChanged* CmdlineEnter autocmd.txt /*CmdlineEnter* CmdlineLeave autocmd.txt /*CmdlineLeave* +CmdlineLeavePre autocmd.txt /*CmdlineLeavePre* CmdwinEnter autocmd.txt /*CmdwinEnter* CmdwinLeave autocmd.txt /*CmdwinLeave* ColorScheme autocmd.txt /*ColorScheme* @@ -4586,9 +4601,35 @@ E1512 options.txt /*E1512* E1513 message.txt /*E1513* E1514 options.txt /*E1514* E1515 builtin.txt /*E1515* +E1516 builtin.txt /*E1516* +E1517 eval.txt /*E1517* +E1518 eval.txt /*E1518* +E1519 eval.txt /*E1519* E152 helphelp.txt /*E152* +E1520 eval.txt /*E1520* +E1521 eval.txt /*E1521* +E1522 eval.txt /*E1522* +E1523 eval.txt /*E1523* +E1524 eval.txt /*E1524* +E1525 builtin.txt /*E1525* +E1526 eval.txt /*E1526* +E1527 eval.txt /*E1527* +E1528 vim9.txt /*E1528* +E1529 vim9.txt /*E1529* E153 helphelp.txt /*E153* +E1530 vim9.txt /*E1530* +E1531 vim9.txt /*E1531* +E1532 eval.txt /*E1532* +E1533 eval.txt /*E1533* +E1534 vim9.txt /*E1534* +E1535 eval.txt /*E1535* +E1536 eval.txt /*E1536* +E1537 eval.txt /*E1537* +E1538 eval.txt /*E1538* +E1539 vim9.txt /*E1539* E154 helphelp.txt /*E154* +E1540 eval.txt /*E1540* +E1541 vi_diff.txt /*E1541* E155 sign.txt /*E155* E156 sign.txt /*E156* E157 sign.txt /*E157* @@ -5756,6 +5797,7 @@ TSQL ft_sql.txt /*TSQL* TTpro-telnet syntax.txt /*TTpro-telnet* Tab intro.txt /*Tab* TabClosed autocmd.txt /*TabClosed* +TabClosedPre autocmd.txt /*TabClosedPre* TabEnter autocmd.txt /*TabEnter* TabLeave autocmd.txt /*TabLeave* TabNew autocmd.txt /*TabNew* @@ -5778,6 +5820,8 @@ TextChangedP autocmd.txt /*TextChangedP* TextChangedT autocmd.txt /*TextChangedT* TextYankPost autocmd.txt /*TextYankPost* Transact-SQL ft_sql.txt /*Transact-SQL* +Tuple eval.txt /*Tuple* +Tuples eval.txt /*Tuples* U undo.txt /*U* UTF-8 mbyte.txt /*UTF-8* UTF8-xterm mbyte.txt /*UTF8-xterm* @@ -6527,6 +6571,7 @@ close_cb channel.txt /*close_cb* closure eval.txt /*closure* cmdarg-variable eval.txt /*cmdarg-variable* cmdbang-variable eval.txt /*cmdbang-variable* +cmdcomplete_info() builtin.txt /*cmdcomplete_info()* cmdline-arguments vi_diff.txt /*cmdline-arguments* cmdline-changed version5.txt /*cmdline-changed* cmdline-completion cmdline.txt /*cmdline-completion* @@ -6587,6 +6632,7 @@ compiler-ruff quickfix.txt /*compiler-ruff* compiler-select quickfix.txt /*compiler-select* compiler-spotbugs quickfix.txt /*compiler-spotbugs* compiler-tex quickfix.txt /*compiler-tex* +compiler-tsc quickfix.txt /*compiler-tsc* compiler-typst quickfix.txt /*compiler-typst* compiler-vaxada ft_ada.txt /*compiler-vaxada* compl-current insert.txt /*compl-current* @@ -6599,6 +6645,7 @@ compl-keyword insert.txt /*compl-keyword* compl-omni insert.txt /*compl-omni* compl-omni-filetypes insert.txt /*compl-omni-filetypes* compl-spelling insert.txt /*compl-spelling* +compl-states insert.txt /*compl-states* compl-stop insert.txt /*compl-stop* compl-tag insert.txt /*compl-tag* compl-thesaurus insert.txt /*compl-thesaurus* @@ -6619,6 +6666,7 @@ complete_add() builtin.txt /*complete_add()* complete_check() builtin.txt /*complete_check()* complete_info() builtin.txt /*complete_info()* complete_info_mode builtin.txt /*complete_info_mode* +complete_match() builtin.txt /*complete_match()* completed_item-variable eval.txt /*completed_item-variable* completion-functions usr_41.txt /*completion-functions* complex-change change.txt /*complex-change* @@ -6717,6 +6765,7 @@ creating-menus gui.txt /*creating-menus* credits intro.txt /*credits* crontab options.txt /*crontab* cs-find if_cscop.txt /*cs-find* +cs.vim syntax.txt /*cs.vim* cs7-problem term.txt /*cs7-problem* cscope if_cscop.txt /*cscope* cscope-commands if_cscop.txt /*cscope-commands* @@ -7314,6 +7363,7 @@ ft-context-intro ft_context.txt /*ft-context-intro* ft-context-mappings ft_context.txt /*ft-context-mappings* ft-context-settings ft_context.txt /*ft-context-settings* ft-cpp-syntax syntax.txt /*ft-cpp-syntax* +ft-cs-syntax syntax.txt /*ft-cs-syntax* ft-csh-syntax syntax.txt /*ft-csh-syntax* ft-css-omni insert.txt /*ft-css-omni* ft-csv-syntax syntax.txt /*ft-csv-syntax* @@ -7343,14 +7393,18 @@ ft-freebasic-syntax syntax.txt /*ft-freebasic-syntax* ft-fvwm-syntax syntax.txt /*ft-fvwm-syntax* ft-gdscript-plugin filetype.txt /*ft-gdscript-plugin* ft-gitcommit-plugin filetype.txt /*ft-gitcommit-plugin* +ft-gitrebase-plugin filetype.txt /*ft-gitrebase-plugin* +ft-gleam-plugin filetype.txt /*ft-gleam-plugin* ft-go-plugin filetype.txt /*ft-go-plugin* ft-gprof-plugin filetype.txt /*ft-gprof-plugin* ft-groff-syntax syntax.txt /*ft-groff-syntax* ft-gsp-syntax syntax.txt /*ft-gsp-syntax* ft-hare filetype.txt /*ft-hare* ft-haskell-syntax syntax.txt /*ft-haskell-syntax* +ft-help-omni helphelp.txt /*ft-help-omni* ft-html-indent indent.txt /*ft-html-indent* ft-html-omni insert.txt /*ft-html-omni* +ft-html-plugin filetype.txt /*ft-html-plugin* ft-html-syntax syntax.txt /*ft-html-syntax* ft-htmlos-syntax syntax.txt /*ft-htmlos-syntax* ft-ia64-syntax syntax.txt /*ft-ia64-syntax* @@ -7384,6 +7438,7 @@ ft-markdown-syntax syntax.txt /*ft-markdown-syntax* ft-masm-syntax syntax.txt /*ft-masm-syntax* ft-mathematica-syntax syntax.txt /*ft-mathematica-syntax* ft-matlab-indent indent.txt /*ft-matlab-indent* +ft-mbsync-syntax syntax.txt /*ft-mbsync-syntax* ft-mediawiki-syntax syntax.txt /*ft-mediawiki-syntax* ft-metafont ft_mp.txt /*ft-metafont* ft-metafont-intro ft_mp.txt /*ft-metafont-intro* @@ -7417,6 +7472,7 @@ ft-php-syntax syntax.txt /*ft-php-syntax* ft-php3-syntax syntax.txt /*ft-php3-syntax* ft-phtml-syntax syntax.txt /*ft-phtml-syntax* ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax* +ft-plsql-plugin filetype.txt /*ft-plsql-plugin* ft-posix-syntax syntax.txt /*ft-posix-syntax* ft-postscr-syntax syntax.txt /*ft-postscr-syntax* ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax* @@ -7480,6 +7536,7 @@ ft-xml-omni insert.txt /*ft-xml-omni* ft-xml-syntax syntax.txt /*ft-xml-syntax* ft-xpm-syntax syntax.txt /*ft-xpm-syntax* ft-yaml-indent indent.txt /*ft-yaml-indent* +ft-yaml-plugin filetype.txt /*ft-yaml-plugin* ft-yaml-syntax syntax.txt /*ft-yaml-syntax* ft-zig-plugin filetype.txt /*ft-zig-plugin* ft-zimbu-plugin filetype.txt /*ft-zimbu-plugin* @@ -7578,6 +7635,7 @@ g:filetype_csh syntax.txt /*g:filetype_csh* g:filetype_haredoc ft_hare.txt /*g:filetype_haredoc* g:filetype_md syntax.txt /*g:filetype_md* g:filetype_r syntax.txt /*g:filetype_r* +g:ft_man_implementation filetype.txt /*g:ft_man_implementation* g:ftplugin_rust_source_path ft_rust.txt /*g:ftplugin_rust_source_path* g:gnat ft_ada.txt /*g:gnat* g:gnat.Error_Format ft_ada.txt /*g:gnat.Error_Format* @@ -7625,6 +7683,9 @@ g:html_use_input_for_pc syntax.txt /*g:html_use_input_for_pc* g:html_use_xhtml syntax.txt /*g:html_use_xhtml* g:html_whole_filler syntax.txt /*g:html_whole_filler* g:lf_shell_syntax syntax.txt /*g:lf_shell_syntax* +g:lua_folding filetype.txt /*g:lua_folding* +g:lua_subversion filetype.txt /*g:lua_subversion* +g:lua_version filetype.txt /*g:lua_version* g:markdown_fenced_languages syntax.txt /*g:markdown_fenced_languages* g:markdown_minlines syntax.txt /*g:markdown_minlines* g:markdown_syntax_conceal syntax.txt /*g:markdown_syntax_conceal* @@ -7715,7 +7776,6 @@ g:netrw_sshport pi_netrw.txt /*g:netrw_sshport* g:netrw_timefmt pi_netrw.txt /*g:netrw_timefmt* g:netrw_tmpfile_escape pi_netrw.txt /*g:netrw_tmpfile_escape* g:netrw_uid pi_netrw.txt /*g:netrw_uid* -g:netrw_use_errorwindow pi_netrw.txt /*g:netrw_use_errorwindow* g:netrw_use_noswf pi_netrw.txt /*g:netrw_use_noswf* g:netrw_use_nt_rcp pi_netrw.txt /*g:netrw_use_nt_rcp* g:netrw_usetab pi_netrw.txt /*g:netrw_usetab* @@ -7856,6 +7916,7 @@ get()-blob builtin.txt /*get()-blob* get()-dict builtin.txt /*get()-dict* get()-func builtin.txt /*get()-func* get()-list builtin.txt /*get()-list* +get()-tuple builtin.txt /*get()-tuple* get-ms-debuggers debug.txt /*get-ms-debuggers* getbufinfo() builtin.txt /*getbufinfo()* getbufline() builtin.txt /*getbufline()* @@ -8162,6 +8223,7 @@ hl-DiffAdd syntax.txt /*hl-DiffAdd* hl-DiffChange syntax.txt /*hl-DiffChange* hl-DiffDelete syntax.txt /*hl-DiffDelete* hl-DiffText syntax.txt /*hl-DiffText* +hl-DiffTextAdd syntax.txt /*hl-DiffTextAdd* hl-Directory syntax.txt /*hl-Directory* hl-EndOfBuffer syntax.txt /*hl-EndOfBuffer* hl-ErrorMsg syntax.txt /*hl-ErrorMsg* @@ -8191,6 +8253,7 @@ hl-PmenuSbar syntax.txt /*hl-PmenuSbar* hl-PmenuSel syntax.txt /*hl-PmenuSel* hl-PmenuThumb syntax.txt /*hl-PmenuThumb* hl-PopupNotification syntax.txt /*hl-PopupNotification* +hl-PopupSelected syntax.txt /*hl-PopupSelected* hl-Question syntax.txt /*hl-Question* hl-QuickFixLine syntax.txt /*hl-QuickFixLine* hl-Scrollbar syntax.txt /*hl-Scrollbar* @@ -8230,6 +8293,7 @@ hlexists() builtin.txt /*hlexists()* hlget() builtin.txt /*hlget()* hlsearch-variable eval.txt /*hlsearch-variable* hlset() builtin.txt /*hlset()* +hlyank-install usr_05.txt /*hlyank-install* holy-grail index.txt /*holy-grail* home intro.txt /*home* home-replace editing.txt /*home-replace* @@ -8540,7 +8604,6 @@ jsbterm-mouse options.txt /*jsbterm-mouse* json.vim syntax.txt /*json.vim* json_decode() builtin.txt /*json_decode()* json_encode() builtin.txt /*json_encode()* -jtags tagsrch.txt /*jtags* jump-motions motion.txt /*jump-motions* jumplist motion.txt /*jumplist* jumplist-stack motion.txt /*jumplist-stack* @@ -8634,6 +8697,7 @@ list-modification eval.txt /*list-modification* list-repeat windows.txt /*list-repeat* list2blob() builtin.txt /*list2blob()* list2str() builtin.txt /*list2str()* +list2tuple() builtin.txt /*list2tuple()* listener_add() builtin.txt /*listener_add()* listener_flush() builtin.txt /*listener_flush()* listener_remove() builtin.txt /*listener_remove()* @@ -8798,6 +8862,7 @@ matlab-indent indent.txt /*matlab-indent* matlab-indenting indent.txt /*matlab-indenting* max() builtin.txt /*max()* maxcol-variable eval.txt /*maxcol-variable* +mbsync.vim syntax.txt /*mbsync.vim* mbyte-IME mbyte.txt /*mbyte-IME* mbyte-XIM mbyte.txt /*mbyte-XIM* mbyte-combining mbyte.txt /*mbyte-combining* @@ -9001,6 +9066,7 @@ netrw-ctrl-h pi_netrw.txt /*netrw-ctrl-h* netrw-ctrl-l pi_netrw.txt /*netrw-ctrl-l* netrw-ctrl-r pi_netrw.txt /*netrw-ctrl-r* netrw-ctrl_l pi_netrw.txt /*netrw-ctrl_l* +netrw-curdir pi_netrw.txt /*netrw-curdir* netrw-d pi_netrw.txt /*netrw-d* netrw-del pi_netrw.txt /*netrw-del* netrw-delete pi_netrw.txt /*netrw-delete* @@ -9393,9 +9459,11 @@ package-doc repeat.txt /*package-doc* package-documentation repeat.txt /*package-documentation* package-editorconfig usr_05.txt /*package-editorconfig* package-helptoc helphelp.txt /*package-helptoc* +package-hlyank usr_05.txt /*package-hlyank* package-justify usr_25.txt /*package-justify* package-matchit usr_05.txt /*package-matchit* package-nohlsearch usr_05.txt /*package-nohlsearch* +package-open eval.txt /*package-open* package-termdebug terminal.txt /*package-termdebug* package-translate_example repeat.txt /*package-translate_example* package-translation repeat.txt /*package-translation* @@ -9474,6 +9542,7 @@ phtml.vim syntax.txt /*phtml.vim* pi_getscript.txt pi_getscript.txt /*pi_getscript.txt* pi_gzip.txt pi_gzip.txt /*pi_gzip.txt* pi_logipat.txt pi_logipat.txt /*pi_logipat.txt* +pi_netrw.txt pi_netrw.txt /*pi_netrw.txt* pi_paren.txt pi_paren.txt /*pi_paren.txt* pi_spec.txt pi_spec.txt /*pi_spec.txt* pi_tar.txt pi_tar.txt /*pi_tar.txt* @@ -9635,6 +9704,7 @@ python-2-and-3 if_pyth.txt /*python-2-and-3* python-Dictionary if_pyth.txt /*python-Dictionary* python-Function if_pyth.txt /*python-Function* python-List if_pyth.txt /*python-List* +python-Tuple if_pyth.txt /*python-Tuple* python-VIM_SPECIAL_PATH if_pyth.txt /*python-VIM_SPECIAL_PATH* python-_get_paths if_pyth.txt /*python-_get_paths* python-bindeval if_pyth.txt /*python-bindeval* @@ -9712,6 +9782,7 @@ quickfix-pandoc quickfix.txt /*quickfix-pandoc* quickfix-parse quickfix.txt /*quickfix-parse* quickfix-perl quickfix.txt /*quickfix-perl* quickfix-size quickfix.txt /*quickfix-size* +quickfix-stack quickfix.txt /*quickfix-stack* quickfix-title quickfix.txt /*quickfix-title* quickfix-valid quickfix.txt /*quickfix-valid* quickfix-window quickfix.txt /*quickfix-window* @@ -10305,6 +10376,7 @@ subscript eval.txt /*subscript* substitute() builtin.txt /*substitute()* substitute-CR version6.txt /*substitute-CR* substring eval.txt /*substring* +subtuple eval.txt /*subtuple* suffixes cmdline.txt /*suffixes* suspend starting.txt /*suspend* swap-exists-choices usr_11.txt /*swap-exists-choices* @@ -10554,6 +10626,7 @@ t_ti term.txt /*t_ti* t_tp version4.txt /*t_tp* t_ts term.txt /*t_ts* t_ts_old version4.txt /*t_ts_old* +t_tuple-variable eval.txt /*t_tuple-variable* t_typealias-variable eval.txt /*t_typealias-variable* t_u7 term.txt /*t_u7* t_ue term.txt /*t_ue* @@ -10616,6 +10689,7 @@ tar-contents pi_tar.txt /*tar-contents* tar-copyright pi_tar.txt /*tar-copyright* tar-history pi_tar.txt /*tar-history* tar-manual pi_tar.txt /*tar-manual* +tar-mappings pi_tar.txt /*tar-mappings* tar-options pi_tar.txt /*tar-options* tar-usage pi_tar.txt /*tar-usage* tcl if_tcl.txt /*tcl* @@ -10790,6 +10864,7 @@ test_null_job() testing.txt /*test_null_job()* test_null_list() testing.txt /*test_null_list()* test_null_partial() testing.txt /*test_null_partial()* test_null_string() testing.txt /*test_null_string()* +test_null_tuple() testing.txt /*test_null_tuple()* test_option_not_set() testing.txt /*test_option_not_set()* test_override() testing.txt /*test_override()* test_refcount() testing.txt /*test_refcount()* @@ -10875,6 +10950,14 @@ try-echoerr eval.txt /*try-echoerr* try-finally eval.txt /*try-finally* try-nested eval.txt /*try-nested* try-nesting eval.txt /*try-nesting* +tuple eval.txt /*tuple* +tuple-concatenation eval.txt /*tuple-concatenation* +tuple-functions usr_41.txt /*tuple-functions* +tuple-identity eval.txt /*tuple-identity* +tuple-index eval.txt /*tuple-index* +tuple-modification eval.txt /*tuple-modification* +tuple-type vim9.txt /*tuple-type* +tuple2list() builtin.txt /*tuple2list()* tutor usr_01.txt /*tutor* two-engines pattern.txt /*two-engines* type() builtin.txt /*type()* @@ -11071,6 +11154,7 @@ v:t_none eval.txt /*v:t_none* v:t_number eval.txt /*v:t_number* v:t_object eval.txt /*v:t_object* v:t_string eval.txt /*v:t_string* +v:t_tuple eval.txt /*v:t_tuple* v:t_typealias eval.txt /*v:t_typealias* v:termblinkresp eval.txt /*v:termblinkresp* v:termrbgresp eval.txt /*v:termrbgresp* @@ -11210,6 +11294,7 @@ variable-categories vim9.txt /*variable-categories* variable-scope eval.txt /*variable-scope* variable-types vim9.txt /*variable-types* variables eval.txt /*variables* +variadic-tuple vim9.txt /*variadic-tuple* various various.txt /*various* various-cmds various.txt /*various-cmds* various-functions usr_41.txt /*various-functions* @@ -11299,6 +11384,7 @@ vim-modes-intro intro.txt /*vim-modes-intro* vim-raku ft_raku.txt /*vim-raku* vim-script-intro usr_41.txt /*vim-script-intro* vim-script-library eval.txt /*vim-script-library* +vim-script-notation usr_41.txt /*vim-script-notation* vim-security intro.txt /*vim-security* vim-shebang various.txt /*vim-shebang* vim-tutor-create pi_tutor.txt /*vim-tutor-create* diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index 858309a2..0717f2ff 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -1,4 +1,4 @@ -*tagsrch.txt* For Vim version 9.1. Last change: 2024 Aug 01 +*tagsrch.txt* For Vim version 9.1. Last change: 2025 May 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -526,7 +526,7 @@ directory where the tag file is. ============================================================================== 5. Tags file format *tags-file-format* *E431* - *ctags* *jtags* + *ctags* A tags file can be created with an external command, for example "ctags". It will contain a tag for each function. Some versions of "ctags" will also make a tag for each "#defined" macro, typedefs, enums, etc. @@ -542,13 +542,11 @@ exuberant ctags This is a very good one. It works for C, C++, Java, many items. See http://ctags.sourceforge.net. No new version since 2009. etags Connected to Emacs. Supports many languages. -JTags For Java, in Java. It can be found at - http://www.fleiner.com/jtags/. +|:helptags| For Vim's |help| files ptags.py For Python, in Python. Found in your Python source directory at Tools/scripts/ptags.py. -ptags For Perl, in Perl. It can be found at (link seems - dead): - http://www.eleves.ens.fr:8080/home/nthiery/Tags/. +ptags For Perl, in Perl. It can be found at + https://metacpan.org/pod/Vim::Tag gnatxref For Ada. See http://www.gnuada.org/. gnatxref is part of the gnat package. @@ -894,8 +892,8 @@ Common arguments for the commands above: 7. Using 'tagfunc' *tag-function* It is possible to provide Vim with a function which will generate a list of -tags used for commands like |:tag|, |:tselect| and Normal mode tag commands -like |CTRL-]|. +tags used for commands like |:tag|, |:tselect|, Normal mode tag commands like +|CTRL-]| and for the |taglist()| function. The function used for generating the taglist is specified by setting the 'tagfunc' option. The function will be called with three arguments: @@ -914,7 +912,7 @@ Currently up to three flags may be passed to the tag function: (mnemonic: the tag function may use the context around the cursor to perform a better job of generating the tag list.) 'i' In Insert mode, the user was completing a tag (with - |i_CTRL-X_CTRL-]| or 'completeopt' contains `t`). + |i_CTRL-X_CTRL-]| or 'complete' contains "`t`" or "`]`"). 'r' The first argument to tagfunc should be interpreted as a |pattern| (see |tag-regexp|), such as when using: > :tag /pat @@ -950,15 +948,14 @@ It is not allowed to close a window or change window from inside 'tagfunc'. The following is a hypothetical example of a function used for 'tagfunc'. It uses the output of |taglist()| to generate the result: a list of tags in the inverse order of file names. -> - function TagFunc(pattern, flags, info) - function CompareFilenames(item1, item2) - let f1 = a:item1['filename'] - let f2 = a:item2['filename'] - return f1 >=# f2 ? - \ -1 : f1 <=# f2 ? 1 : 0 - endfunction +>vim + function CompareFilenames(item1, item2) + let f1 = a:item1['filename'] + let f2 = a:item2['filename'] + return f1 >=# f2 ? -1 : f1 <=# f2 ? 1 : 0 + endfunction + function TagFunc(pattern, flags, info) let result = taglist(a:pattern) call sort(result, "CompareFilenames") @@ -966,5 +963,7 @@ inverse order of file names. endfunc set tagfunc=TagFunc < +Note: When executing |taglist()| the 'tagfunc' function won't be called +recursively. vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index 53e2dcd0..1d502abc 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -1,4 +1,4 @@ -*terminal.txt* For Vim version 9.1. Last change: 2025 Feb 13 +*terminal.txt* For Vim version 9.1. Last change: 2025 Feb 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1092,11 +1092,11 @@ Currently supported commands: Example in JSON: > ["drop", "path/file.txt", {"ff": "dos"}] -A trick to have Vim send this escape sequence: > - exe "set t_ts=\]51; t_fs=\x07" - let &titlestring = '["call","Tapi_TryThis",["hello",123]]' - redraw - set t_ts& t_fs& +You can use |echoraw()| to make Vim send this escape sequence: > + call echoraw("\]51;[\"call\", \"Tapi_TryThis\", [\"hello\", 123]]\x07") + call echoraw("\]51;[\"drop\", \"README.md\"]\x07") +Note: JSON requires double quotes around string values, hence those have to be +escaped. Rationale: Why not allow for any command or expression? Because that might create a security problem. diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index 7d0402c1..e6f4590c 100644 --- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -1,4 +1,4 @@ -*testing.txt* For Vim version 9.1. Last change: 2024 Jul 18 +*testing.txt* For Vim version 9.1. Last change: 2025 Mar 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -68,7 +68,7 @@ test_feedinput({string}) *test_feedinput()* test_garbagecollect_now() *test_garbagecollect_now()* - Like garbagecollect(), but executed right away. This must + Like |garbagecollect()|, but executed right away. This must only be called directly to avoid any structure to exist internally, and |v:testing| must have been set before calling any function. *E1142* @@ -364,6 +364,11 @@ test_null_string() *test_null_string()* Return type: |String| +test_null_tuple() *test_null_tuple()* + Return a |Tuple| that is null. Only useful for testing. + + Return type: |Tuple| + test_option_not_set({name}) *test_option_not_set()* Reset the flag that indicates option {name} was set. Thus it looks like it still has the default value. Use like this: > diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 5338b8b0..52236878 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 9.1. Last change: 2025 Feb 02 +*todo.txt* For Vim version 9.1. Last change: 2025 Apr 24 VIM REFERENCE MANUAL by Bram Moolenaar @@ -357,8 +357,6 @@ https://github.com/vim/vim/pull/5566 PR #11579 to add visualtext(), return Visually selected text. -PR #12032: Support Python 3 stable ABI. - PR #11860: Add more info to 'colorcolumn': display a character and highlight for each separate entry. Disadvantage: option value gets very complicated with multiple entries, e.g. every 8 columns. @@ -706,8 +704,6 @@ find them. (Max Kukartsev, #6218) Enable 'termbidi' if $VTE_VERSION >= 5703 ? -Python 3.8 doesn't work. (Antonios Hadjigeorgalis, #5509) - "--cleanFOO" does not result in an error. (#5537) Output from assert_equalfile() doesn't give a hint about what's different. @@ -1490,8 +1486,6 @@ github with a URL like this: https://github.com/vim/vim/compare/v7.4.920%5E...v7.4.920.diff Diff for version.c contains more context, can't skip a patch. -Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) - Comparing nested structures with "==" uses a different comparator than when comparing individual items. @@ -1514,9 +1508,6 @@ C highlighting: modern C allows: /* comment */ #ifdef and also line continuation after #include. I can't recommend it though. -Build with Python on Mac does not always use the right library. -(Kazunobu Kuriyama, 2015 Mar 28) - To support Thai (and other languages) word boundaries, include the ICU library: http://userguide.icu-project.org/boundaryanalysis @@ -1793,13 +1784,6 @@ Problem with refresh:always in completion. (Tyler Wade, 2013 Mar 17) b:undo_ftplugin cannot call a script-local function. (Boris Danilov, 2013 Jan 7) -Win32: The Python interface only works with one version of Python, selected at -compile time. Can this be made to work with version 2.1 and 2.2 dynamically? - -Python: Be able to define a Python function that can be called directly from -Vim script. Requires converting the arguments and return value, like with -vim.bindeval(). - Patch for :tabcloseleft, after closing a tab go to left tab. (William Bowers, 2012 Aug 4) @@ -2912,6 +2896,20 @@ Quickfix/Location List: 7 Add a command that goes back to the position from before jumping to the first quickfix location. + +Python Interface: +- Python 3.8 doesn't work. (Antonios Hadjigeorgalis, #5509) +- Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) +- Build with Python on Mac does not always use the right library. + (Kazunobu Kuriyama, 2015 Mar 28) +- Win32: The Python interface only works with one version of Python, + selected at compile time. Can this be made to work with version 2.1 and + 2.2 dynamically? +- Be able to define a Python function that can be called directly from Vim + script. Requires converting the arguments and return value, like with + vim.bindeval(). + + Vi incompatibility: - Try new POSIX tests, made after my comments. (Geoff Clare, 2005 April 7) Version 1.5 is in ~/src/posix/1.5. (Lynne Canal) @@ -4736,8 +4734,6 @@ Omni completion: Insert mode completion/expansion: - Is it possible to keep the complete menu open when calling complete()? (Prabir Shrestha, 2017 May 19, #1713) -- When 'completeopt' has "noselect" does not insert a newline. - (Lifepillar, 2017 Apr 23, #1653) - When complete() first argument is before where insert started and 'backspace' is Vi compatible, the completion fails. (Hirohito Higashi, 2015 Feb 19) @@ -4753,20 +4749,10 @@ Insert mode completion/expansion: 7 When expanding file names with an environment variable, add the match with the unexpanded var. So $HOME/tm expands to "/home/guy/tmp" and "$HOME/tmp" -8 When there is no word before the cursor but something like "sys." complete - with "sys.". Works well for C and similar languages. 9 ^X^L completion doesn't repeat correctly. It uses the first match with the last added line, instead of continuing where the last match ended. (Webb) -8 Add option to set different behavior for Insert mode completion: - - ignore/match case - - different characters than 'iskeyword' -8 Add option 'isexpand', containing characters when doing expansion (so that - "." and "\" can be included, without changing 'iskeyword'). (Goldfarb) - Also: 'istagword': characters used for CTRL-]. - When 'isexpand' or 'istagword' are empty, use 'iskeyword'. - Alternative: Use a pattern so that start and end of a keyword can be - defined, only allow dash in the middle, etc. +8 Add option 'istagword': characters used for CTRL-]. like 'isexpand' 8 Add a command to undo the completion, go back to the original text. 7 Completion of an abbreviation: Can leave letters out, like what Instant text does: www.textware.com @@ -6278,5 +6264,4 @@ Far future and "big" extensions: are reflected in each Vim immediately. Could work with local files but also over the internet. See http://www.codingmonkeys.de/subethaedit/. -vim:tw=78:sw=4:sts=4:ts=8:noet:ft=help:norl: -vim: set fo+=n : +vim:tw=78:sw=4:sts=4:ts=8:noet:ft=help:norl:fo+=n: diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index 93231f6c..fea6cddd 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -1,4 +1,4 @@ -*usr_05.txt* For Vim version 9.1. Last change: 2025 Jan 11 +*usr_05.txt* For Vim version 9.1. Last change: 2025 Apr 10 VIM USER MANUAL - by Bram Moolenaar @@ -307,23 +307,27 @@ This switches on three very clever mechanisms: filetypes. See |:filetype-indent-on| and 'indentexpr'. - *restore-cursor* *last-position-jump* > + *restore-cursor* *last-position-jump* >vim augroup RestoreCursor autocmd! autocmd BufReadPost * \ let line = line("'\"") \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit' \ && index(['xxd', 'gitrebase'], &filetype) == -1 + \ && !&diff \ | execute "normal! g`\"" \ | endif augroup END Another autocommand. This time it is used after reading any file. The complicated stuff after it checks if the '" mark is defined, and jumps to it -if so. It doesn't do that for a commit or rebase message, which are likely -a different one than last time, and when using xxd(1) to filter and edit -binary files, which transforms input files back and forth, causing them to -have dual nature, so to speak. See also |using-xxd|. +if so. It doesn't do that when: + - editing a commit or rebase message, which are likely a different one than + last time, + - using xxd(1) to filter and edit binary files, which transforms input files + back and forth, causing them to have dual nature, so to speak (see also + |using-xxd|) and + - Vim is in diff mode The backslash at the start of a line is used to continue the command from the previous line. That avoids a line getting very long. See |line-continuation|. @@ -437,7 +441,7 @@ After restarting your Vim, the plugin is active and you can read about it at: > :h editorconfig.txt -Adding comment package *comment-install* *package-comment* +Adding the comment package *comment-install* *package-comment* Load the plugin with this command: > packadd comment @@ -450,7 +454,7 @@ the package loaded. Once the package is loaded, read about it at: > :h comment.txt -Adding nohlsearch package *nohlsearch-install* *package-nohlsearch* +Adding the nohlsearch package *nohlsearch-install* *package-nohlsearch* Load the plugin with this command: > packadd nohlsearch @@ -464,6 +468,31 @@ To disable the effect of the plugin after it has been loaded: > au! nohlsearch < +Adding the highlight-yank package *hlyank-install* *package-hlyank* + +Load the plugin with this command: > + packadd hlyank +< +This package briefly highlights the affected region of the last |yank| +command. See |52.6| for a simplified implementation using the +|getregionpos()| function. + +The plugin understands the following configuration variables (the settings +show the default values). + +To specify a different highlighting group, use: > + :let g:hlyank_hlgroup = 'IncSearch' +< +To use a different highlighting duration, use: > + :let g:hlyank_duration = 300 +The unit is milliseconds, and the upper limit is 3000 ms. If you set a value +higher than this, the highlighting duration will be 3000 ms. + +To highlight in visual mode, use: > + :let g:hlyank_invisual = v:true + +To disable the effect of the plugin after it has been loaded: > + au! hlyank More information about packages can be found here: |packages|. diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 0d09fc9c..ffa6fcb7 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 9.1. Last change: 2025 Feb 01 +*usr_41.txt* For Vim version 9.1. Last change: 2025 Apr 27 VIM USER MANUAL - by Bram Moolenaar @@ -35,8 +35,10 @@ like for example .vim files or configuration files like .vimrc and .gvimrc. These scripts may define functions, commands and settings that Vim uses to customize and extend its behavior. -With a slight abuse of nomenclature, we will use "Vim script" to refer to the -Vim scripting language throughout this documentation. This shorthand helps to + *vim-script-notation* +The correct notation is "Vim script" (or "Vim9 script" when refering to the +new Vim9 language |Vim9-script|), so we will use "Vim script" to refer to the +Vim scripting language throughout this documentation. This shorthand helps to streamline explanations and discussions about scripting with Vim. A Vim plugin is a collection of one or more Vim scripts, along with additional @@ -839,6 +841,30 @@ List manipulation: *list-functions* repeat() repeat a List multiple times flatten() flatten a List flattennew() flatten a copy of a List + items() get List of List index-value pairs + +Tuple manipulation: *tuple-functions* + copy() make a shallow copy of a Tuple + count() count number of times a value appears in a + Tuple + deepcopy() make a full copy of a Tuple + empty() check if Tuple is empty + foreach() apply function to Tuple items + get() get an item without error for wrong index + index() index of a value in a Tuple + indexof() index in a Tuple where an expression is true + items() get List of Tuple index-value pairs + join() join Tuple items into a String + len() number of items in a Tuple + list2tuple() convert a list of items into a Tuple + max() maximum value in a Tuple + min() minimum value in a Tuple + reduce() reduce a Tuple to a value + repeat() repeat a Tuple multiple times + reverse() reverse the order of items in a Tuple + slice() take a slice of a Tuple + string() string representation of a Tuple + tuple2list() convert a Tuple into a List Dictionary manipulation: *dict-functions* get() get an entry without an error for a wrong key @@ -1087,6 +1113,7 @@ Command line: *command-line-functions* getcmdwintype() return the current command-line window type getcompletion() list of command-line completion matches fullcommand() get full command name + cmdcomplete_info() get command-line completion information Quickfix and location lists: *quickfix-functions* getqflist() list of quickfix errors @@ -1099,6 +1126,8 @@ Insert mode completion: *completion-functions* complete_add() add to found matches complete_check() check if completion should be aborted complete_info() get current completion information + complete_match() get insert completion start match col and + trigger text pumvisible() check if the popup menu is displayed pum_getpos() position and size of popup menu if visible @@ -1234,6 +1263,7 @@ Testing: *test-functions* test_null_list() return a null List test_null_partial() return a null Partial function test_null_string() return a null String + test_null_tuple() return a null Tuple test_settime() set the time Vim uses internally test_setmouse() set the mouse position test_feedinput() add key sequence to input buffer @@ -1649,8 +1679,8 @@ More information about defining your own functions here: |user-functions|. ============================================================================== *41.8* Lists and Dictionaries -So far we have used the basic types String and Number. Vim also supports two -composite types: List and Dictionary. +So far we have used the basic types String and Number. Vim also supports +three composite types: List, Tuple and Dictionary. A List is an ordered sequence of items. The items can be any kind of value, thus you can make a List of numbers, a List of Lists and even a List of mixed @@ -1751,6 +1781,23 @@ This looks into lines 1 to 50 (inclusive) and echoes any date found in there. For further reading see |Lists|. +TUPLE + +A Tuple is an immutable ordered sequence of items. An item can be of any +type. Items can be accessed by their index number. To create a Tuple with +three strings: > + + var atuple = ('one', 'two', 'three') + +The Tuple items are enclosed in parenthesis and separated by commas. To +create an empty Tuple: > + + var atuple = () + +The |:for| loop can be used to iterate over the items in a Tuple similar to a +List. + +For further reading see |Tuples|. DICTIONARIES diff --git a/runtime/doc/usr_52.txt b/runtime/doc/usr_52.txt index dbfd3198..19a37dca 100644 --- a/runtime/doc/usr_52.txt +++ b/runtime/doc/usr_52.txt @@ -1,4 +1,4 @@ -*usr_52.txt* For Vim version 9.1. Last change: 2024 Oct 07 +*usr_52.txt* For Vim version 9.1. Last change: 2025 Mar 17 VIM USER MANUAL - by Bram Moolenaar @@ -346,11 +346,8 @@ Have a look at the package located at $VIMRUNTIME/pack/dist/opt/comment/ HIGHLIGHT YANK PLUGIN -Here is an example for highlighting the yanked region. It makes use of the -|getregionpos()| function, available since Vim 9.1.0446. - -Copy the following example into a new file and place it into your plugin directory -and it will be active next time you start Vim. |add-plugin|: > +Vim comes with the highlight-yank plugin, written in Vim9 script +|hlyank-install|, here is a simplified implementation: >vim vim9script @@ -362,11 +359,10 @@ and it will be active next time you start Vim. |add-plugin|: > endif var [beg, end] = [getpos("'["), getpos("']")] var type = v:event.regtype ?? 'v' - var pos = getregionpos(beg, end, {type: type}) - var end_offset = (type == 'V' || v:event.inclusive) ? 1 : 0 + var pos = getregionpos(beg, end, {type: type, exclusive: false}) var m = matchaddpos(hlgroup, pos->mapnew((_, v) => { var col_beg = v[0][2] + v[0][3] - var col_end = v[1][2] + v[1][3] + end_offset + var col_end = v[1][2] + v[1][3] + 1 return [v[0][1], col_beg, col_end - col_beg] })) var winid = win_getid() @@ -376,6 +372,9 @@ and it will be active next time you start Vim. |add-plugin|: > autocmd TextYankPost * HighlightedYank() < +For the complete example, have a look into the package located at +`$VIMRUNTIME/pack/dist/opt/hlyank/` + ============================================================================== Next chapter: |usr_90.txt| Installing Vim diff --git a/runtime/doc/usr_90.txt b/runtime/doc/usr_90.txt index 9d759895..d144303e 100644 --- a/runtime/doc/usr_90.txt +++ b/runtime/doc/usr_90.txt @@ -1,4 +1,4 @@ -*usr_90.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*usr_90.txt* For Vim version 9.1. Last change: 2025 Mar 03 VIM USER MANUAL - by Bram Moolenaar @@ -28,20 +28,18 @@ is installed in differs. used. But this may be different for your system. Try finding out where other packages are installed. When installing for a single user, you can use your home directory as the -base. The files will be placed in subdirectories like "bin" and "shared/vim". +base. The files will be placed in subdirectories like "bin" and "share/vim". FROM A PACKAGE -You can get precompiled binaries for many different UNIX systems. There is a -long list with links on this page: +Depending on the Unix/Linux system used, there may exist pre-compiled binary +packages. You need to search for this. We used to keep a list for different +UNIX systems, but that list was outdated so the list was removed. - http://www.vim.org/binaries.html - -Volunteers maintain the binaries, so they are often out of date. It is a -good idea to compile your own UNIX version from the source. Also, creating -the editor from the source allows you to control which features are compiled. -This does require a compiler though. +It is a good idea to compile your own UNIX version from the source. Also, +creating the editor from the source allows you to control which features are +compiled. This does require a compiler though. If you have a Linux distribution, the "vi" program is probably a minimal version of Vim. It doesn't do syntax highlighting, for example. Try finding @@ -52,23 +50,18 @@ FROM SOURCES To compile and install Vim, you will need the following: - - A C compiler (GCC preferred) - - The GZIP program (you can get it from www.gnu.org) - - The Vim source and runtime archives + - A C compiler (GCC or clang preferred) + - git (optionally, only when cloning from github) + - zip/unzip (to uncompress the archive) + - The Vim source archives -To get the Vim archives, look in this file for a mirror near you, this should -provide the fastest download: +To download the Vim source, you can either clone it from the Github project +page: > + git clone https://github.com/vim/vim.git +< +or download the archive directly using: - ftp://ftp.vim.org/pub/vim/MIRRORS - -Or use the home site ftp.vim.org, if you think it's fast enough. Go to the -"unix" directory and you'll find a list of files there. The version number is -embedded in the file name. You will want to get the most recent version. - You can get the files for Unix in one big archive that contains everything: - - vim-8.2.tar.bz2 ~ - -You need the bzip2 program to uncompress it. + https://github.com/vim/vim/archive/refs/heads/master.zip COMPILING @@ -80,17 +73,12 @@ First create a top directory to work in, for example: > Then unpack the archives there. You can unpack it like this: > - tar xf path/vim-8.2.tar.bz2 - -If your tar command doesn't support bz2 directly: > - - bzip2 -d -c path/vim-8.2.tar.bz2 | tar xf - + unzip vim-master.zip -Change "path" to where you have downloaded the file. If you are satisfied with getting the default features, and your environment is setup properly, you should be able to compile Vim with just this: > - cd vim82/src + cd vim-master/src make The make program will run configure and compile everything. Further on we diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 6fd4a5f7..b68c336f 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 9.1. Last change: 2025 Feb 13 +*various.txt* For Vim version 9.1. Last change: 2025 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -98,7 +98,9 @@ g8 Print the hex values of the bytes used in the *:p* *:pr* *:print* *E749* :[range]p[rint] [flags] - Print [range] lines (default current line). + Print [range] lines (default current line). Can also + be spelled `:[range]|` due to Vi compatibility (see + |:bar|). Gives an error in an empty buffer. Note: If you are looking for a way to print your text on paper see |:hardcopy|. In the GUI you can use the File.Print menu entry. diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index fbe9b986..371e4b31 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2025 Feb 11 +*version9.txt* For Vim version 9.1. Last change: 2025 May 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41553,10 +41553,23 @@ Enum support for Vim9 script |:enum| Support for protected _new() method +Add support for object<{type}> as variable data type |vim9-types| + +Diff mode ~ +--------- +Include the "linematch" algorithm for the 'diffopt' setting. This aligns +changes between buffers on similar lines improving the diff highlighting in +Vim + +Improve the diff highlighting for changes within a line. Configurable using +the "inline" sub option value for the 'diffopt' setting, with "inline:simple" +being added to the default "diffopt" value (but this does not change how diff +mode works). *new-other-9.2* Other new features ~ ------------------ -The new plugins |comment-install| and |nohlsearch-install| are included. +The new packages |package-comment|, |package-nohlsearch| and |package-hlyank| +are included. Support for Wayland UI. @@ -41569,78 +41582,101 @@ Support highlighting the matched text and the completion kind for insert-mode completion and command-line completion in |ins-completion-menu|, see |complete-items| -Include the "linematch" algorithm for the 'diffopt' setting. This aligns -changes between buffers on similar lines improving the diff highlighting in -Vim +Support for the |Tuple| data type in Vim script and Vim9 script. + + *changed-9.2* +Changed~ +------- -Adjusted default values ~ ------------------------ +Default values: ~ - the default 'history' option value has been increased to 200 and removed from |defaults.vim| - the default 'backspace' option for Vim has been set to "indent,eol,start" and removed from |defaults.vim| - the default fontsize for the GTK builds of Vim (Windows and Unix) has been - increased to 12pt to accomodate modern high-dpi monitors + increased to 12pt to accommodate modern high-dpi monitors - the default value of the 'keyprotocol' option has been updated and support for the ghostty terminal emulator (using kitty protocol) has been added -- 'termguicolors' is automatically enabled if the terminal supports the RGB - terminfo capability or supports 0x1000000 colors - *changed-9.2* -Changed~ -------- -- use 'smoothscroll' logic for CTRL-F and CTRL-B for pagewise scrolling -- use 'smoothscroll' logic for CTRL-D and CTRL-U for half-pagewise scrolling +Completion: ~ +- allow to complete directories from 'cdpath' for |:cd| and similar commands, + add the "cd_in_path" completion type for e.g. |:command-complete| and + |getcompletion()| +- allow to complete shell commands and files using the new shellcmdline + completion type using |:command-complete| and |getcmdcomplpat()| +- allow to specify additional attributes in the completion menu (allows to + mark deprecated attributes from LSP server) |complete-items| +- the completed word and completion type are provided when handling the + |CompleteDone| autocommand in the |v:event| dictionary +- |complete_info()| returns the list of matches shown in the poppu menu via + the "matches" key +- New option value for 'completeopt': + "nosort" - do not sort completion results + "preinsert" - highlight to be inserted values + "nearest" - sort completion results by distance to cursor +- handle multi-line completion items as expected +- improved commandline completion for the |:hi| command +- New option value for 'wildmode': + "noselect" - do not auto select an entry in the wildmenu +- New flags for 'complete': + "f{func}" - complete using given function + "f" - complete using 'completefunc' + "o" - complete using 'omnifunc' +- allow to limit matches for the 'complete' sources by using the + "{flag}^" notation +- add ":filetype" command completion +- add "filetypecmd" completion type for |getcompletion()| +- 'smartcase' applies to completion filtering + +Options: ~ - the default for 'commentstring' contains whitespace padding to have automatic comments look nicer |comment-install| - 'completeopt' is now a |global-local| option. - 'nrformats' accepts the new "blank" suboption, to determine a signed or unsigned number based on whitespace in front of a minus sign. +- add 'cpoptions' flag "z" |cpo-z|, to disable some (traditional) vi + behaviour/inconsistency (see |d-special| and |cw|). +- 'rulerformat' now supports the |stl-%!| item +- use 'smoothscroll' logic for CTRL-F / CTRL-B for pagewise scrolling + and CTRL-D / CTRL-U for half-pagewise scrolling +- New option value for 'fillchars': + "trunc" - configure truncation indicator, 'pummaxwidth' + "truncrl" - like "trunc" but in 'rl' mode, 'pummaxwidth' +- adjust for GTK3 dropping some mouse cursors 'mouseshape' + +Ex commands: ~ - allow to specify a priority when defining a new sign |:sign-define| -- provide information about function arguments using the get(func, "arity") - function |get()-func| - |:bwipe| also wipes jumplist and tagstack data - moving in the buffer list using |:bnext| and similar commands, behaves as documented and skips help buffers (if not run from a help buffer, else moves to the next/previous help buffer). -- allow to complete directories from 'cdpath' for |:cd| and similar commands, - add the "cd_in_path" completion type for e.g. |:command-complete| and - |getcompletion()| -- allow to complete shell commands and files using the new shellcmdline - completion type using |:command-complete| and |getcmdcomplpat()| -- add 'cpoptions' flag "z" |cpo-z|, to disable some (traditional) vi - behaviour/inconsistency (see |d-special| and |cw|). -- allow to specify additional attributes in the completion menu (allows to - mark deprecated attributes from LSP server) |complete-items| -- the regex engines match correctly case-insensitive multi-byte characters - (and apply proper case folding) - |:keeppatterns| preserves the last substitute pattern when used with |:s| + +Functions: ~ +- provide information about function arguments using the get(func, "arity") + function |get()-func| - |setqflist()| and |setloclist()| can optionally try to preserve the current selection in the quickfix list with the "u" action. +- allow to pass local Vim script variables to python interpreter |py3eval()| +- |getwininfo()| now also returns the "leftcol" property for a window +- |v:stacktrace| The stack trace of the exception most recently caught and + not finished +- Add the optional {opts} |Dict| argument to |getchar()| to control: cursor + behaviour, return type and whether or not to simplify the returned key + +Others: ~ +- the regex engines match correctly case-insensitive multi-byte characters + (and apply proper case folding) - the putty terminal is detected using an |TermResponse| autocommand in |defaults.vim| and Vim switches to a dark background - the |help-TOC| package is included to ease navigating the documentation. - an interactive tutor plugin has been included |vim-tutor-mode|, can be started via |:Tutor| - improve the |vimtutor| and add a second chapter for more advanced tips -- allow to pass local Vim script variables to python interpreter |py3eval()| -- |getwininfo()| now also returns the "leftcol" property for a window -- 'rulerformat' now supports the |stl-%!| item -- the completed word and completion type are provided when handling the - |CompleteDone| autocommand in the |v:event| dictionary -- |complete_info()| returns the list of matches shown in the poppu menu via - the "matches" key -- |v:stacktrace| The stack trace of the exception most recently caught and - not finished -- New option value for 'completeopt': - "nosort" - do not sort completion results - "preinsert" - highlight to be inserted values - add |dist#vim9#Launch()| and |dist#vim9#Open()| to the |vim-script-library| and decouple it from |netrw| - new digraph "APPROACHES THE LIMIT" using ".=" -- Add the optional {opts} |Dict| argument to |getchar()| to control: cursor - behaviour, return type and whether or not to simplify the returned key -- handle multi-line completion as expected +- |CTRL-C| always closes the active |popup-window|. *added-9.2* Added ~ @@ -41653,6 +41689,8 @@ Functions: ~ |base64_encode()| encode a blob into a base64 string |blob2str()| convert a blob into a List of strings |bindtextdomain()| set message lookup translation base path +|cmdcomplete_info()| get current cmdline completion info +|complete_match()| get completion and trigger info |diff()| diff two Lists of strings |filecopy()| copy a file {from} to {to} |foreach()| apply function to List items @@ -41664,18 +41702,23 @@ Functions: ~ |getstacktrace()| get current stack trace of Vim scripts |id()| get unique identifier for a Dict, List, Object, Channel or Blob variable +|list2tuple()| turn a List of items into a Tuple |matchbufline()| all the matches of a pattern in a buffer |matchstrlist()| all the matches of a pattern in a List of strings |ngettext()| lookup single/plural message translation |popup_setbuf()| switch to a different buffer in a popup |str2blob()| convert a List of strings into a blob +|test_null_tuple()| return a null tuple +|tuple2list()| turn a Tuple of items into a List Autocommands: ~ +|CmdlineLeavePre| before preparing to leave the command line |CursorMovedC| after the cursor was moved in the command-line |KeyInputPre| before processing any key event in any mode |SessionWritePost| after writing the session file |:mksession| +|TabClosedPre| before closing a |tabpage|. |TermResponseAll| after the terminal response to |t_RV| and others is received |WinNewPre| before creating a new window @@ -41683,7 +41726,8 @@ Autocommands: ~ Highlighting: ~ -|hl-ComplMatchIns| matched text of the currently inserted completion. +|hl-ComplMatchIns| matched text of the currently inserted completion +|hl-DiffTextAdd| added text within a changed line |hl-MsgArea| highlighting of the Command-line and messages area |hl-PmenuMatch| Popup menu: highlighting of matched text |hl-PmenuMatchSel| Popup menu: highlighting of matched text in selected @@ -41692,21 +41736,31 @@ Highlighting: ~ Commands: ~ |[r| and |]r| to move the cursor to previous/next rare word + +Ex-Commands: ~ + +|:iput| like |:put| but adjust indent |:pbuffer| Edit buffer [N] from the buffer list in the preview window Options: ~ +'chistory' Size of the quickfix stack |quickfix-stack|. +'completefuzzycollect' Enable fuzzy collection of candidates for (some) + |ins-completion| modes 'completeitemalign' Order of |complete-items| in Insert mode completion popup 'eventignorewin' autocommand events that are ignored in a window 'findfunc' Vim function to obtain the results for a |:find| command +'isexpand' defines triggers for completion +'lhistory' Size of the location list stack |quickfix-stack|. 'messagesopt' configure |:messages| and |hit-enter| prompt -'winfixbuf' Keep buffer focused in a window +'pummaxwidth' maximum width for the completion popup menu 'tabclose' Which tab page to focus after closing a tab page 't_xo' Terminal uses XON/XOFF handshaking (e.g. vt420) 't_CF' Support for alternate font highlighting terminal code +'winfixbuf' Keep buffer focused in a window ============================================================================== INCOMPATIBLE CHANGES *incompatible-9.2* diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index b96f7790..46db57a4 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -1,4 +1,4 @@ -*vi_diff.txt* For Vim version 9.1. Last change: 2024 Nov 10 +*vi_diff.txt* For Vim version 9.1. Last change: 2025 Mar 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -91,8 +91,11 @@ Maximum display width Unix and Win32: 1024 characters, otherwise 255 Maximum lhs of a mapping 50 characters. Number of different highlighting types: over 30000 Range of a Number variable: -2147483648 to 2147483647 (might be more on 64 - bit systems) + bit systems) See also: |v:numbermax|, + |v:numbermin| and |v:numbersize| Maximum length of a line in a tags file: 512 bytes. + *E1541* +Maximum value for |/\U| and |/\%U|: 2147483647 (for 32bit integer). Information for undo and text in registers is kept in memory, thus when making (big) changes the amount of (virtual) memory available limits the number of diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 5ea4ebe5..0dae57de 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 21 +*vim9.txt* For Vim version 9.1. Last change: 2025 Apr 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1001,6 +1001,7 @@ empty list and dict is falsy: string non-empty blob non-empty list non-empty (different from JavaScript) + tuple non-empty (different from JavaScript) dictionary non-empty (different from JavaScript) func when there is a function name special true or v:true @@ -1048,6 +1049,7 @@ In Vim9 script one can use the following predefined values: > null_function null_job null_list + null_tuple null_object null_partial null_string @@ -1465,17 +1467,19 @@ The following builtin types are supported: blob list<{type}> dict<{type}> + object<{type}> job channel + tuple<{type}> + tuple<{type}, {type}, ...> + tuple<...list<{type}>> + tuple<{type}, ...list<{type}>> func func: {type} func({type}, ...) func({type}, ...): {type} void -Not supported yet: - tuple - These types can be used in declarations, but no simple value will actually have the "void" type. Trying to use a void (e.g. a function without a return value) results in error *E1031* *E1186* . @@ -1483,6 +1487,32 @@ return value) results in error *E1031* *E1186* . There is no array type, use list<{type}> instead. For a list constant an efficient implementation is used that avoids allocating a lot of small pieces of memory. + *tuple-type* +A tuple type can be declared in more or less specific ways: +tuple a tuple with a single item of type |Number| +tuple a tuple with two items of type |Number| and + |String| +tuple a tuple with three items of type |Number|, + |Float| and |Boolean| +tuple<...list> a variadic tuple with zero or more items of + type |Number| +tuple> a tuple with an item of type |Number| followed + by zero or more items of type |String| + +Examples: > + var myTuple: tuple = (20,) + var myTuple: tuple = (30, 'vim') + var myTuple: tuple = (40, 1.1, true) + var myTuple: tuple<...list> = ('a', 'b', 'c') + var myTuple: tuple> = (3, 'a', 'b', 'c') +< + *variadic-tuple* *E1539* +A variadic tuple has zero or more items of the same type. The type of a +variadic tuple must end with a list type. Examples: > + var myTuple: tuple<...list> = (1, 2, 3) + var myTuple: tuple<...list> = ('a', 'b', 'c') + var myTuple: tuple<...list> = () +< *vim9-func-declaration* *E1005* *E1007* A partial and function can be declared in more or less specific ways: func any kind of function reference, no type @@ -1707,7 +1737,8 @@ argument type checking: > *E1211* *E1217* *E1218* *E1219* *E1220* *E1221* *E1222* *E1223* *E1224* *E1225* *E1226* *E1227* *E1228* *E1238* *E1250* *E1251* *E1252* *E1256* - *E1297* *E1298* *E1301* + *E1297* *E1298* *E1301* *E1528* *E1529* *E1530* + *E1531* *E1534* Types are checked for most builtin functions to make it easier to spot mistakes. @@ -1715,7 +1746,7 @@ Categories of variables, defaults and null handling ~ *variable-categories* *null-variables* There are categories of variables: primitive number, float, boolean - container string, blob, list, dict + container string, blob, list, tuple, dict specialized function, job, channel, user-defined-object When declaring a variable without an initializer, an explicit type must be @@ -1845,6 +1876,7 @@ An uninitialized variable is usually equal to null; it depends on its type: var s: string s == null var b: blob b != null *** var l: list l != null *** + var t: tuple t != null *** var d: dict d != null *** var f: func f == null var j: job j == null @@ -1855,6 +1887,7 @@ A variable initialized to empty equals null_; but not null: var s2: string = "" == null_string != null var b2: blob = 0z == null_blob != null var l2: list = [] == null_list != null + var t2: tuple = () == null_tuple != null var d2: dict = {} == null_dict != null NOTE: the specialized variables, like job, default to null value and have no @@ -1921,6 +1954,10 @@ There is one way to use both legacy and Vim9 syntax in one script file: > This allows for writing a script that takes advantage of the Vim9 script syntax if possible, but will also work on a Vim version without it. +Note that Vim9 syntax changed before Vim 9 so that scripts using the current +syntax (such as "import from" instead of "import") might throw errors. +To prevent these, a safer check could be for |v:version| >= 900 instead. + This can only work in two ways: 1. The "if" statement evaluates to false, the commands up to `endif` are skipped and `vim9script` is then the first command actually executed. @@ -2006,7 +2043,7 @@ The script name after `import` can be: If the name does not end in ".vim" then the use of "as name" is required. -Once a vim9 script file has been imported, the result is cached and used the +Once a Vim9 script file has been imported, the result is cached and used the next time the same script is imported. It will not be read again. It is not allowed to import the same script twice, also when using two @@ -2019,7 +2056,7 @@ line, there can be no line break: > echo that .name # Error! < *import-map* -When you've imported a function from one script into a vim9 script you can +When you've imported a function from one script into a Vim9 script you can refer to the imported function in a mapping by prefixing it with ||: > noremap ,a :call name.Function() diff --git a/runtime/doc/vim9class.txt b/runtime/doc/vim9class.txt index 5e5c28e9..d2f43aef 100644 --- a/runtime/doc/vim9class.txt +++ b/runtime/doc/vim9class.txt @@ -1,4 +1,4 @@ -*vim9class.txt* For Vim version 9.1. Last change: 2025 Feb 11 +*vim9class.txt* For Vim version 9.1. Last change: 2025 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -52,7 +52,6 @@ An interface is used to specify properties of an object: The class hierarchy allows for single inheritance. Otherwise interfaces are to be used where needed. - Class modeling ~ You can model classes any way you like. Keep in mind what you are building, @@ -122,7 +121,6 @@ using the object name followed by a dot following by the member: > A class name cannot be used as an expression. A class name cannot be used in the left-hand-side of an assignment. - Object variable write access ~ *read-only-variable* Now try to change an object variable directly: > @@ -626,13 +624,15 @@ once. They can appear in any order, although this order is recommended: > extends ClassName implements InterfaceName, OtherInterface specifies SomeInterface -< *E1355* *E1369* +< +The "specifies" feature is currently not implemented. + + *E1355* *E1369* Each variable and method name can be used only once. It is not possible to define a method with the same name and different type of arguments. It is not possible to use a public and protected member variable with the same name. An object variable name used in a super class cannot be reused in a child class. - Object Variable Initialization ~ If the type of a variable is not explicitly specified in a class, then it is @@ -641,8 +641,8 @@ class, then the type of the variable is set. The following reserved keyword names cannot be used as an object or class variable name: "super", "this", "true", "false", "null", "null_blob", -"null_dict", "null_function", "null_list", "null_partial", "null_string", -"null_channel" and "null_job". +"null_channel", "null_class", "null_dict", "null_function", "null_job", +"null_list", "null_object", "null_partial" and "null_string". Extending a class ~ *extends* @@ -689,13 +689,12 @@ A class can implement one or more interfaces. The "implements" keyword can only appear once *E1350* . Multiple interfaces can be specified, separated by commas. Each interface name can appear only once. *E1351* - A class defining an interface ~ *specifies* A class can declare its interface, the object variables and methods, with a named interface. This avoids the need for separately specifying the interface, which is often done in many languages, especially Java. - +TODO: This is currently not implemented. Items in a class ~ *E1318* *E1325* *E1388* @@ -736,25 +735,25 @@ Some of the builtin functions like |empty()|, |len()| and |string()| can be used with an object. An object can implement a method with the same name as these builtin functions to return an object-specific value. - *E1412* + *E1412* The following builtin methods are supported: - *object-empty()* + *object-empty()* empty() Invoked by the |empty()| function to check whether an object is empty. If this method is missing, then true is returned. This method should not accept any arguments and must return a boolean. - *object-len()* + *object-len()* len() Invoked by the |len()| function to return the length of an object. If this method is missing in the class, then an error is given and zero is returned. This method should not accept any arguments and must return a number. - *object-string()* + *object-string()* string() Invoked by the |string()| function to get a textual representation of an object. Also used by the |:echo| command for an object. If this method is missing in the class, then a built-in default textual representation is used. This method should not accept any arguments and must return a string. - *E1413* + *E1413* A class method cannot be used as a builtin method. Defining an interface ~ @@ -786,7 +785,6 @@ An interface can only be defined in a |Vim9| script file. *E1342* An interface cannot "implement" another interface but it can "extend" another interface. *E1381* - null object ~ When a variable is declared to have the type of an object, but it is not @@ -795,7 +793,6 @@ does not know what class was supposed to be used. Vim then cannot check if a variable name is correct and you will get a "Using a null object" error, even when the variable name is invalid. *E1360* *E1362* - Default constructor ~ *default-constructor* In case you define a class without a new() method, one will be automatically @@ -1070,6 +1067,21 @@ The above enum definition is equivalent to the following class definition: > public const ordinal: number endclass < +A enum can contain object variables and methods just like a regular class: > + + enum Color + Cyan([0, 255, 255]), + Magenta([255, 0, 255]), + Gray([128, 128, 128]) + + var rgb_values: list + + def Get_RGB(): list + return this.rgb_values + enddef + endenum + echo Color.Magenta.Get_RGB() +< ============================================================================== 9. Rationale @@ -1118,7 +1130,6 @@ For |Vim9| script using the same method name for all constructors seemed like the right choice, and by calling it new() the relation between the caller and the method being called is obvious. - No overloading of the constructor ~ In Vim script, both legacy and |Vim9| script, there is no overloading of @@ -1139,7 +1150,6 @@ That way multiple constructors with different arguments are possible, while it is very easy to see which constructor is being used. And the type of arguments can be properly checked. - No overloading of methods ~ Same reasoning as for the constructor: It is often not obvious what type @@ -1148,7 +1158,6 @@ actually being called. Better just give the methods a different name, then type checking will make sure it works as you intended. This rules out polymorphism, which we don't really need anyway. - Single inheritance and interfaces ~ Some languages support multiple inheritance. Although that can be useful in @@ -1164,7 +1173,6 @@ it will be checked if that change was also changed. The mechanism to assume a class implements an interface just because the methods happen to match is brittle and leads to obscure problems, let's not do that. - Using "this.variable" everywhere ~ The object variables in various programming languages can often be accessed in @@ -1183,7 +1191,6 @@ variables. Simple and consistent. When looking at the code inside a class it's also directly clear which variable references are object variables and which aren't. - Using class variables ~ Using "static variable" to declare a class variable is very common, nothing @@ -1197,7 +1204,6 @@ the class. This has two problems: The class name can be rather long, taking up quite a bit of space, and when the class is renamed all these places need to be changed too. - Declaring object and class variables ~ The main choice is whether to use "var" as with variable declarations. @@ -1251,7 +1257,6 @@ function declaration syntax for class/object variables and methods. Vim9 also reuses the general function declaration syntax for methods. So, for the sake of consistency, we require "var" in these declarations. - Using "ClassName.new()" to construct an object ~ Many languages use the "new" operator to create an object, which is actually @@ -1315,7 +1320,6 @@ An alternative would have been using the "protected" keyword, just like "public" changes the access in the other direction. Well, that's just to reduce the number of keywords. - No private object variables ~ Some languages provide several ways to control access to object variables. diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index db24e519..545a44b3 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -1,4 +1,4 @@ -*windows.txt* For Vim version 9.1. Last change: 2025 Jan 02 +*windows.txt* For Vim version 9.1. Last change: 2025 Apr 30 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1289,7 +1289,9 @@ list of buffers. |unlisted-buffer| name also works, so long as it is unique in the list of buffers. Note that a buffer whose name is a number cannot be referenced - by that name; use the buffer number instead. + by that name; use the buffer number instead. Same is true if + the buffer name starts with a `+`, it will be interpreted as + the start of a |+cmd|. Insert a backslash before a space in a buffer name. See |:buffer-!| for [!]. This will also edit a buffer that is not in the buffer list, diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 46650e9c..a6f13c8b 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: The Vim Project -" Last Change: 2025 Feb 08 +" Last Change: 2025 May 02 " Former Maintainer: Bram Moolenaar " Listen very carefully, I will say this only once @@ -51,8 +51,11 @@ func s:StarSetf(ft) endif endfunc -" Vim help file -au BufNewFile,BufRead $VIMRUNTIME/doc/*.txt setf help +" Vim help file, set ft explicitly, because 'modeline' might be off +au BufNewFile,BufRead */doc/*.txt + \ if getline('$') =~ '\%(^\|\s\)vim:\%(.*\%(:\|\s\)\)\?\%(ft\|filetype\)=help\%(:\|\s\|$\)' + \| setf help + \| endif " Abaqus or Trasys au BufNewFile,BufRead *.inp call dist#ft#Check_inp() @@ -75,6 +78,9 @@ au BufNewFile,BufRead *.abc setf abc " ABEL au BufNewFile,BufRead *.abl setf abel +" ABNF +au BufNewFile,BufRead *.abnf setf abnf + " AceDB au BufNewFile,BufRead *.wrm setf acedb @@ -341,6 +347,11 @@ au BufNewFile,BufRead *.capnp setf capnp " Cgdb config file au BufNewFile,BufRead cgdbrc setf cgdbrc +" m17n database files. */m17n/* matches installed files, */.m17n.d/* matches +" per-user config files, */m17n-db/* matches the git repo. (must be before +" *.cs) +au BufNewFile,BufRead */{m17n,.m17n.d,m17n-db}/*.{ali,cs,dir,flt,fst,lnm,mic,mim,tbl} setf m17ndb + " C# au BufNewFile,BufRead *.cs,*.csx,*.cake setf cs @@ -384,6 +395,12 @@ au BufNewFile,BufRead *.cdl setf cdl " Conary Recipe au BufNewFile,BufRead *.recipe setf conaryrecipe +" Containers config files +au BufNewFile,BufRead */containers/containers.conf{,.d/*.conf} setf toml +au BufNewFile,BufRead */containers/containers.conf.modules/*.conf setf toml +au BufNewFile,BufRead */containers/registries.conf{,.d/*.conf} setf toml +au BufNewFile,BufRead */containers/storage.conf setf toml + " Corn config file au BufNewFile,BufRead *.corn setf corn @@ -412,13 +429,15 @@ if has("fname_case") au BufNewFile,BufRead *.C,*.H if !&fileignorecase | setf cpp | endif endif +" MS files (ixx: C++ module interface file, Microsoft Project file) +au BufNewFile,BufRead *.ixx,*.mpp setf cpp + " C++ 20 modules (clang) " https://clang.llvm.org/docs/StandardCPlusPlusModules.html#file-name-requirement au BufNewFile,BufRead *.cppm,*.ccm,*.cxxm,*.c++m setf cpp -" .h files can be C, Ch C++, ObjC or ObjC++. -" Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is -" detected automatically. +" .h files can be C, C++, Ch, Objective-C, or Objective-C++. +" Set g_filetype_h to set a different filetype au BufNewFile,BufRead *.h call dist#ft#FTheader() " Ch (CHscript) @@ -544,6 +563,9 @@ au BufNewFile,BufRead *.cu,*.cuh setf cuda " Cue au BufNewFile,BufRead *.cue setf cue +" DAX +au BufNewFile,BufRead *.dax setf dax + " Debian devscripts au BufNewFile,BufRead devscripts.conf,.devscripts setf sh @@ -952,7 +974,7 @@ au BufNewFile,BufRead */etc/gitattributes setf gitattributes au BufNewFile,BufRead .gitignore,*.git/info/exclude setf gitignore au BufNewFile,BufRead */.config/git/ignore,*.prettierignore setf gitignore au BufNewFile,BufRead */.config/fd/ignore,.fdignore,.ignore setf gitignore -au BufNewFile,BufRead .rgignore,.dockerignore setf gitignore +au BufNewFile,BufRead .rgignore,.dockerignore,.containerignore setf gitignore au BufNewFile,BufRead .npmignore,.vscodeignore setf gitignore au BufNewFile,BufRead git-rebase-todo setf gitrebase au BufRead,BufNewFile .gitsendemail.msg.?????? setf gitsendemail @@ -1001,6 +1023,14 @@ au BufNewFile,BufRead *.gjs setf javascript.glimmer " Gnuplot scripts au BufNewFile,BufRead *.gpi,*.gnuplot,.gnuplot_history setf gnuplot +" GNU Radio Companion files +au BufNewFile,BufRead *.grc + \ if getline(1) =~# ':t') !~ g:ft_ignore_pat | call dist#ft#FTmake() | endif " Ruby Makefile au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby') @@ -3273,7 +3318,7 @@ au BufNewFile,BufRead XF86Config* \|call s:StarSetf('xf86conf') " XKB -au BufNewFile,BufRead */usr/share/X11/xkb/{compat,geometry,keycodes,symbols,types}/* call s:StarSetf('xkb') +au BufNewFile,BufRead */{,.}xkb/{compat,geometry,keycodes,symbols,types}/* call s:StarSetf('xkb') " X11 xmodmap au BufNewFile,BufRead *xmodmap* call s:StarSetf('xmodmap') @@ -3284,6 +3329,15 @@ au BufNewFile,BufRead */etc/xinetd.d/* call s:StarSetf('xinetd') " yum conf (close enough to dosini) au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini') +" Yarn lock +au BufNewFile,BufRead yarn.lock setf yaml + +" Zathurarc +au BufNewFile,BufRead zathurarc setf zathurarc + +" Rofi stylesheet +au BufNewFile,BufRead *.rasi setf rasi + " Z-Shell script ending in a star au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump* call s:StarSetf('zsh') au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh') @@ -3329,15 +3383,6 @@ au filetypedetect BufNewFile,BufRead,StdinReadPost * \ setf FALLBACK conf | \ endif -" Yarn lock -au BufNewFile,BufRead yarn.lock setf yaml - -" Zathurarc -au BufNewFile,BufRead zathurarc setf zathurarc - -" Rofi stylesheet -au BufNewFile,BufRead *.rasi setf rasi - " If the GUI is already running, may still need to install the Syntax menu. " Don't do it when the 'M' flag is included in 'guioptions'. if has("menu") && has("gui_running") diff --git a/runtime/ftplugin/abnf.vim b/runtime/ftplugin/abnf.vim new file mode 100644 index 00000000..4741d5f0 --- /dev/null +++ b/runtime/ftplugin/abnf.vim @@ -0,0 +1,17 @@ +" Language: abnf +" Maintainer: A4-Tacks +" Last Change: 2025-05-02 +" Upstream: https://github.com/A4-Tacks/abnf.vim + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = 'setlocal iskeyword< comments< commentstring<' + +setlocal iskeyword=@,48-57,_,-,192-255 +setlocal comments=:;;,:; +setlocal commentstring=;%s + +" vim:ts=8 diff --git a/runtime/ftplugin/cs.vim b/runtime/ftplugin/cs.vim index ada71315..d40fe43e 100644 --- a/runtime/ftplugin/cs.vim +++ b/runtime/ftplugin/cs.vim @@ -2,8 +2,7 @@ " Language: C# " Maintainer: Nick Jensen " Former Maintainer: Johannes Zellner -" Last Change: 2022-11-16 -" 2024 Jan 14 by Vim Project (browsefilter) +" Last Change: 2025-03-14 " License: Vim (see :h license) " Repository: https://github.com/nickspoons/vim-cs @@ -21,8 +20,11 @@ setlocal formatoptions-=t formatoptions+=croql " Set 'comments' to format dashed lists in comments. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// +setlocal commentstring=//\ %s -let b:undo_ftplugin = 'setl com< fo<' +setlocal cinoptions=J1 + +let b:undo_ftplugin = 'setl com< fo< cino<' if exists('loaded_matchit') && !exists('b:match_words') " #if/#endif support included by default diff --git a/runtime/ftplugin/dax.vim b/runtime/ftplugin/dax.vim new file mode 100644 index 00000000..e5783f03 --- /dev/null +++ b/runtime/ftplugin/dax.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin +" Language: Data Analysis Expressions (DAX) +" Maintainer: Anarion Dunedain +" Last Change: 2025 Apr 2 + +if exists('b:did_ftplugin') + finish +endif + +let b:did_ftplugin = 1 + +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// + +setlocal commentstring=//\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/dnsmasq.vim b/runtime/ftplugin/dnsmasq.vim new file mode 100644 index 00000000..bf93bf93 --- /dev/null +++ b/runtime/ftplugin/dnsmasq.vim @@ -0,0 +1,11 @@ +" Vim filetype plugin +" Language: dnsmasq +" Maintainer: dringsim +" Last Change: 2025-02-18 + +if exists('b:did_ftplugin') + finish +endif + +" Behaves mostly just like cfg +runtime! ftplugin/cfg.vim diff --git a/runtime/ftplugin/dockerfile.vim b/runtime/ftplugin/dockerfile.vim index e45bf4c1..f9268fe8 100644 --- a/runtime/ftplugin/dockerfile.vim +++ b/runtime/ftplugin/dockerfile.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Dockerfile " Maintainer: Honza Pokorny -" Last Change: 2024 Dec 20 +" Last Change: 2025 Feb 21 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -11,6 +11,7 @@ endif " Don't load another plugin for this buffer let b:did_ftplugin = 1 +setlocal comments=:# setlocal commentstring=#\ %s -let b:undo_ftplugin = "setl commentstring<" +let b:undo_ftplugin = "setl comments< commentstring<" diff --git a/runtime/ftplugin/dosini.vim b/runtime/ftplugin/dosini.vim index 6a53dfd0..3470bd3b 100644 --- a/runtime/ftplugin/dosini.vim +++ b/runtime/ftplugin/dosini.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: Configuration File (ini file) for MS-DOS/MS Windows +" Maintainer: This runtime file is looking for a new maintainer. " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" Latest Revision: 2025 Feb 20 if exists("b:did_ftplugin") finish @@ -13,7 +14,7 @@ set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" -setlocal comments=:; commentstring=;\ %s formatoptions-=t formatoptions+=croql +setlocal comments=:;,:# commentstring=;\ %s formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/fstab.vim b/runtime/ftplugin/fstab.vim index 0e7ffda4..d340c4b8 100644 --- a/runtime/ftplugin/fstab.vim +++ b/runtime/ftplugin/fstab.vim @@ -2,9 +2,12 @@ " Language: fstab file " Maintainer: Radu Dineiu " URL: https://raw.github.com/rid9/vim-fstab/master/ftplugin/fstab.vim -" Last Change: 2021 Jan 02 -" 2024 May 23 by Riley Bruins ('commentstring') -" Version: 1.0 +" Last Change: 2025 Mar 31 +" Version: 1.0.1 +" +" Changelog: +" - 2024 May 23 by Riley Bruins ('commentstring') +" - 2025 Mar 31 added setlocal formatoptions-=t " " Credits: " Subhaditya Nath @@ -15,6 +18,8 @@ endif let b:did_ftplugin = 1 setlocal commentstring=#\ %s -let b:undo_ftplugin = "setlocal commentstring<" +setlocal formatoptions-=t + +let b:undo_ftplugin = "setlocal commentstring< formatoptions<" " vim: ts=8 ft=vim diff --git a/runtime/ftplugin/gleam.vim b/runtime/ftplugin/gleam.vim index 9ed607c4..3ea68fa0 100644 --- a/runtime/ftplugin/gleam.vim +++ b/runtime/ftplugin/gleam.vim @@ -1,16 +1,33 @@ " Vim filetype plugin file -" Language: Gleam -" Maintainer: Trilowy (https://github.com/trilowy) -" Last Change: 2024 Oct 13 +" Language: Gleam +" Maintainer: Kirill Morozov +" Previous Maintainer: Trilowy (https://github.com/trilowy) +" Based On: https://github.com/gleam-lang/gleam.vim +" Last Change: 2025 Apr 21 if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 -setlocal comments=://,:///,://// +setlocal comments=:////,:///,:// setlocal commentstring=//\ %s +setlocal formatprg=gleam\ format\ --stdin +setlocal suffixesadd=.gleam +let b:undo_ftplugin = "setlocal com< cms< fp< sua<" -let b:undo_ftplugin = "setlocal comments< commentstring<" +if get(g:, "gleam_recommended_style", 1) + setlocal expandtab + setlocal shiftwidth=2 + setlocal smartindent + setlocal softtabstop=2 + setlocal tabstop=2 + let b:undo_ftplugin ..= " | setlocal et< sw< si< sts< ts<" +endif + +if !exists('current_compiler') + compiler gleam_build + let b:undo_ftplugin ..= "| compiler make" +endif " vim: sw=2 sts=2 et diff --git a/runtime/ftplugin/go.vim b/runtime/ftplugin/go.vim index 75f78cfa..f3cae020 100644 --- a/runtime/ftplugin/go.vim +++ b/runtime/ftplugin/go.vim @@ -1,24 +1,55 @@ " Vim filetype plugin file " Language: Go -" Maintainer: David Barnett (https://github.com/google/vim-ft-go) +" Maintainer: David Barnett (https://github.com/google/vim-ft-go is archived) " Last Change: 2014 Aug 16 " 2024 Jul 16 by Vim Project (add recommended indent style) +" 2025 Mar 07 by Vim Project (add formatprg and keywordprg option #16804) +" 2025 Mar 18 by Vim Project (use :term for 'keywordprg' #16911) +" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 +let s:cpo_save = &cpo +set cpo&vim + setlocal formatoptions-=t +setlocal formatprg=gofmt setlocal comments=s1:/*,mb:*,ex:*/,:// setlocal commentstring=//\ %s +setlocal keywordprg=:GoKeywordPrg + +command! -buffer -nargs=* GoKeywordPrg call s:GoKeywordPrg() -let b:undo_ftplugin = 'setl fo< com< cms<' +let b:undo_ftplugin = 'setl fo< com< cms< fp< kp<' + \ . '| delcommand -buffer GoKeywordPrg' if get(g:, 'go_recommended_style', 1) setlocal noexpandtab softtabstop=0 shiftwidth=0 let b:undo_ftplugin ..= ' | setl et< sts< sw<' endif +if !exists('*' .. expand('') .. 'GoKeywordPrg') + func! s:GoKeywordPrg() + let temp_isk = &l:iskeyword + setl iskeyword+=. + try + let cmd = 'go doc -C ' . shellescape(expand('%:h')) . ' ' . shellescape(expand('')) + if has('gui_running') || has('nvim') + exe 'hor term' cmd + else + exe '!' . cmd + endif + finally + let &l:iskeyword = temp_isk + endtry + endfunc +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + " vim: sw=2 sts=2 et diff --git a/runtime/ftplugin/groff.vim b/runtime/ftplugin/groff.vim new file mode 100644 index 00000000..3ebfa03c --- /dev/null +++ b/runtime/ftplugin/groff.vim @@ -0,0 +1,15 @@ +" Vim syntax file +" Language: groff(7) +" Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com ) +" Last Change: 2025 Apr 24 + +if exists('b:did_ftplugin') + finish +endif + +let b:nroff_is_groff = 1 + +runtime! ftplugin/nroff.vim + +let b:undo_ftplugin .= '| unlet! b:nroff_is_groff' +let b:did_ftplugin = 1 diff --git a/runtime/ftplugin/heex.vim b/runtime/ftplugin/heex.vim index becc071c..2f53d22e 100644 --- a/runtime/ftplugin/heex.vim +++ b/runtime/ftplugin/heex.vim @@ -2,12 +2,16 @@ " Language: HEEx " Maintainer: Mitchell Hanberg " Last Change: 2022 Sep 21 +" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 +let s:cpo_save = &cpo +set cpo&vim + setlocal shiftwidth=2 softtabstop=2 expandtab setlocal comments=:<%!-- @@ -25,3 +29,6 @@ if exists("loaded_matchit") && !exists("b:match_words") \ '<\@<=\([^/!][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" endif + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/help.vim b/runtime/ftplugin/help.vim index b619a757..0109c175 100644 --- a/runtime/ftplugin/help.vim +++ b/runtime/ftplugin/help.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: Vim help file " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2018-12-29 +" Last Change: 2025 Apr 08 +" 2025 Apr 08 by Vim project (set 'omnifunc' and 'iskeyword', #17073) if exists("b:did_ftplugin") finish @@ -11,12 +12,33 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -let b:undo_ftplugin = "setl fo< tw< cole< cocu< keywordprg<" +let b:undo_ftplugin = "setl isk< fo< tw< cole< cocu< keywordprg< omnifunc<" -setlocal formatoptions+=tcroql textwidth=78 keywordprg=:help +setlocal formatoptions+=tcroql textwidth=78 keywordprg=:help omnifunc=s:HelpComplete +let &l:iskeyword='!-~,^*,^|,^",192-255' if has("conceal") setlocal cole=2 cocu=nc endif +if !exists('*s:HelpComplete') + func s:HelpComplete(findstart, base) + if a:findstart + let colnr = col('.') - 1 " Get the column number before the cursor + let line = getline('.') + for i in range(colnr - 1, 0, -1) + if line[i] ==# '|' + return i + 1 " Don't include the `|` in base + elseif line[i] ==# "'" + return i " Include the `'` in base + endif + endfor + else + return taglist('^' .. a:base) + \ ->map({_, item -> #{word: item->get('name'), kind: item->get('kind')}}) + \ ->extend(getcompletion(a:base, 'help')) + endif + endfunc +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/html.vim b/runtime/ftplugin/html.vim index 5495f859..7736b5b0 100644 --- a/runtime/ftplugin/html.vim +++ b/runtime/ftplugin/html.vim @@ -3,7 +3,8 @@ " Maintainer: Doug Kearns " Previous Maintainer: Dan Sharp " Last Change: 2024 Jan 14 -" 2024 May 24 by Riley Bruins ('commentstring') +" 2024 May 24 update 'commentstring' option +" 2025 May 10 add expression folding #17141 if exists("b:did_ftplugin") finish @@ -56,5 +57,52 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:undo_ftplugin ..= " | unlet! b:browsefilter b:html_set_browsefilter" endif +if has("folding") && get(g:, "html_expr_folding", 0) + function! HTMLTagFold() abort + if empty(get(b:, "foldsmap", {})) + if empty(get(b:, "current_syntax", '')) + return '0' + else + let b:foldsmap = htmlfold#MapBalancedTags() + endif + endif + + return get(b:foldsmap, v:lnum, '=') + endfunction + + setlocal foldexpr=HTMLTagFold() + setlocal foldmethod=expr + let b:undo_ftplugin ..= " | setlocal foldexpr< foldmethod<" + + if !get(g:, "html_expr_folding_without_recomputation", 0) + augroup htmltagfold + autocmd! htmltagfold + autocmd TextChanged,InsertLeave let b:foldsmap = {} + augroup END + + " XXX: Keep ":autocmd" last in "b:undo_ftplugin" (see ":help :bar"). + let b:undo_ftplugin ..= " | silent! autocmd! htmltagfold * " + endif +endif + let &cpo = s:save_cpo unlet s:save_cpo + +" See ":help vim9-mix". +if !has("vim9script") + finish +endif + +if exists("*g:HTMLTagFold") + def! g:HTMLTagFold(): string + if empty(get(b:, "foldsmap", {})) + if empty(get(b:, "current_syntax", '')) + return '0' + else + b:foldsmap = g:htmlfold#MapBalancedTags() + endif + endif + + return get(b:foldsmap, v:lnum, '=') + enddef +endif diff --git a/runtime/ftplugin/java.vim b/runtime/ftplugin/java.vim index cfd25bce..4a08c57d 100644 --- a/runtime/ftplugin/java.vim +++ b/runtime/ftplugin/java.vim @@ -3,9 +3,7 @@ " Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com> " Former Maintainer: Dan Sharp " Repository: https://github.com/zzzyxwvut/java-vim.git -" Last Change: 2024 Dec 25 -" 2024 Jan 14 by Vim Project (browsefilter) -" 2024 May 23 by Riley Bruins ('commentstring') +" Last Change: 2025 May 08 " Make sure the continuation lines below do not cause problems in " compatibility mode. @@ -30,6 +28,32 @@ let b:did_ftplugin = 1 " extension. set suffixes+=.class +" Set up "&define" and "&include". +let s:peek = '' + +try + " Since v7.3.1037. + if 'ab' !~ 'a\@1' +let s:types = '\%(\%(abstract\|final\|non-sealed\|s\%(ealed\|tatic\|trictfp\)\)\s\+\)*' . + \ '\%(class\|enum\|@\=interface\|record\)\s\+\ze\K\k*\>' +let s:methods = '\%(\%(abstract\|default\|final\|native\|s\%(tatic\|trictfp\|ynchronized\)\)\s\+\)*' . + \ '\%(<.\{-1,}>\s\+\)\=\%(\K\k*\.\)*\K\k*\s*\%(<.\{-1,}>\%(\s\|\[\)\@=\)\=\s*\%(\[\]\s*\)*' . + \ '\s\+\ze\%(\<\%(assert\|case\|instanceof\|new\|return\|throw\|when\)\s\+\)\@' . + \ s:peek . ' +" URL: https://github.com/andis-sprinkis/lf-vim +" Last Change: 6 Apr 2025 + +if exists("b:did_ftplugin") | finish | endif + +let b:did_ftplugin = 1 + +let s:cpo = &cpo +set cpo&vim + +let b:undo_ftplugin = "setlocal comments< commentstring< formatoptions<" + +setlocal comments=:# +setlocal commentstring=#\ %s + +setlocal formatoptions-=t formatoptions+=rol + +let &cpo = s:cpo +unlet s:cpo diff --git a/runtime/ftplugin/lprolog.vim b/runtime/ftplugin/lprolog.vim index 1075a9c8..07ffc527 100644 --- a/runtime/ftplugin/lprolog.vim +++ b/runtime/ftplugin/lprolog.vim @@ -2,7 +2,9 @@ " Language: LambdaProlog (Teyjus) " Maintainer: Markus Mottl " URL: http://www.ocaml.info/vim/ftplugin/lprolog.vim -" Last Change: 2023 Aug 28 - added undo_ftplugin (Vim Project) +" Last Change: 2025 Apr 16 +" 2025 Apr 16 - set 'cpoptions' for line continuation +" 2023 Aug 28 - added undo_ftplugin (Vim Project) " 2006 Feb 05 " 2001 Sep 16 - fixed 'no_mail_maps'-bug (MM) " 2001 Sep 02 - initial release (MM) @@ -12,6 +14,9 @@ if exists("b:did_ftplugin") finish endif +let s:cpo_save = &cpo +set cpo&vim + " Don't do other file type settings for this buffer let b:did_ftplugin = 1 @@ -43,3 +48,6 @@ if !exists("no_plugin_maps") && !exists("no_lprolog_maps") vnoremap BUncomOn :'<,'>`0i/*`>o0i*/`< vnoremap BUncomOff :'<,'>`dd`< endif + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim index 22b99862..e3bb3a5d 100644 --- a/runtime/ftplugin/lua.vim +++ b/runtime/ftplugin/lua.vim @@ -1,31 +1,46 @@ " Vim filetype plugin file. + " Language: Lua " Maintainer: Doug Kearns " Previous Maintainer: Max Ischenko " Contributor: Dorai Sitaram " C.D. MacEachern " Tyler Miller -" Last Change: 2024 Dec 03 +" Phạm Bình An +" @konfekt +" Last Change: 2025 Apr 04 +" 2025 May 06 by Vim Project update 'path' setting #17267 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 +" keep in sync with syntax/lua.vim +if !exists("lua_version") + " Default is lua 5.3 + let lua_version = 5 + let lua_subversion = 3 +elseif !exists("lua_subversion") + " lua_version exists, but lua_subversion doesn't. In this case set it to 0 + let lua_subversion = 0 +endif + let s:cpo_save = &cpo set cpo&vim setlocal comments=:---,:-- setlocal commentstring=--\ %s setlocal formatoptions-=t formatoptions+=croql +setlocal path-=. " Lua doesn't support importing module in path related to current file like JS let &l:define = '\= 5.03 ? [fname .. ".lua", fname .. "/init.lua"] : [fname .. ".lua"] + for path in paths + if filereadable(path) + return path + endif + endfor + return fname +endfunction + let s:patterns = [ \ ['do', 'end'], \ ['if\s+.+\s+then', 'end'], @@ -75,37 +101,89 @@ let s:patterns = [ \ ['local\s+function\s+.+', 'end'], \ ] -function! LuaFold(lnum) abort +function s:LuaFold() abort if b:lua_lasttick == b:changedtick - return b:lua_foldlists[a:lnum-1] + return b:lua_foldlists[v:lnum - 1] endif let b:lua_lasttick = b:changedtick let b:lua_foldlists = [] let foldlist = [] - let buf = getline(1, '$') + let buf = getline(1, "$") for line in buf for t in s:patterns - let tagopen = '\v^\s*'..t[0]..'\s*$' - let tagclose = '\v^\s*'..t[1]..'\s*$' + let open = 0 + let end = 0 + let tagopen = '\v^\s*' .. t[0] ..'\s*$' + let tagend = '\v^\s*' .. t[1] ..'\s*$' if line =~# tagopen - call add(foldlist, t) - break - elseif line =~# tagclose - if len(foldlist) > 0 && line =~# foldlist[-1][1] - call remove(foldlist, -1) - else - let foldlist = [] - endif - break + call add(foldlist, t) + let open = 1 + break + elseif line =~# tagend + if len(foldlist) > 0 && line =~# foldlist[-1][1] + call remove(foldlist, -1) + let end = 1 + else + let foldlist = [] + endif + break endif endfor - call add(b:lua_foldlists, len(foldlist)) + let prefix = "" + if open == 1 | let prefix = ">" | endif + if end == 1 | let prefix = "<" | endif + let b:lua_foldlists += [prefix..(len(foldlist) + end)] endfor - return lua_foldlists[a:lnum-1] + return b:lua_foldlists[v:lnum - 1] endfunction +if !has('vim9script') + let &cpo = s:cpo_save + unlet s:cpo_save + + finish +endif + +delfunction! s:LuaFold +def s:LuaFold(): string + if b:lua_lasttick == b:changedtick + return b:lua_foldlists[v:lnum - 1] + endif + b:lua_lasttick = b:changedtick + + b:lua_foldlists = [] + var foldlist = [] + var buf = getline(1, "$") + for line in buf + var open = 0 + var end = 0 + for t in patterns + var tagopen = '\v^\s*' .. t[0] .. '\s*$' + var tagend = '\v^\s*' .. t[1] .. '\s*$' + if line =~# tagopen + add(foldlist, t) + open = 1 + break + elseif line =~# tagend + if len(foldlist) > 0 && line =~# foldlist[-1][1] + end = 1 + remove(foldlist, -1) + else + foldlist = [] + endif + break + endif + endfor + var prefix = "" + if open == 1 | prefix = ">" | endif + if end == 1 | prefix = "<" | endif + b:lua_foldlists += [prefix .. (len(foldlist) + end)] + endfor + return b:lua_foldlists[v:lnum - 1] +enddef + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/m17ndb.vim b/runtime/ftplugin/m17ndb.vim new file mode 100644 index 00000000..e4457cef --- /dev/null +++ b/runtime/ftplugin/m17ndb.vim @@ -0,0 +1,17 @@ +" Vim filetype plugin +" Language: m17n database +" Maintainer: David Mandelberg +" Last Change: 2025 Feb 21 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:;;;,:;;,:; +setlocal commentstring=;\ %s +setlocal iskeyword=!-~,@,^34,^(,^),^92 +setlocal lisp +setlocal lispwords= + +let b:undo_ftplugin = "setlocal comments< commentstring< iskeyword< lisp< lispwords<" diff --git a/runtime/ftplugin/mail.vim b/runtime/ftplugin/mail.vim index 3cef84f5..de88f4d1 100644 --- a/runtime/ftplugin/mail.vim +++ b/runtime/ftplugin/mail.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Mail " Maintainer: The Vim Project -" Last Change: 2023 Aug 10 +" Last Change: 2025 Feb 20 " Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer @@ -10,7 +10,7 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl modeline< tw< fo< comments<" +let b:undo_ftplugin = "setl modeline< tw< fo< comments< commentstring<" " Don't use modelines in e-mail messages, avoid trojan horses and nasty " "jokes" (e.g., setting 'textwidth' to 5). @@ -24,6 +24,9 @@ endif " Set 'formatoptions' to break text lines and keep the comment leader ">". setlocal fo+=tcql +" Set commentstring to quoting sign ">" so comment shortcuts can be used to +" edit quoted parts of mail +setlocal commentstring=>\ %s " Add n:> to 'comments, in case it was removed elsewhere setlocal comments+=n:> diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index 45c2bb23..3edbb27e 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -6,6 +6,7 @@ " Last Change: 2024 Jun 06 (disabled the q mapping, #8210) " 2024 Jul 06 (use nnoremap, #15130) " 2024 Aug 23 (improve the ManBS mapping, #15547, #15556) +" 2025 Mar 09 (improve :Man completion for man-db, #16843) " To make the ":Man" command available before editing a manual page, source " this script from your startup vimrc file. @@ -24,6 +25,14 @@ endif let s:cpo_save = &cpo set cpo-=C +if !exists('g:ft_man_implementation') + if executable('mandb') > 0 + let g:ft_man_implementation = 'man-db' + else + let g:ft_man_implementation = '' + endif +endif + if &filetype == "man" " Allow hyphen, plus, colon, dot, and commercial at in manual page name. " Parentheses are not here but in dist#man#PreGetPage() @@ -60,11 +69,19 @@ if &filetype == "man" endif if exists(":Man") != 2 - com -nargs=+ -complete=shellcmd Man call dist#man#GetPage(, ) + if g:ft_man_implementation ==# 'man-db' + com -nargs=+ -complete=customlist,dist#man#ManDbComplete Man call dist#man#GetPage(, ) + else + com -nargs=+ -complete=shellcmd Man call dist#man#GetPage(, ) + endif nnoremap K :call dist#man#PreGetPage(0) nnoremap ManPreGetPage :call dist#man#PreGetPage(0) endif +if exists(":ManReload") != 2 + com ManReload call dist#man#Reload() +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/mbsync.vim b/runtime/ftplugin/mbsync.vim new file mode 100644 index 00000000..f2d13eff --- /dev/null +++ b/runtime/ftplugin/mbsync.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin file +" Language: mbsync configuration file +" Maintainer: Pierrick Guillaume +" Last Change: 2025 Apr 13 + +if (exists('b:did_ftplugin')) + finish +endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setlocal commentstring<" + +setlocal commentstring=#\ %s diff --git a/runtime/ftplugin/mediawiki.vim b/runtime/ftplugin/mediawiki.vim index 46182461..399de421 100644 --- a/runtime/ftplugin/mediawiki.vim +++ b/runtime/ftplugin/mediawiki.vim @@ -3,6 +3,7 @@ " Home: http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#Vim " Last Change: 2024 Jul 14 " Credits: chikamichi +" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) " if exists("b:did_ftplugin") @@ -10,6 +11,9 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 +let s:cpo_save = &cpo +set cpo&vim + " Many MediaWiki wikis prefer line breaks only at the end of paragraphs " (like in a text processor), which results in long, wrapping lines. setlocal wrap linebreak @@ -40,3 +44,6 @@ setlocal foldmethod=expr let b:undo_ftplugin = "setl commentstring< comments< formatoptions< foldexpr< foldmethod<" let b:undo_ftplugin += " matchpairs< linebreak< wrap< textwidth<" + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/mojo.vim b/runtime/ftplugin/mojo.vim index ff502299..c7f3b6b4 100644 --- a/runtime/ftplugin/mojo.vim +++ b/runtime/ftplugin/mojo.vim @@ -2,12 +2,16 @@ " Language: Mojo " Maintainer: Riley Bruins " Last Change: 2024 Jul 07 +" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 +let s:cpo_save = &cpo +set cpo&vim + setlocal include=^\\s*\\(from\\\|import\\) setlocal define=^\\s*\\(\\(async\\s\\+\\)\\?def\\\|class\\) @@ -39,3 +43,6 @@ let b:undo_ftplugin = 'setlocal include<' \ . '|setlocal suffixesadd<' \ . '|setlocal comments<' \ . '|setlocal commentstring<' + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/nix.vim b/runtime/ftplugin/nix.vim index d417cc78..311e00b4 100644 --- a/runtime/ftplugin/nix.vim +++ b/runtime/ftplugin/nix.vim @@ -2,6 +2,7 @@ " Language: nix " Maintainer: Keith Smiley " Last Change: 2023 Jul 22 +" 2025 Apr 18 by Vim Project (set 'iskeyword' and b:match_words #17154) " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -11,7 +12,10 @@ endif " Don't load another plugin for this buffer let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl commentstring< comments<" +let b:undo_ftplugin = "setl commentstring< comments< iskeyword< | unlet! b:match_words" + +let b:match_words = "\:\:\,\:\" setlocal comments=:# setlocal commentstring=#\ %s +setlocal iskeyword+=- diff --git a/runtime/ftplugin/nroff.vim b/runtime/ftplugin/nroff.vim index 7d3d2a59..cd2680ef 100644 --- a/runtime/ftplugin/nroff.vim +++ b/runtime/ftplugin/nroff.vim @@ -7,18 +7,33 @@ " Last Changes: " 2024 May 24 by Riley Bruins ('commentstring' #14843) " 2025 Feb 12 by Wu, Zhenyu (matchit configuration #16619) +" 2025 Apr 16 by Eisuke Kawashima (cpoptions #17121) +" 2025 Apr 24 by Eisuke Kawashima (move options from syntax to ftplugin #17174) if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 +let s:cpo_save = &cpo +set cpo&vim + setlocal commentstring=.\\\"\ %s setlocal comments=:.\\\" setlocal sections+=Sh setlocal define=.\s*de -let b:undo_ftplugin = 'setlocal commentstring< comments< sections< define<' +if get(b:, 'preprocs_as_sections') + setlocal sections=EQTSPS[\ G1GS +endif + +let b:undo_ftplugin = 'setlocal commentstring< comments< sections& define<' + +if get(b:, 'nroff_is_groff') + " groff_ms exdented paragraphs are not in the default paragraphs list. + setlocal paragraphs+=XP + let b:undo_ftplugin .= ' paragraphs&' +endif if exists('loaded_matchit') let b:match_words = '^\.\s*ie\>:^\.\s*el\>' @@ -30,3 +45,6 @@ if exists('loaded_matchit') \ . ',^\.\s*FS\>:^\.\s*FE\>' let b:undo_ftplugin .= "| unlet b:match_words" endif + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/plsql.vim b/runtime/ftplugin/plsql.vim new file mode 100755 index 00000000..7fcc5d7a --- /dev/null +++ b/runtime/ftplugin/plsql.vim @@ -0,0 +1,17 @@ +" Vim ftplugin file +" Language: Oracle Procedural SQL (PL/SQL) +" Maintainer: Lee Lindley (lee dot lindley at gmail dot com) +" Previous Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com) +" Previous Maintainer: C. Laurence Gonsalves (clgonsal@kami.com) +" URL: https://github.com/lee-lindley/vim_plsql_syntax +" Last Change: Feb 19, 2025 +" History: Enno Konfekt move handling of optional syntax folding from syntax +" file to ftplugin + +if exists("b:did_ftplugin") | finish | endif +let b:did_ftplugin = 1 + +if get(g:,"plsql_fold",0) == 1 + setlocal foldmethod=syntax + let b:undo_ftplugin = "setl fdm< " +endif diff --git a/runtime/ftplugin/pq.vim b/runtime/ftplugin/pq.vim new file mode 100644 index 00000000..2ed2fa42 --- /dev/null +++ b/runtime/ftplugin/pq.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin +" Language: Power Query M +" Maintainer: Anarion Dunedain +" Last Change: 2025 Apr 3 + +if exists('b:did_ftplugin') + finish +endif + +let b:did_ftplugin = 1 + +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// + +setlocal commentstring=//\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/remind.vim b/runtime/ftplugin/remind.vim new file mode 100644 index 00000000..d6458459 --- /dev/null +++ b/runtime/ftplugin/remind.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin file +" Language: Remind - a sophisticated calendar and alarm +" Maintainer: Joe Reynolds +" Latest Revision: 2025 April 08 +" License: Vim (see :h license) + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:# commentstring=#\ %s + +let b:undo_ftplugin = "setl cms< com<" diff --git a/runtime/ftplugin/rust.vim b/runtime/ftplugin/rust.vim index 3e2741f9..53f7f833 100644 --- a/runtime/ftplugin/rust.vim +++ b/runtime/ftplugin/rust.vim @@ -3,6 +3,7 @@ " Maintainer: Chris Morgan " Last Change: 2024 Mar 17 " 2024 May 23 by Riley Bruins + autocmd ShellFilterPost if v:shell_error | execute 'echom "shell filter returned error " . v:shell_error . ", undoing changes"' | undo | endif + augroup END + endif + + let &l:formatprg = get(g:, 'rustfmt_command', 'rustfmt') . ' ' . + \ get(g:, 'rustfmt_options', '') . ' ' . + \ rustfmt#RustfmtConfigOptions() +endif + if exists("g:ftplugin_rust_source_path") let &l:path=g:ftplugin_rust_source_path . ',' . &l:path endif @@ -149,7 +163,7 @@ endif let b:undo_ftplugin = " \ compiler make | - \ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd< + \ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd< formatprg< \|if exists('b:rust_set_style') \|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth< \|endif diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim index 54ae73b6..0038ee7d 100644 --- a/runtime/ftplugin/sh.vim +++ b/runtime/ftplugin/sh.vim @@ -6,6 +6,7 @@ " Eisuke Kawashima " Last Change: 2024 Sep 19 by Vim Project (compiler shellcheck) " 2024 Dec 29 by Vim Project (improve setting shellcheck compiler) +" 2025 Mar 09 by Vim Project (set b:match_skip) if exists("b:did_ftplugin") finish @@ -30,7 +31,8 @@ if exists("loaded_matchit") && !exists("b:match_words") \ s:sol .. '\%(for\|while\)\>:' .. s:sol .. 'done\>,' .. \ s:sol .. 'case\>:' .. s:sol .. 'esac\>' unlet s:sol - let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" + let b:match_skip = "synIDattr(synID(line('.'),col('.'),0),'name') =~ 'shSnglCase'" + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:match_skip" endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") diff --git a/runtime/ftplugin/sieve.vim b/runtime/ftplugin/sieve.vim index 3092b5d2..8161fe99 100644 --- a/runtime/ftplugin/sieve.vim +++ b/runtime/ftplugin/sieve.vim @@ -1,20 +1,19 @@ " Vim filetype plugin file " Language: Sieve filtering language input file +" Maintainer: This runtime file is looking for a new maintainer. " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" Latest Revision: 2025 Feb 20 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim - -let b:undo_ftplugin = "setl com< cms< fo<" +let b:undo_ftplugin = "setl com< cms< fo< ff<" setlocal comments=s1:/*,mb:*,ex:*/,:# commentstring=#\ %s setlocal formatoptions-=t formatoptions+=croql -let &cpo = s:cpo_save -unlet s:cpo_save +" https://datatracker.ietf.org/doc/html/rfc5228#section-2.2 says +" "newlines (CRLF, never just CR or LF)" +setlocal fileformat=dos diff --git a/runtime/ftplugin/spajson.vim b/runtime/ftplugin/spajson.vim new file mode 100644 index 00000000..d03d1d50 --- /dev/null +++ b/runtime/ftplugin/spajson.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: SPA JSON +" Maintainer: David Mandelberg +" Last Change: 2025 Mar 22 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:###,:##,:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setlocal comments< commentstring<" diff --git a/runtime/ftplugin/svelte.vim b/runtime/ftplugin/svelte.vim index e0ec4e0a..5114de25 100644 --- a/runtime/ftplugin/svelte.vim +++ b/runtime/ftplugin/svelte.vim @@ -1,13 +1,40 @@ " Vim filetype plugin " Language: svelte " Maintainer: Igor Lacerda -" Last Change: 2024 Jun 09 +" Last Change: 2025 Apr 06 if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 -setl commentstring= +let s:cpo_sav = &cpo +set cpo&vim -let b:undo_ftplugin = 'setl cms<' +setlocal matchpairs+=<:> +setlocal commentstring= +setlocal comments=s: + +let b:undo_ftplugin = 'setlocal comments< commentstring< matchpairs<' + +if exists('&omnifunc') + setlocal omnifunc=htmlcomplete#CompleteTags + call htmlcomplete#DetectOmniFlavor() + let b:undo_ftplugin ..= " | setlocal omnifunc<" +endif + +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_ignorecase = 1 + let b:match_words = '<:>,' . + \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' . + \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' . + \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' . + \ '{#\(if\|each\)[^}]*}:{\:else[^}]*}:{\/\(if\|each\)},' . + \ '{#await[^}]*}:{\:then[^}]*}:{\:catch[^}]*}:{\/await},' . + \ '{#snippet[^}]*}:{\/snippet},' . + \ '{#key[^}]*}:{\/key}' + let b:html_set_match_words = 1 + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:html_set_match_words" +endif +let &cpo = s:cpo_sav +unlet! s:cpo_sav diff --git a/runtime/ftplugin/tera.vim b/runtime/ftplugin/tera.vim new file mode 100644 index 00000000..ce4134ae --- /dev/null +++ b/runtime/ftplugin/tera.vim @@ -0,0 +1,37 @@ +" Vim filetype plugin file +" Language: Tera +" Maintainer: Muntasir Mahmud +" Last Change: 2025 Mar 08 +" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal autoindent + +setlocal commentstring={#\ %s\ #} +setlocal comments=s:{#,e:#} + +if exists("loaded_matchit") + let b:match_ignorecase = 0 + let b:match_words = '{#:##\|#},{% *if:{% *else\>:{% *elif\>:{% *endif %},{% *for\>:{% *endfor %},{% *macro\>:{% *endmacro %},{% *block\>:{% *endblock %},{% *filter\>:{% *endfilter %},{% *set\>:{% *endset %},{% *raw\>:{% *endraw %},{% *with\>:{% *endwith %}' +endif + +setlocal includeexpr=substitute(v:fname,'\\([^.]*\\)$','\\1','g') +setlocal suffixesadd=.tera + +setlocal expandtab +setlocal shiftwidth=2 +setlocal softtabstop=2 + +let b:undo_ftplugin = "setlocal autoindent< commentstring< comments< " .. + \ "includeexpr< suffixesadd< expandtab< shiftwidth< softtabstop<" +let b:undo_ftplugin .= "|unlet! b:match_ignorecase b:match_words" + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/tutor.vim b/runtime/ftplugin/tutor.vim index 30783d97..92bca8d1 100644 --- a/runtime/ftplugin/tutor.vim +++ b/runtime/ftplugin/tutor.vim @@ -1,19 +1,18 @@ -" vim: fdm=marker +" Tutor filetype plugin +" Language: Tutor (the new tutor plugin) +" Maintainer: This runtime file is looking for a new maintainer. +" Last Change: 2025 May 10 +" Contributors: Phạm Bình An +" Original Author: Felipe Morales +" Last Change: +" 2025 May 10 set b:undo_ftplugin +" 2025 May 12 update b:undo_ftplugin " Base: {{{1 call tutor#SetupVim() " Buffer Settings: {{{1 setlocal noreadonly -if !exists('g:tutor_debug') || g:tutor_debug == 0 - setlocal buftype=nofile - setlocal concealcursor+=inv - setlocal conceallevel=2 -else - setlocal buftype= - setlocal concealcursor& - setlocal conceallevel=0 -endif setlocal noundofile setlocal keywordprg=:help @@ -39,7 +38,7 @@ call tutor#SetNormalMappings() sign define tutorok text=✓ texthl=tutorOK sign define tutorbad text=✗ texthl=tutorX -if !exists('g:tutor_debug') || g:tutor_debug == 0 - call tutor#ApplyMarks() - autocmd! TextChanged,TextChangedI call tutor#ApplyMarksOnChanged() -endif +let b:undo_ftplugin = "setl foldmethod< foldexpr< foldlevel< undofile< keywordprg< iskeyword< |" + \ . "call tutor#EnableInteractive(v:false) |" + +" vim: fdm=marker diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 2c883a53..99ce0bc5 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,9 +1,11 @@ " Vim filetype plugin -" Language: Vim -" Maintainer: Doug Kearns -" Last Change: 2025 Jan 06 -" Former Maintainer: Bram Moolenaar -" Contributors: Riley Bruins ('commentstring') +" Language: Vim +" Maintainer: Doug Kearns +" Last Change: 2025 Mar 05 +" Former Maintainer: Bram Moolenaar +" Contributors: Riley Bruins ('commentstring'), +" @Konfekt +" @tpope (s:Help()) " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -18,20 +20,21 @@ set cpo&vim if !exists('*VimFtpluginUndo') func VimFtpluginUndo() - setl fo< isk< com< tw< commentstring< include< define< + setl fo< isk< com< tw< commentstring< include< define< keywordprg< + sil! delc -buffer VimKeywordPrg if exists('b:did_add_maps') silent! nunmap [[ - silent! vunmap [[ + silent! xunmap [[ silent! nunmap ]] - silent! vunmap ]] + silent! xunmap ]] silent! nunmap [] - silent! vunmap [] + silent! xunmap [] silent! nunmap ][ - silent! vunmap ][ + silent! xunmap ][ silent! nunmap ]" - silent! vunmap ]" + silent! xunmap ]" silent! nunmap [" - silent! vunmap [" + silent! xunmap [" endif unlet! b:match_ignorecase b:match_words b:match_skip b:did_add_maps endfunc @@ -48,7 +51,53 @@ setlocal fo-=t fo+=croql setlocal isk+=# " Use :help to lookup the keyword under the cursor with K. -setlocal keywordprg=:help +" Distinguish between commands, options and functions. +if !exists("*" .. expand("") .. "Help") + function s:Help(topic) abort + let topic = a:topic + + if get(g:, 'syntax_on', 0) + let syn = synIDattr(synID(line('.'), col('.'), 1), 'name') + if syn ==# 'vimFuncName' + return topic.'()' + elseif syn ==# 'vimOption' + return "'".topic."'" + elseif syn ==# 'vimUserAttrbKey' + return ':command-'.topic + elseif syn =~# 'vimCommand' + return ':'.topic + endif + endif + + let col = col('.') - 1 + while col && getline('.')[col] =~# '\k' + let col -= 1 + endwhile + let pre = col == 0 ? '' : getline('.')[0 : col] + + let col = col('.') - 1 + while col && getline('.')[col] =~# '\k' + let col += 1 + endwhile + let post = getline('.')[col : -1] + + if pre =~# '^\s*:\=$' + return ':'.topic + elseif pre =~# '\' + elseif pre =~# '\\$' + return '/\'.topic + elseif topic ==# 'v' && post =~# ':\w\+' + return 'v'.matchstr(post, ':\w\+') + else + return topic + endif + endfunction +endif +command! -buffer -nargs=1 VimKeywordPrg :exe 'help' s:Help() +setlocal keywordprg=:VimKeywordPrg " Comments starts with # in Vim9 script. We have to guess which one to use. if "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>' @@ -77,19 +126,19 @@ if !exists("no_plugin_maps") && !exists("no_vim_maps") " Move around functions. nnoremap [[ m':call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "bW") - vnoremap [[ m':exe "normal! gv"call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "bW") + xnoremap [[ m':exe "normal! gv"call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "bW") nnoremap ]] m':call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "W") - vnoremap ]] m':exe "normal! gv"call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "W") + xnoremap ]] m':exe "normal! gv"call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "W") nnoremap [] m':call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "bW") - vnoremap [] m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "bW") + xnoremap [] m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "bW") nnoremap ][ m':call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "W") - vnoremap ][ m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "W") + xnoremap ][ m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "W") " Move around comments nnoremap ]" :call search('\%(^\s*".*\n\)\@ - vnoremap ]" :exe "normal! gv"call search('\%(^\s*".*\n\)\@ + xnoremap ]" :exe "normal! gv"call search('\%(^\s*".*\n\)\@ nnoremap [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") - vnoremap [" :exe "normal! gv"call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") + xnoremap [" :exe "normal! gv"call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") endif " Let the matchit plugin know what items can be matched. @@ -101,15 +150,15 @@ if exists("loaded_matchit") " func name " require a parenthesis following, then there can be an "endfunc". let b:match_words = - \ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' .. - \ '\<\%(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' .. - \ '\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' .. - \ '{:},' .. - \ '\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' .. - \ '\\)\@!\S:\,' .. - \ '\:\,' .. - \ '\:\,' .. - \ '\:\' + \ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' .. + \ '\<\%(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' .. + \ '\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' .. + \ '{:},' .. + \ '\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' .. + \ '\\)\@!\S:\,' .. + \ '\:\,' .. + \ '\:\,' .. + \ '\:\' " Ignore syntax region commands and settings, any 'en*' would clobber " if-endif. @@ -117,7 +166,7 @@ if exists("loaded_matchit") " - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ … " Also ignore here-doc and dictionary keys (vimVar). let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name") - \ =~? "comment\\|string\\|vimSynReg\\|vimSet\\|vimLetHereDoc\\|vimVar"' + \ =~? "comment\\|string\\|vimSynReg\\|vimSet\\|vimLetHereDoc\\|vimVar"' endif let &cpo = s:cpo_save @@ -125,3 +174,5 @@ unlet s:cpo_save " removed this, because 'cpoptions' is a global option. " setlocal cpo+=M " makes \%( match \) +" +" vim: sw=2 et diff --git a/runtime/ftplugin/yaml.vim b/runtime/ftplugin/yaml.vim index 4e12350c..12036a86 100644 --- a/runtime/ftplugin/yaml.vim +++ b/runtime/ftplugin/yaml.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: YAML (YAML Ain't Markup Language) " Previous Maintainer: Nikolai Weibull (inactive) -" Last Change: 2024 Oct 04 +" Last Change: 2024 Oct 04 +" 2025 Apr 22 by Vim project re-order b:undo_ftplugin (#17179) if exists("b:did_ftplugin") finish @@ -16,20 +17,25 @@ let b:undo_ftplugin = "setl com< cms< et< fo<" setlocal comments=:# commentstring=#\ %s expandtab setlocal formatoptions-=t formatoptions+=croql -" rime input method engine uses `*.custom.yaml` as its config files +if get(g:, "yaml_recommended_style",1) + let b:undo_ftplugin ..= " sw< sts<" + setlocal shiftwidth=2 softtabstop=2 +endif + +" rime input method engine(https://rime.im/) +" uses `*.custom.yaml` as its config files if expand('%:r:e') ==# 'custom' + " `__include` command in `*.custom.yaml` + " see: https://github.com/rime/home/wiki/Configuration#%E5%8C%85%E5%90%AB + setlocal include=__include:\\s* + let b:undo_ftplugin ..= " inc<" + if !exists('current_compiler') compiler rime_deployer - let b:undo_ftplugin ..= "| compiler make" + let b:undo_ftplugin ..= " | compiler make" endif - setlocal include=__include:\\s* - let b:undo_ftplugin ..= " inc<" endif -if !exists("g:yaml_recommended_style") || g:yaml_recommended_style != 0 - let b:undo_ftplugin ..= " sw< sts<" - setlocal shiftwidth=2 softtabstop=2 -endif let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/indent/Makefile b/runtime/indent/Makefile index 2af1276a..742e43f9 100644 --- a/runtime/indent/Makefile +++ b/runtime/indent/Makefile @@ -10,7 +10,16 @@ VIMRUNTIME = .. # If a test succeeds a testdir/*.out file will be written. # If a test fails a testdir/*.fail file will be written. test: - VIMRUNTIME=$(VIMRUNTIME) $(VIMPROG) --clean --not-a-term -u testdir/runtest.vim + VIMRUNTIME=$(VIMRUNTIME) $(VIMPROG) --clean --not-a-term -u testdir/runtest.vim || \ + { \ + retval=$$?; \ + for fail in testdir/*.fail; do \ + [ -f "$$fail" ] || continue; \ + echo "$$fail:"; \ + cat "$$fail"; \ + done; \ + exit $$retval; \ + } @echo "INDENT TESTS: DONE" diff --git a/runtime/indent/cucumber.vim b/runtime/indent/cucumber.vim index 5d144e42..33d4cc73 100644 --- a/runtime/indent/cucumber.vim +++ b/runtime/indent/cucumber.vim @@ -2,11 +2,14 @@ " Language: Cucumber " Maintainer: Tim Pope " Last Change: 2023 Dec 28 +" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) if exists("b:did_indent") finish endif let b:did_indent = 1 +let s:cpo_save = &cpo +set cpo&vim setlocal autoindent setlocal indentexpr=GetCucumberIndent() @@ -95,4 +98,7 @@ function! GetCucumberIndent(...) abort return prev.indent < 0 ? 0 : prev.indent endfunction +let &cpo = s:cpo_save +unlet s:cpo_save + " vim:set sts=2 sw=2: diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim index 2fa10cc9..671a4d19 100644 --- a/runtime/indent/html.vim +++ b/runtime/indent/html.vim @@ -1,7 +1,7 @@ " Vim indent script for HTML " Maintainer: The Vim Project " Original Author: Andy Wokula -" Last Change: 2023 Aug 13 +" Last Change: 2025 Apr 13 " Version: 1.0 "{{{ " Description: HTML indent script with cached state for faster indenting on a " range of lines. @@ -868,7 +868,9 @@ func HtmlIndent_FindTagStart(lnum) let idx = match(getline(a:lnum), '\S>\s*$') if idx > 0 call cursor(a:lnum, idx) + " VIM_INDENT_TEST_TRACE_START let lnum = searchpair('<\w', '' , '\S>', 'bW', '', max([a:lnum - b:html_indent_line_limit, 0])) + " VIM_INDENT_TEST_TRACE_END HtmlIndent_FindTagStart if lnum > 0 return [lnum, 1] endif @@ -903,7 +905,9 @@ func HtmlIndent_FindTagEnd() call search('--\zs>') elseif s:get_tag('/' . tagname) != 0 " tag with a closing tag, find matching "" + " VIM_INDENT_TEST_TRACE_START call searchpair('<' . tagname, '', '', 'W', '', line('.') + b:html_indent_line_limit) + " VIM_INDENT_TEST_TRACE_END HtmlIndent_FindTagEnd else " self-closing tag, find the ">" call search('\S\zs>') diff --git a/runtime/indent/javascript.vim b/runtime/indent/javascript.vim index 8077442e..6537d3f2 100644 --- a/runtime/indent/javascript.vim +++ b/runtime/indent/javascript.vim @@ -2,7 +2,7 @@ " Language: Javascript " Maintainer: Chris Paul ( https://github.com/bounceme ) " URL: https://github.com/pangloss/vim-javascript -" Last Change: December 4, 2017 +" Last Change: 2025 Apr 13 " Only load this indent file when no other was loaded. if exists('b:did_indent') @@ -69,7 +69,9 @@ let s:rel = has('reltime') " searchpair() wrapper if s:rel function s:GetPair(start,end,flags,skip) + " VIM_INDENT_TEST_TRACE_START return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1,a:skip ==# 's:SkipFunc()' ? 2000 : 200) + " VIM_INDENT_TEST_TRACE_END s:GetPair endfunction else function s:GetPair(start,end,flags,skip) diff --git a/runtime/indent/m17ndb.vim b/runtime/indent/m17ndb.vim new file mode 100644 index 00000000..d25aafe1 --- /dev/null +++ b/runtime/indent/m17ndb.vim @@ -0,0 +1,14 @@ +" Vim indent file +" Language: m17n database +" Maintainer: David Mandelberg +" Last Change: 2025 Feb 21 + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal autoindent +setlocal nosmartindent + +let b:undo_indent = "setlocal autoindent< smartindent<" diff --git a/runtime/indent/make.vim b/runtime/indent/make.vim index 4d1838b3..aeea4de7 100644 --- a/runtime/indent/make.vim +++ b/runtime/indent/make.vim @@ -3,6 +3,7 @@ " Maintainer: Doug Kearns " Previous Maintainer: Nikolai Weibull " Last Change: 2022 Apr 06 +" 2025 Apr 22 by Vim Project: do not indent after special targets #17183 if exists("b:did_indent") finish @@ -21,6 +22,8 @@ endif let s:comment_rx = '^\s*#' let s:rule_rx = '^[^ \t#:][^#:]*:\{1,2}\%([^=:]\|$\)' +" .PHONY, .DELETE_ON_ERROR, etc +let s:rule_special = '^\.[A-Z_]\+\s*:' let s:continued_rule_rx = '^[^#:]*:\{1,2}\%([^=:]\|$\)' let s:continuation_rx = '\\$' let s:assignment_rx = '^\s*\h\w*\s*[+:?]\==\s*\zs.*\\$' @@ -50,7 +53,7 @@ function GetMakeIndent() if prev_line =~ s:continuation_rx if prev_prev_line =~ s:continuation_rx return indent(prev_lnum) - elseif prev_line =~ s:rule_rx + elseif prev_line =~ s:rule_rx && prev_line !~ s:rule_special return shiftwidth() elseif prev_line =~ s:assignment_rx call cursor(prev_lnum, 1) @@ -81,15 +84,15 @@ function GetMakeIndent() let line = getline(lnum) endwhile let folded_lnum = lnum + 1 - if folded_line =~ s:rule_rx - if getline(v:lnum) =~ s:rule_rx + if folded_line =~ s:rule_rx && prev_line !~ s:rule_special + if getline(v:lnum) =~ s:rule_rx && prev_line !~ s:rule_special return 0 else return &ts endif else " elseif folded_line =~ s:folded_assignment_rx - if getline(v:lnum) =~ s:rule_rx + if getline(v:lnum) =~ s:rule_rx && prev_line !~ s:rule_special return 0 else return indent(folded_lnum) @@ -98,8 +101,8 @@ function GetMakeIndent() " " TODO: ? " return indent(prev_lnum) endif - elseif prev_line =~ s:rule_rx - if getline(v:lnum) =~ s:rule_rx + elseif prev_line =~ s:rule_rx && prev_line !~ s:rule_special + if getline(v:lnum) =~ s:rule_rx && prev_line !~ s:rule_special return 0 else return &ts diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim index 184e8298..a1abd1d0 100644 --- a/runtime/indent/sh.vim +++ b/runtime/indent/sh.vim @@ -7,6 +7,7 @@ " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-sh-indent " Changelog: +" 20250318 - Detect local arrays in functions " 20241411 - Detect dash character in function keyword for " bash mode (issue #16049) " 20190726 - Correctly skip if keywords in syntax comments @@ -73,6 +74,8 @@ function! s:indent_value(option) endfunction function! GetShIndent() + let mode = mode() + let curline = getline(v:lnum) let lnum = prevnonblank(v:lnum - 1) if lnum == 0 @@ -86,8 +89,11 @@ function! GetShIndent() " Check contents of previous lines " should not apply to e.g. commented lines - if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' || - \ (&ft is# 'zsh' && line =~ '^\s*\<\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>') + + if s:start_block(line) + let ind += s:indent_value('default') + elseif line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>\($\|\s\)' || + \ (&ft is# 'zsh' && line =~ '^\s*\<\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>\($\|\s\)') if !s:is_end_expression(line) let ind += s:indent_value('default') endif @@ -111,7 +117,7 @@ function! GetShIndent() let ind += s:indent_value('continuation-line') endif elseif s:end_block(line) && !s:start_block(line) - let ind = indent(lnum) + let ind -= s:indent_value('default') elseif pnum != 0 && \ s:is_continuation_line(pline) && \ !s:end_block(curline) && @@ -122,7 +128,7 @@ function! GetShIndent() while !s:is_empty(getline(i)) && i > pnum let i -= 1 endw - if i == pnum + if i == pnum && (s:is_continuation_line(line) || pline =~ '{\s*\(#.*\)\=$') let ind += ind2 else let ind = ind2 @@ -136,7 +142,11 @@ function! GetShIndent() " TODO: should we do the same for other "end" lines? if curline =~ '^\s*\%(fi\);\?\s*\%(#.*\)\=$' let ind = indent(v:lnum) - let previous_line = searchpair('\', '', '\\zs', 'bnW', 'synIDattr(synID(line("."),col("."), 1),"name") =~? "comment\\|quote"') + " in insert mode, try to place the cursor after the fi statement + let endp = '\' .. (mode ==? 'i' ? '\zs' : '') + let startp = '^\s*\' + let previous_line = searchpair(startp, '', endp , 'bnW', + \ 'synIDattr(synID(line("."),col("."), 1),"name") =~? "comment\\|quote\\|option"') if previous_line > 0 let ind = indent(previous_line) endif @@ -167,7 +177,13 @@ function! GetShIndent() elseif match(map(synstack(v:lnum, 1), 'synIDattr(v:val, "name")'), '\c\mheredoc') > -1 return indent(v:lnum) elseif s:is_comment(line) && s:is_empty(getline(v:lnum-1)) - return indent(v:lnum) + if s:is_in_block(v:lnum) + " return indent of line in same block + return indent(lnum) + else + " use indent of current line + return indent(v:lnum) + endif endif return ind > 0 ? ind : 0 @@ -203,7 +219,18 @@ function! s:is_function_definition(line) endfunction function! s:is_array(line) - return a:line =~ '^\s*\<\k\+\>=(' + return a:line =~ '^\s*\(\(declare\|typeset\|local\)\s\+\(-[Aalrtu]\+\s\+\)\?\)\?\<\k\+\>=(' +endfunction + +function! s:is_in_block(line) + " checks whether a:line is whithin a + " block e.g. a shell function + " foo() { + " .. + " } + let prevline = searchpair('{', '', '}', 'bnW', 'synIDattr(synID(line("."),col("."), 1),"name") =~? "comment\\|quote"') + let nextline = searchpair('{', '', '}', 'nW', 'synIDattr(synID(line("."),col("."), 1),"name") =~? "comment\\|quote"') + return a:line > prevline && a:line < nextline endfunction function! s:is_case_label(line, pnum) @@ -280,15 +307,7 @@ function! s:end_block(line) endfunction function! s:start_block(line) - return a:line =~ '{\s*\(#.*\)\?$' -endfunction - -function! s:find_start_block(lnum) - let i = a:lnum - while i > 1 && !s:start_block(getline(i)) - let i -= 1 - endwhile - return i + return a:line =~ '^[^#]*[{(]\s*\(#.*\)\?$' endfunction function! s:is_comment(line) @@ -300,7 +319,11 @@ function! s:is_end_expression(line) endfunction function! s:is_bash() - return get(g:, 'is_bash', 0) || get(b:, 'is_bash', 0) + if &ft is# 'bash' || getline(1) is# '#!/bin/bash' + return v:true + else + return get(g:, 'is_bash', 0) || get(b:, 'is_bash', 0) + endif endfunction let &cpo = s:cpo_save diff --git a/runtime/indent/spajson.vim b/runtime/indent/spajson.vim new file mode 100644 index 00000000..e644a5ee --- /dev/null +++ b/runtime/indent/spajson.vim @@ -0,0 +1,6 @@ +" Vim indent file +" Language: SPA JSON +" Maintainer: David Mandelberg +" Last Change: 2025 Mar 22 + +runtime! indent/json.vim diff --git a/runtime/indent/testdir/README.txt b/runtime/indent/testdir/README.txt index 65975605..7454210e 100644 --- a/runtime/indent/testdir/README.txt +++ b/runtime/indent/testdir/README.txt @@ -36,6 +36,9 @@ First of all, create a FILETYPE.in file. It should contain: \ 'string' " END_INDENT + When an indent script utilises timed "search*()"es and supports related + timeout configuration, consider setting a generous timeout value from + INDENT_EXE lines (look at "g:vim_indent" in "testdir/vim.in" for details). Note that the command is not undone, you may need to reverse the effect for the next block of lines. diff --git a/runtime/indent/testdir/bitbake.in b/runtime/indent/testdir/bitbake.in index afd19be1..97b760fc 100644 --- a/runtime/indent/testdir/bitbake.in +++ b/runtime/indent/testdir/bitbake.in @@ -1,6 +1,8 @@ # vim: set filetype=bitbake : # START_INDENT +# INDENT_EXE let g:pyindent_searchpair_timeout = 64 +# INDENT_EXE runtime autoload/python.vim FOO = " \ bar \ baz \ diff --git a/runtime/indent/testdir/bitbake.ok b/runtime/indent/testdir/bitbake.ok index 1bc5a18c..000ef508 100644 --- a/runtime/indent/testdir/bitbake.ok +++ b/runtime/indent/testdir/bitbake.ok @@ -1,6 +1,8 @@ # vim: set filetype=bitbake : # START_INDENT +# INDENT_EXE let g:pyindent_searchpair_timeout = 64 +# INDENT_EXE runtime autoload/python.vim FOO = " \ bar \ baz \ diff --git a/runtime/indent/testdir/html.in b/runtime/indent/testdir/html.in index 4783a096..72a38b93 100644 --- a/runtime/indent/testdir/html.in +++ b/runtime/indent/testdir/html.in @@ -2,6 +2,7 @@ % START_INDENT +% INDENT_EXE let b:html_indent_line_limit = 64 + + + +



+

An H2 header

+



+
+ +

Paragraph #1. +

+ +

Paragraph #2. + +

+ + +

Paragraph #1. +

    +
  • Item a.
  • Item b.
  • +
  • Item c. +
+

Paragraph #2. +

+
+ +
+
A quick brown fox jumps over the lazy dog +
Woof! +
+
A quick brown fox jumps over the lazy dog +
Woof! +
+
+ +
Thread #1 +
Thread #2 +
+
+ +

+ + +

+ + + ++ + +
Some Caption
Header #1Header #2Header #3 +
Column #1Column #2Column #3 +
Column #1Column #2Column #3 +
Column #1Column #2Column #3 +
Column #1Column #2Column #3 +
+ +
+
	
+<div class="block">
+<blockquote><pre><code>
+</code></pre></blockquote></div>
+
+ +

Paragraph #3.

Paragraph #4.

Paragraph #5. + +

Paragraph #6.

Paragraph #7.

Paragraph #8.

Paragraph #9.

+ +

Paragraph #10. +

+ +

Paragraph #11.

Paragraph #12.

Paragraph #13.

Paragraph #14.

+ +

Paragraph #15. +

Paragraph #16. + + diff --git a/runtime/syntax/testdir/input/html_fold_syntax.html b/runtime/syntax/testdir/input/html_fold_syntax.html new file mode 100644 index 00000000..73579aa9 --- /dev/null +++ b/runtime/syntax/testdir/input/html_fold_syntax.html @@ -0,0 +1,105 @@ + + + + + +A folding syntax test + + + +



+

An H2 header

+



+
+ +

Paragraph #1. +

+ +

Paragraph #2.

+ +
+ + +

Paragraph #1.

+
    +
  • Item a.
  • Item b.
  • +
  • Item c.
  • +
+

Paragraph #2. +

+
+ +
+
A quick brown fox jumps over the lazy dog
+
Woof! +
+
A quick brown fox jumps over the lazy dog
+
Woof!
+
+
+ +
Thread #1 +
Thread #2 +
+
+ +

+ + +

+ + + + + + + + + + + +
Some Caption
Header #1Header #2Header #3
Column #1Column #2Column #3
Column #1Column #2Column #3
Column #1Column #2Column #3
Column #1Column #2Column #3
+ +
+
	
+<div class="block">
+<blockquote><pre><code>
+</code></pre></blockquote></div>
+
+ +

Paragraph #3.

Paragraph #4.

Paragraph #5.

+ +

Paragraph #6.

Paragraph #7.

Paragraph #8.

Paragraph #9.

+ +

Paragraph #10. +

+ +

Paragraph #11.

Paragraph #12.

Paragraph #13.

Paragraph #14.

+ +

Paragraph #15. +

Paragraph #16. + + diff --git a/runtime/syntax/testdir/input/java_comments_html.java b/runtime/syntax/testdir/input/java_comments_html.java index eeffef5b..15d4a2fa 100644 --- a/runtime/syntax/testdir/input/java_comments_html.java +++ b/runtime/syntax/testdir/input/java_comments_html.java @@ -1,8 +1,8 @@ // VIM_TEST_SETUP unlet! g:java_no_tab_space_error g:java_ignore_javadoc // VIM_TEST_SETUP unlet! g:java_no_trail_space_error -// VIM_TEST_SETUP let [g:java_space_errors,g:java_comment_strings]=[1,1] -// VIM_TEST_SETUP let g:java_ignore_markdown = 1 - +// VIM_TEST_SETUP unlet! g:java_consent_to_html_syntax_folding +// VIM_TEST_SETUP let[g:java_space_errors,g:java_comment_strings]=[1,1] +// VIM_TEST_SETUP let[g:java_ignore_markdown,g:html_syntax_folding]=[1,1] diff --git a/runtime/syntax/testdir/input/java_comments_markdown.java b/runtime/syntax/testdir/input/java_comments_markdown.java index fa369719..a34af8f3 100644 --- a/runtime/syntax/testdir/input/java_comments_markdown.java +++ b/runtime/syntax/testdir/input/java_comments_markdown.java @@ -2,8 +2,8 @@ // VIM_TEST_SETUP unlet! g:java_no_trail_space_error // VIM_TEST_SETUP let[g:java_space_errors,g:java_comment_strings]=[1,1] // VIM_TEST_SETUP let[g:java_ignore_html,g:markdown_syntax_conceal]=[1,1] - - +// VIM_TEST_SETUP let g:html_syntax_folding = 1 +// VIM_TEST_SETUP let g:java_consent_to_html_syntax_folding = 1 diff --git a/runtime/syntax/testdir/input/java_previews_455.java b/runtime/syntax/testdir/input/java_previews_455.java index b9c2070e..ed6430f5 100644 --- a/runtime/syntax/testdir/input/java_previews_455.java +++ b/runtime/syntax/testdir/input/java_previews_455.java @@ -1,4 +1,4 @@ -// VIM_TEST_SETUP let g:java_syntax_previews = [455] +// VIM_TEST_SETUP let g:java_syntax_previews = [455, 488] diff --git a/runtime/syntax/testdir/input/setup/html_fold_expr.vim b/runtime/syntax/testdir/input/setup/html_fold_expr.vim new file mode 100644 index 00000000..e8daae0e --- /dev/null +++ b/runtime/syntax/testdir/input/setup/html_fold_expr.vim @@ -0,0 +1,2 @@ +let g:html_expr_folding = 1 +filetype plugin on diff --git a/runtime/syntax/testdir/input/setup/java_module_info.vim b/runtime/syntax/testdir/input/setup/java_module_info.vim index b7b818f8..15dbdc80 100644 --- a/runtime/syntax/testdir/input/setup/java_module_info.vim +++ b/runtime/syntax/testdir/input/setup/java_module_info.vim @@ -29,4 +29,4 @@ autocmd_add([{ once: true, }]) -g:java_syntax_previews = [476] +g:java_syntax_previews = [476, 494] diff --git a/runtime/syntax/testdir/input/setup/vim9_ex_enum.vim b/runtime/syntax/testdir/input/setup/vim9_ex_enum.vim new file mode 100644 index 00000000..ebd90ede --- /dev/null +++ b/runtime/syntax/testdir/input/setup/vim9_ex_enum.vim @@ -0,0 +1 @@ +hi link vimVar Identifier diff --git a/runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim b/runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim new file mode 100644 index 00000000..ebd90ede --- /dev/null +++ b/runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim @@ -0,0 +1 @@ +hi link vimVar Identifier diff --git a/runtime/syntax/testdir/input/setup/vim_ex_redir.vim b/runtime/syntax/testdir/input/setup/vim_ex_redir.vim new file mode 100644 index 00000000..6193cc4e --- /dev/null +++ b/runtime/syntax/testdir/input/setup/vim_ex_redir.vim @@ -0,0 +1,2 @@ +highlight link vimVar Identifier +highlight link vimRedirFile String diff --git a/runtime/syntax/testdir/input/sh_13.sh b/runtime/syntax/testdir/input/sh_13.sh new file mode 100644 index 00000000..18fd0d13 --- /dev/null +++ b/runtime/syntax/testdir/input/sh_13.sh @@ -0,0 +1,9 @@ +#!/bin/dash +# Issue #17026 (bash highlighting requires space after $()) +# https://github.com/vim/vim/issues/17026#issuecomment-2774112284 + +_comp_compgen_split -l -- "$( + tmux list-commands -F "#{command_list_name}" + tmux list-commands -F "#{command_list_alias}" +)" + diff --git a/runtime/syntax/testdir/input/sh_14.sh b/runtime/syntax/testdir/input/sh_14.sh new file mode 100644 index 00000000..bfa3d93a --- /dev/null +++ b/runtime/syntax/testdir/input/sh_14.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Issue #17221 (sh syntax: escaped square brackets don't work in [[ ]]) + +[[ foo == [bar] ]] +[[ foo == \[bar\] ]] + +echo [foo] +echo \[foo\] diff --git a/runtime/syntax/testdir/input/sh_ksh_array.sh b/runtime/syntax/testdir/input/sh_ksh_array.sh new file mode 100755 index 00000000..22806ffc --- /dev/null +++ b/runtime/syntax/testdir/input/sh_ksh_array.sh @@ -0,0 +1,21 @@ +#!/bin/ksh + +foo=( + ( 00 01 ) + ( 10 11 ) +) + +bar=( + [0]=( + [0]=00 + [1]=01 + ) + [1]=( + [0]=10 + [1]=11 + ) +) + + +echo ${foo[1][1]} # => 11 +echo ${bar[1][1]} # => 11 diff --git a/runtime/syntax/testdir/input/sh_quoting.sh b/runtime/syntax/testdir/input/sh_quoting.sh new file mode 100644 index 00000000..dc6a5152 --- /dev/null +++ b/runtime/syntax/testdir/input/sh_quoting.sh @@ -0,0 +1,4 @@ +#!/bin/dash + +echo ${foo:-'string \'} + diff --git a/runtime/syntax/testdir/input/tera.tera b/runtime/syntax/testdir/input/tera.tera new file mode 100644 index 00000000..161793c9 --- /dev/null +++ b/runtime/syntax/testdir/input/tera.tera @@ -0,0 +1,165 @@ + + + + + + {{ page_title | default(value="Tera Test") }} + {% if include_styles %} + + {% endif %} + + +

+ {# Header Section with variable interpolation #} +
+

{{ header_text | upper }}

+ {% if subheader %} +

{{ subheader }}

+ {% endif %} +
+ + {# Navigation example with for loop #} + + + {# Main content section with various template features #} +
+ {# Conditionals #} + {% if user %} +
+

Welcome back, {{ user.name }}!

+

Last login: {{ user.last_login | date(format="%Y-%m-%d") }}

+
+ {% elif visitor_count > 0 %} +
+

Welcome, visitor!

+

You are visitor number {{ visitor_count }}

+
+ {% else %} +
+

Welcome to our site!

+
+ {% endif %} + + {# Macro definition and usage #} + {% macro render_item(item, featured=false) %} + + {% endmacro render_item %} + + {# Items section with macro usage #} +
+

Items ({{ items | length }})

+ + {% for item in items %} + {{ self::render_item(item=item, featured=item.id == featured_id) }} + + {% if not loop.last %} +
+ {% endif %} + {% endfor %} +
+ + {# Raw content that shouldn't be processed #} + {% raw %} +
+ The syntax {{ variable }} will not be processed in raw blocks. + Neither will {% control %} structures. +
+ {% endraw %} + + {# Includes #} + {% include "partials/footer.tera" %} + + {# Inheritance example #} + {% block content %} +

This is the default content.

+ {% endblock content %} + + {# Set variables #} + {% set text_color = dark_mode ? "#fff" : "#333" %} + {% set items_count = items | length %} + +
+ We have {{ items_count }} items. +
+ + {# Filters with complex expressions #} +

{{ "Hello, " ~ user.name | default(value="Guest") | upper }}

+

{{ items | filter(attribute="featured", value=true) | length }} featured items

+ + {# With statement #} + {% with %} + {% set local_var = "Only visible in this scope" %} +

{{ local_var }}

+ {% endwith %} + + {# Mathematical operations #} +
+

Price: ${{ price }}

+

Tax ({{ tax_rate * 100 }}%): ${{ price * tax_rate }}

+

Total: ${{ price * (1 + tax_rate) }}

+
+ + {# Boolean operations #} + {% if user and user.is_admin or super_user %} +
Admin panel
+ {% endif %} +
+ + {# Footer section with filters and includes #} +
+

© {{ current_year }} {{ company_name | default(value="Our Company") }}

+ + {% if debug %} +
+

Render time: {{ render_time }}ms

+

Template version: {{ version }}

+
+ {% endif %} +
+
+ + + + diff --git a/runtime/syntax/testdir/input/vim9_comment.vim b/runtime/syntax/testdir/input/vim9_comment.vim index fd6a5d2a..590ddd86 100644 --- a/runtime/syntax/testdir/input/vim9_comment.vim +++ b/runtime/syntax/testdir/input/vim9_comment.vim @@ -34,6 +34,10 @@ autocmd BufNewFile * { \ continuing comment \ continuing comment +var foo = 42 # commment + \ continuing comment + \ continuing comment + # :Foo \ arg1 #\ comment @@ -51,6 +55,18 @@ echo "TOP" \ arg2 +# Expression comments + +var foo = { # comment + # comment + bar: 42, # comment + # comment + # comment + baz: 42 # comment + # comment +} # comment + + # Issue: #13047 if !exists(":DiffOrig") @@ -62,3 +78,15 @@ endif # Issue: #11307 and #11560 # This is what we call " blah + + +# PR: #14975 +# https://github.com/vim/vim/pull/14975#issuecomment-2832643115 + +var d = { + a: 0, +# a ' quote {{{ +#}}} +b: 0, +} + diff --git a/runtime/syntax/testdir/input/vim9_constructor.vim b/runtime/syntax/testdir/input/vim9_constructor.vim new file mode 100644 index 00000000..71a2ea42 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_constructor.vim @@ -0,0 +1,19 @@ +vim9script + +# Vim9 constructor + + +class A + static var _instance: A + var str: string + def _new(str: string) + this.str = str + enddef + static def GetInstance(str: string): A + if _instance == null + _instance = A._new(str) + endif + return _instance + enddef +endclass + diff --git a/runtime/syntax/testdir/input/vim9_def_variables.vim b/runtime/syntax/testdir/input/vim9_def_variables.vim index 94ef810b..4580c0ee 100644 --- a/runtime/syntax/testdir/input/vim9_def_variables.vim +++ b/runtime/syntax/testdir/input/vim9_def_variables.vim @@ -12,7 +12,7 @@ def Foo() t:foo = expr w:foo = expr - v:foo = expr + v:true = expr $FOO = expr @@ -59,6 +59,9 @@ END foo[1:] = expr foo[:] = expr + foo["key"] = expr + foo['key'] = expr + foo += expr foo -= expr foo *= expr @@ -107,36 +110,36 @@ END @f = expr @f ..= expr - &foo = expr + &ari = expr &t_k1 = "\[234;" - &foo ..= expr + &ari ..= expr - &foo += expr - &foo -= expr + &ari += expr + &ari -= expr - &l:foo = expr + &l:aleph = expr - &l:foo ..= expr - &l:foo += expr - &l:foo -= expr + &l:aleph ..= expr + &l:aleph += expr + &l:aleph -= expr - &g:foo = expr + &g:aleph = expr - &g:foo ..= expr - &g:foo += expr - &g:foo -= expr + &g:aleph ..= expr + &g:aleph += expr + &g:aleph -= expr [foo, bar] = expr [foo, \ bar] = expr - [v:foo, v:bar] = expr - [v:foo, - \ v:bar] = expr - [&foo, &bar] = expr - [&foo, - \ &bar] = expr + [v:true, v:false] = expr + [v:true, + \ v:false] = expr + [&ari, &bkc] = expr + [&ari, + \ &bkc] = expr [$foo, $bar] = expr [$foo, \ $bar] = expr @@ -155,18 +158,18 @@ END [foo, \ bar; \ baz] = expr - [v:foo, v:bar; v:baz] = expr - [v:foo, - \ v:bar; - \ v:baz] = expr + [v:true, v:false; v:none] = expr + [v:true, + \ v:false; + \ v:none] = expr [$foo, $bar; $baz] = expr [$foo, \ $bar; \ $baz] = expr - [&foo, &bar; &baz] = expr - [&foo, - \ &bar; - \ &baz] = expr + [&ari, &bkc; &cmp] = expr + [&ari, + \ &bkc; + \ &cmp] = expr [@a, @b; @c] = expr [@a, \ @b; @@ -195,6 +198,28 @@ END for [foo, bar] in expr endfor -enddef +# Scope dictionaries + +echo get(b:, 'foo', 42) +echo get(w:, 'foo', 42) +echo get(t:, 'foo', 42) +echo get(g:, 'foo', 42) +echo get(v:, 'foo', 42) + +for k in keys(b:) | echo b:[k] | endfor +for k in keys(w:) | echo w:[k] | endfor +for k in keys(t:) | echo t:[k] | endfor +for k in keys(g:) | echo g:[k] | endfor +for k in keys(v:) | echo v:[k] | endfor + +# Neovim-specific variables (not highlighted by default) + +echo v:lua v:msgpack_types v:relnum v:stderr v:termrequest v:virtnum + +echo &channel &inccommand &mousescroll &pumblend &redrawdebug &scrollback +echo &shada &shadafile &statuscolumn &termpastefilter &termsync &winbar +echo &winblend &winhighlight + +enddef diff --git a/runtime/syntax/testdir/input/vim9_ex_enum.vim b/runtime/syntax/testdir/input/vim9_ex_enum.vim new file mode 100644 index 00000000..8529deda --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_ex_enum.vim @@ -0,0 +1,111 @@ +vim9script +# Vim :enum command +# VIM_TEST_SETUP hi link vim9EnumValue Todo + + +interface Interface1 + def Def1() +endinterface +interface Interface2 +endinterface + +# enum-implements clause with interspersed comments + +enum Enum1 implements Interface1, Interface2 + Value1 + def Def1() + enddef +endenum + +enum Enum2 + \ implements Interface1, Interface2 + Value1 + def Def1() + enddef +endenum + +enum Enum3 # comment + \ implements Interface1, Interface2 + Value1 +endenum + +enum Enum4 + # comment + \ implements Interface1, Interface2 + Value1 +endenum + +enum Enum5 + \ implements Interface1, Interface2 # comment + Value1 + def Def1() + enddef +endenum + +enum Enum6 + #\ comment + \ implements Interface1, Interface2 + Value1 + def Def1() + enddef +endenum + +# [enum Enum7.Value1 {name: 'Value1', ordinal: 0, val1: 0, val2: 0}, enum Enum7.Value2 {name: 'Value2', ordinal: 1, val1: 1, val2: 0}, enum Enum7.Value3 {name: 'Value3', ordinal: 2, val1: 2, val2: 0}] +# comment +enum Enum7 + \ + #\ comment + \ + #\ comment + \ implements Interface1, Interface2 # comment + # comment + # comment + Value1, # comment + # comment + # comment + Value2(1 + 0), # comment + # comment + # comment + Value3( # comment + # comment + 1 # comment + # comment + + # comment + # comment + 1 # comment + ) # comment + # comment + var val1: number # comment + # comment + def Def1() + enddef + # comment + static def Def2() # comment + # comment + enddef # comment + # comment + public var val2: number # comment +endenum + +# [enum Enum8.implements {name: 'implements', ordinal: 0}] +enum Enum8 implements Interface1, Interface2 + implements + def Def1() + enddef +endenum + +# [enum Enum9.Value1 {name: 'Value1', ordinal: 0, implements: 0}] +enum Enum9 implements Interface1, Interface2 + Value1 + var implements: number + def Def1() + enddef +endenum + +# [enum Enum10.implements {name: 'implements', ordinal: 0}] +enum Enum10 implements Interface1, Interface2 + implements + def Def1() + enddef +endenum + diff --git a/runtime/syntax/testdir/input/vim9_ex_enum2.vim b/runtime/syntax/testdir/input/vim9_ex_enum2.vim new file mode 100644 index 00000000..e3b3d2dc --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_ex_enum2.vim @@ -0,0 +1,32 @@ +vim9script +# Vim :enum command +# VIM_TEST_SETUP hi link vim9EnumValue Todo + + +# See: https://github.com/vim/vim/pull/16365#issuecomment-2571420551 + +enum Letter + # + ######################################### + A("(\" # not a comment NOR_ANOTHER_VALUE, + \ "), B(")\""), C($"'') + \('"), D($'""(),"'), E, + F( + ")" .. # FA, + "(" # FB, + ), G + #enum NotSupported + #endenum + + def new(this.value = v:none) + return + enddef + const value: string +endenum + +for letter in Letter.values + echo letter +endfor + +echo Letter.D + diff --git a/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim b/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim index 0656907e..b6dfc4ea 100644 --- a/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim +++ b/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim @@ -2,6 +2,8 @@ vim9script # Vim :enum command # VIM_TEST_SETUP let g:vimsyn_folding = 'ef' # VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax +# VIM_TEST_SETUP hi link vim9EnumValue Todo + interface Interface1 endinterface @@ -29,11 +31,20 @@ enum Enum4 endenum enum Enum5 implements Interface1, Interface2 - Value1, - Value2, - Value3 - def Method1() - def Nested() - enddef + Value1, + Value2, + Value3 + def Method1() + def Nested() enddef + enddef endenum + +enum Enum6 + #\ comment + \ implements Interface1, Interface2 + Value1, + Value2, + Value3 +endenum + diff --git a/runtime/syntax/testdir/input/vim9_expr.vim b/runtime/syntax/testdir/input/vim9_expr.vim index fd9cbb00..e291309e 100644 --- a/runtime/syntax/testdir/input/vim9_expr.vim +++ b/runtime/syntax/testdir/input/vim9_expr.vim @@ -2,6 +2,71 @@ vim9script # Vim9-script expressions +# Number + +# ' separated + +echo 1'000'000 +echo 1'000'000.00 +echo -1'000'000 +echo -1'000'000.00 + +echo 0b1000'0000 +echo 0o1000'0000 +echo 0x1000'0000 +echo -0b1000'0000 +echo -0o1000'0000 +echo -0x1000'0000 + +# Dictionary + +echo {} +echo { foo: 21 * 2 } +echo { -foo-: 21 * 2 } +echo { 42: 21 * 2 } +echo { 'foo': 21 * 2 } +echo { "foo": 21 * 2 } + +echo { foo: { bar: 21 * 2 } } +echo { foo: { -bar-: 21 * 2 } } +echo { foo: { 42: 21 * 2 } } +echo { foo: { 'bar': 21 * 2 } } +echo { foo: { "bar": 21 * 2 } } + +echo { -foo-: { bar: 21 * 2 } } +echo { -foo-: { -bar-: 21 * 2 } } +echo { -foo-: { 42: 21 * 2 } } +echo { -foo-: { 'bar': 21 * 2 } } +echo { -foo-: { "bar": 21 * 2 } } + +echo { 42: { bar: 21 * 2 } } +echo { 42: { -bar-: 21 * 2 } } +echo { 42: { 42: 21 * 2 } } +echo { 42: { 'bar': 21 * 2 } } +echo { 42: { "bar": 21 * 2 } } + +echo { 'foo': { bar: 21 * 2 } } +echo { 'foo': { -bar-: 21 * 2 } } +echo { 'foo': { 42: 21 * 2 } } +echo { 'foo': { "bar": 21 * 2 } } +echo { 'foo': { 'bar': 21 * 2 } } + +echo { "foo": { bar: 21 * 2 } } +echo { "foo": { -bar-: 21 * 2 } } +echo { "foo": { 42: 21 * 2 } } +echo { "foo": { 'bar': 21 * 2 } } +echo { "foo": { "bar": 21 * 2 } } + +echo { + # comment + foo: { + bar: 21 * 2 + } +} + +# match as keys not scope dictionaries +echo { b: 42, w: 42, t: 42, g: 42, l: 42, s: 42, a: 42, v: 42 } + # Operators # Ternary @@ -100,7 +165,7 @@ def Foo() enddef -# Issue #16227 (Vimscript ternary expression highlighting) +# Issue #16227 (Vim script ternary expression highlighting) var foo = 'foo' # comment var bar = foo == 'foo' ? 'bar' : 'baz' diff --git a/runtime/syntax/testdir/input/vim9_function_calls.vim b/runtime/syntax/testdir/input/vim9_function_calls.vim new file mode 100644 index 00000000..0b9f4c25 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_function_calls.vim @@ -0,0 +1,18 @@ +vim9script + +# Vim9 function calls + +clearmatches() +:call clearmatches() +echo "Foo" | clearmatches() + + +# Issue 16721 (Vim script highlight of builtin function after |) + +&directory = $'{$MYVIMDIR}/.data/swap/' +&backupdir = $'{$MYVIMDIR}/.data/backup//' +&undodir = $'{$MYVIMDIR}/.data/undo//' +if !isdirectory(&undodir) | mkdir(&undodir, "p") | endif +if !isdirectory(&backupdir) | mkdir(&backupdir, "p") | endif +if !isdirectory(&directory) | mkdir(&directory, "p") | endif + diff --git a/runtime/syntax/testdir/input/vim9_lambda.vim b/runtime/syntax/testdir/input/vim9_lambda.vim index 4340eb09..81d9dc27 100644 --- a/runtime/syntax/testdir/input/vim9_lambda.vim +++ b/runtime/syntax/testdir/input/vim9_lambda.vim @@ -1,4 +1,7 @@ vim9script +# VIM_TEST_SETUP hi link vim9LambdaOperator Todo +# VIM_TEST_SETUP hi link vim9LambdaParen Todo + # Vim 9 lambda expressions @@ -6,6 +9,7 @@ var Foo: func var expr = 0 # without return type + Foo = () => expr Foo = (_) => expr Foo = (x) => expr @@ -26,6 +30,7 @@ Foo = (x: number, ...y: list) => expr Foo = (x: number, y: number) => expr # with return type + Foo = (): number => expr Foo = (_): number => expr Foo = (x): number => expr @@ -45,6 +50,27 @@ Foo = (x: number, ...y: list): number => expr Foo = (x: number, y: number): number => expr +# with compound return type + +Foo = (): list => expr +Foo = (_): list => expr +Foo = (x): list => expr + +Foo = (...y): list => expr +Foo = (_, ...y): list => expr +Foo = (x, ...y): list => expr + +Foo = (x, y): list => expr + +Foo = (_: number): list => expr +Foo = (x: number): list => expr + +Foo = (...y: list): list => expr +Foo = (_: number, ...y: list): list => expr +Foo = (x: number, ...y: list): list => expr + +Foo = (x: number, y: number): list => expr + # post operator comments @@ -62,15 +88,29 @@ Foo = () => # line continuations +Foo = (x: string, + \ y: number, + \ z: bool) => expr + +Foo = (x: string, + \ y: number, + \ z: bool) + \ => expr + Foo = (x: string, \ y: number, \ z: bool): number => expr -# FIXME + Foo = (x: string, \ y: number, \ z: bool): number \ => expr +Foo = (x: string, + \ y: number, + \ z: bool): + \ number => expr + # funcref call @@ -114,3 +154,9 @@ def Op(): func(func(number, number): number): func(number, Digit): number (x: number, y: Digit): number => F(x, y.value) enddef ####################### ^ vimCommand? + +# Issue #16965 (vim syntax: wrong highlight with lambda, autoload, and false keyword) + +autocmd BufRead * timer_start(0, (_) => f#a(false, false)) +autocmd + diff --git a/runtime/syntax/testdir/input/vim9_shebang.vim b/runtime/syntax/testdir/input/vim9_shebang.vim old mode 100755 new mode 100644 diff --git a/runtime/syntax/testdir/input/vim9_tuple.vim b/runtime/syntax/testdir/input/vim9_tuple.vim new file mode 100644 index 00000000..99370a55 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_tuple.vim @@ -0,0 +1,26 @@ +vim9script + +# Vim9 tuples + + +# https://github.com/vim/vim/pull/16935#issuecomment-2738310273 + +function LegacyMakeEntry(key, value) abort + return (a:key, a:value) +endfunction + +def MakeEntry(key: string, value: any): tuple + return (key, value) +enddef + +function LegacyMakeLazyList(e1, e2) abort + return ({e1_, e2_ -> {-> [e1_, e2_]}}(a:e1, a:e2)) +endfunction + +def MakeLazyList(e1: any, e2: any): func(): list + return (((e1_: any, e2_: any) => () => [e1_, e2_])(e1, e2)) +enddef + +echo MakeEntry('key', 'value') == list2tuple(MakeLazyList('key', 'value')()) +echo LegacyMakeEntry('key', 'value') == list2tuple(LegacyMakeLazyList('key', 'value')()) + diff --git a/runtime/syntax/testdir/input/vim9_variables.vim b/runtime/syntax/testdir/input/vim9_variables.vim index 88dfb58a..35210452 100644 --- a/runtime/syntax/testdir/input/vim9_variables.vim +++ b/runtime/syntax/testdir/input/vim9_variables.vim @@ -11,7 +11,7 @@ g:foo = expr t:foo = expr w:foo = expr -v:foo = expr +v:true = expr $FOO = expr @@ -47,6 +47,24 @@ var foo =<< eval trim END ... END +# Typed declarations + +var foo: tuple = expr +var foo: tuple = expr +var foo: tuple = expr +var foo: tuple<...list> = expr +var foo: tuple<...list> = expr +var foo: tuple> = expr + +var foo: tuple< + #\ comment + \number, + #\ comment + \string, + #\ comment + \bool + \> + # Assignments foo = expr @@ -58,6 +76,9 @@ foo[:2] = expr foo[1:] = expr foo[:] = expr +foo["key"] = expr +foo['key'] = expr + foo += expr foo -= expr foo *= expr @@ -106,36 +127,36 @@ $FOO ..= expr @f = expr @f ..= expr -&foo = expr +&ari = expr &t_k1 = "\[234;" -&foo ..= expr +&ari ..= expr -&foo += expr -&foo -= expr +&ari += expr +&ari -= expr -&l:foo = expr +&l:aleph = expr -&l:foo ..= expr -&l:foo += expr -&l:foo -= expr +&l:aleph ..= expr +&l:aleph += expr +&l:aleph -= expr -&g:foo = expr +&g:aleph = expr -&g:foo ..= expr -&g:foo += expr -&g:foo -= expr +&g:aleph ..= expr +&g:aleph += expr +&g:aleph -= expr [foo, bar] = expr [foo, \ bar] = expr -[v:foo, v:bar] = expr -[v:foo, - \ v:bar] = expr -[&foo, &bar] = expr -[&foo, - \ &bar] = expr +[v:true, v:false] = expr +[v:true, + \ v:false] = expr +[&ari, &bkc] = expr +[&ari, + \ &bkc] = expr [$foo, $bar] = expr [$foo, \ $bar] = expr @@ -154,18 +175,18 @@ $FOO ..= expr [foo, \ bar; \ baz] = expr -[v:foo, v:bar; v:baz] = expr -[v:foo, - \ v:bar; - \ v:baz] = expr +[v:true, v:false; v:none] = expr +[v:true, + \ v:false; + \ v:none] = expr [$foo, $bar; $baz] = expr [$foo, \ $bar; \ $baz] = expr -[&foo, &bar; &baz] = expr -[&foo, - \ &bar; - \ &baz] = expr +[&ari, &bkc; &cmp] = expr +[&ari, + \ &bkc; + \ &cmp] = expr [@a, @b; @c] = expr [@a, \ @b; @@ -195,3 +216,25 @@ endfor for [foo, bar] in expr endfor +# Scope dictionaries + +echo get(b:, 'foo', 42) +echo get(w:, 'foo', 42) +echo get(t:, 'foo', 42) +echo get(g:, 'foo', 42) +echo get(v:, 'foo', 42) + +for k in keys(b:) | echo b:[k] | endfor +for k in keys(w:) | echo w:[k] | endfor +for k in keys(t:) | echo t:[k] | endfor +for k in keys(g:) | echo g:[k] | endfor +for k in keys(v:) | echo v:[k] | endfor + +# Neovim-specific variables (not highlighted by default) + +echo v:lua v:msgpack_types v:relnum v:stderr v:termrequest v:virtnum + +echo &channel &inccommand &mousescroll &pumblend &redrawdebug &scrollback +echo &shada &shadafile &statuscolumn &termpastefilter &termsync &winbar +echo &winblend &winhighlight + diff --git a/runtime/syntax/testdir/input/vim_comment.vim b/runtime/syntax/testdir/input/vim_comment.vim index f382f8df..2ca67875 100644 --- a/runtime/syntax/testdir/input/vim_comment.vim +++ b/runtime/syntax/testdir/input/vim_comment.vim @@ -31,6 +31,10 @@ autocmd BufNewFile * { \ continuing comment \ continuing comment +let foo = 42 " commment + \ continuing comment + \ continuing comment + " :Foo \ arg1 "\ comment diff --git a/runtime/syntax/testdir/input/vim_ex_augroup.vim b/runtime/syntax/testdir/input/vim_ex_augroup.vim index 2dae59dd..7f7f3463 100644 --- a/runtime/syntax/testdir/input/vim_ex_augroup.vim +++ b/runtime/syntax/testdir/input/vim_ex_augroup.vim @@ -1,19 +1,62 @@ " Vim :augroup command +" VIM_TEST_SETUP let g:vimsyn_folding = "a" +" VIM_TEST_SETUP setl fdc=2 fdl=999 fdm=syntax +" VIM_TEST_SETUP highlight link vimAugroupName Todo + augroup foo - autocmd BufRead * echomsg "Foo" + autocmd! + autocmd BufRead * echo "Foo" augroup END -augroup foo | autocmd! | augroup END +augroup foo | autocmd! | augroup END augroup! foo augroup !@#$%^&*()_+ autocmd BufRead * echomsg "Foo" augroup END -augroup !@#$%^&*()_+ | autocmd! | augroup END +augroup !@#$%^&*()_+ | autocmd! | augroup END +augroup! !@#$%^&*()_+ + +augroup !@#$%^&*()_+ | autocmd! | augroup END augroup! !@#$%^&*()_+ +augroup no\|echo | autocmd! | augroup END +augroup! no\|echo + +augroup no\"echo | autocmd! | augroup END +augroup! no\"echo + +augroup \|echo\| | autocmd! | augroup END +augroup! \|echo\| + +augroup \"echo\" | autocmd! | augroup END +augroup! \"echo\" + +augroup \|\" | autocmd! | augroup END +augroup! \|\" + +augroup \"\| | autocmd! | augroup END +augroup! \"\| + + +augroup foo"comment + au! + au BufRead * echo "Foo" +augroup END"comment + +augroup foo|echo "Foo" + au! + au BufRead * echo "Foo" +augroup END|echo "Foo" + +augroup! foo"comment +augroup! foo|echo "Foo" + + " list groups augroup +augroup | echo "Foo" +augroup " comment diff --git a/runtime/syntax/testdir/input/vim_ex_autocmd.vim b/runtime/syntax/testdir/input/vim_ex_autocmd.vim new file mode 100644 index 00000000..162f9337 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_autocmd.vim @@ -0,0 +1,264 @@ +" Vim :autocmd command +" VIM_TEST_SETUP highlight vimAutoCmdGroup Todo +" VIM_TEST_SETUP highlight vimUserAutoEvent Title + + +" Define + +autocmd foogroup BufRead *.txt echo "Foo" | echo "Bar" +autocmd BufRead *.txt echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile *.txt echo "Foo" | echo "Bar" +autocmd User FooEvent *.txt echo "Foo" | echo "Bar" + +autocmd foogroup BufRead *.txt ++once echo "Foo" | echo "Bar" +autocmd BufRead *.txt ++once echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile *.txt ++once echo "Foo" | echo "Bar" +autocmd User FooEvent *.txt ++once echo "Foo" | echo "Bar" + +autocmd foogroup BufRead *.txt ++nested echo "Foo" | echo "Bar" +autocmd BufRead *.txt ++nested echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile *.txt ++nested echo "Foo" | echo "Bar" +autocmd User FooEvent *.txt ++nested echo "Foo" | echo "Bar" + +autocmd foogroup BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd User FooEvent *.txt ++once ++nested echo "Foo" | echo "Bar" + +autocmd foogroup BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd foogroup BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd foogroup BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile ++once ++nested echo "Foo" | echo "Bar" +autocmd User FooEvent ++once ++nested echo "Foo" | echo "Bar" +autocmd User FooEvent ++once ++nested echo "Foo" | echo "Bar" +autocmd User FooEvent ++once ++nested echo "Foo" | echo "Bar" + +autocmd foogroup BufRead foo ++once ++nested echo "Foo" | echo "Bar" + +autocmd BufRead *.txt { + echo "Foo" + echo "Bar" +} +autocmd BufRead,BufNewFile *.txt { + echo "Foo" + echo "Bar" +} +autocmd User FooEvent *.txt { + echo "Foo" + echo "Bar" +} +autocmd foogroup BufRead *.txt { + echo "Foo" + echo "Bar" +} + + +" Multiline {cmd} arg + +autocmd BufRead *.txt echo "Foo" + \| echo "Bar" + \| echo "Baz" + +autocmd BufRead *.txt echo "Foo" | + \ echo "Bar" | + \ echo "Baz" + +autocmd BufRead *.txt + "\ comment + \ echo "Foo" | + "\ comment + \ echo "Bar" + "\ comment + \| echo "Baz" + +autocmd BufRead,BufNewFile *.txt + "\ comment + \ echo "Foo" | + "\ comment + \ echo "Bar" + "\ comment + \| echo "Baz" +autocmd User FooEvent *.txt + "\ comment + \ echo "Foo" | + "\ comment + \ echo "Bar" + "\ comment + \| echo "Baz" +autocmd foogroup BufRead *.txt + "\ comment + \ echo "Foo" | + "\ comment + \ echo "Bar" + "\ comment + \| echo "Baz" + + +" Multiple patterns + +autocmd BufRead *.txt,*.vim,*.c echo "Foo" | echo "Bar" +autocmd BufRead ,*.vim,*.c echo "Foo" | echo "Bar" +autocmd BufRead *.txt,,*.c echo "Foo" | echo "Bar" +autocmd BufRead *.txt,*.vim, echo "Foo" | echo "Bar" + +autocmd BufRead ,, echo "Foo" | echo "Bar" + + +" FIXME: "BufRead" and "*" are valid group names, however, :help :augroup +" explicitly directs the user NOT to shadow event names with group names +autocmd BufRead BufRead *.txt ++once ++nested echo "Foo" +autocmd * BufRead *.txt ++once ++nested echo "Foo" + + +" Remove + +autocmd! foogroup BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd! BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd! foogroup User FooEvent *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd! User FooEvent *.txt ++once ++nested echo "Foo" | echo "Bar" + +autocmd! foogroup BufRead *.txt +autocmd! BufRead *.txt +autocmd! foogroup User FooEvent *.txt +autocmd! User FooEvent *.txt + +autocmd! foogroup * *.txt +autocmd! * *.txt + +autocmd! foogroup BufRead +autocmd! BufRead +autocmd! foogroup User FooEvent +autocmd! User FooEvent + +autocmd! foogroup +autocmd! + +" command -> bang -> group "!foogroup!" +autocmd!!foogroup! +" command -> bang -> group "foogroup" +autocmd!foogroup +" command -> bang -> event +autocmd!BufRead +" command -> bang -> user event +autocmd!User FooEvent + +" FIXME: "*" and "BufRead" are valid group names, however, :help :augroup +" explicitly directs the user NOT to shadow event names +" command -> group "*" -> event glob -> pattern +autocmd!* * *.txt +" command -> group "BufRead" -> event "BufRead" -> pattern +autocmd!BufRead BufRead *.txt + + +" List + +autocmd foogroup BufRead *.txt +autocmd BufRead *.txt +autocmd foogroup User FooEvent *.txt +autocmd User FooEvent *.txt + +autocmd foogroup * *.txt +autocmd * *.txt + +autocmd foogroup BufRead +autocmd BufRead +autocmd foogroup User FooEvent +autocmd User FooEvent + +autocmd foogroup +autocmd + + +" :doautoall + +doautoall BufRead + +doautoall BufRead *.txt +doautoall foogroup BufRead +doautoall BufRead + +doautoall foogroup BufRead *.txt + +doautoall User FooEvent + +doautoall User FooEvent *.txt +doautoall foogroup User FooEvent +doautoall User FooEvent + +doautoall foogroup User FooEvent *.txt + +doautoall foogroup BufRead *.txt | echo "Foo" +doautoall foogroup BufRead *.txt " comment + + +" :doautocmd + +doautocmd BufRead + +doautocmd BufRead *.txt +doautocmd foogroup BufRead +doautocmd BufRead + +doautocmd foogroup BufRead *.txt + +doautocmd User FooEvent + +doautocmd User FooEvent *.txt +doautocmd foogroup User FooEvent +doautocmd User FooEvent + +doautocmd foogroup User FooEvent *.txt + +doautocmd foogroup BufRead *.txt | echo "Foo" +doautocmd foogroup BufRead *.txt | " comment + + +" patterns + +au BufRead */*.txt + +au BufRead */*.* +au BufRead */*.??? +au BufRead */*.[t][x]t + +au BufRead */*.[a-z][a-z]t +au BufRead */*.[[:alpha:][:alpha:]]t + +au BufRead */*.[tx]\\\{2\}t +au BufRead */*.[a-z]\\\{2\}t +au BufRead */*.[[:alpha:]]\\\{2\}t +au BufRead */*.[^[:punct:]]\\\{2\}t + +au BufRead */*.[]]xt +au BufRead */*.[^]]xt + +au BufRead */*.[t\]]xt +au BufRead */*.[^t\]]xt + +au BufRead */*.[[]xt +au BufRead */*.[^[]xt + +au BufRead */*.[-]xt +au BufRead */*.[^-]xt + +au BufRead */*.[-t-]xt +au BufRead */*.[^-t-]xt + +au BufRead */*.[\^]xt +au BufRead */*.[^^]xt + +au BufRead */*.txt,*/*.vim +au BufRead */*.{txt,vim} +au BufRead */*.{t{x,t},v{i,m}} + +" literal +au BufRead */*.[]xt +au BufRead */*.[\]xt +au BufRead */*.[^]xt +au BufRead */*.[^\]xt + diff --git a/runtime/syntax/testdir/input/vim_ex_command.vim b/runtime/syntax/testdir/input/vim_ex_command.vim index 0873648c..4679b08e 100644 --- a/runtime/syntax/testdir/input/vim_ex_command.vim +++ b/runtime/syntax/testdir/input/vim_ex_command.vim @@ -1,4 +1,6 @@ " Vim :command, :delcommand and :comclear commands +" VIM_TEST_SETUP highlight link vimUserCmdName Todo +" VIM_TEST_SETUP highlight link vimDelcommandName Todo " list @@ -6,10 +8,12 @@ command command F + " define command Foo echo "Foo" command! Foo echo "Foo" + command! Foo echo "Foo" | echo "Bar" command! Foo { @@ -18,11 +22,27 @@ command! Foo { echo "Baz" } +command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo echo "Foo" + +command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo + \ echo "Foo" + +command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register + \ Foo + \ echo "Foo" + command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo + "\ comment \ echo "Foo" -command! -complete=custom,Completer1 Foo echo "Foo" -command! -complete=customlist,Completer2 Foo echo "Foo" +command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register + "\ comment + \ Foo + "\ comment + \ echo "Foo" + +command! -complete=custom,s:Completer1 Foo echo "Foo" +command! -complete=customlist,s:Completer2 Foo echo "Foo" function Foo() command! Foo echo "Foo (defined in :function)" @@ -32,43 +52,93 @@ def Foo2() command! Foo echo "Foo (defined in :def)" enddef + " multiline define -" command! -" \ -addr=lines -" \ -bang -" \ -bar -" \ -buffer -" \ -complete=buffer -" \ -count -" \ -nargs=* -" \ -range -" \ -register -" \ -keepscript -" \ Foo -" \ echo "FOO" +command! -addr=lines + \ -bang + \ -bar + \ -buffer + \ -complete=buffer + \ -count + \ -nargs=* + \ -range + \ -register + \ -keepscript + \ Foo + \ echo "Foo" | + \ echo "Bar" + +command! + \ -addr=lines + \ -bang + \ -bar + \ -buffer + \ -complete=buffer + \ -count + \ -nargs=* + \ -range + \ -register + \ -keepscript + \ Foo + \ echo "Foo" | + \ echo "Bar" + +command! + "\ comment + \ -addr=lines + \ -bang + "\ comment + "\ comment + \ -bar + \ -buffer + "\ comment + \ -complete=buffer + "\ comment + \ -count + "\ comment + \ -nargs=* + "\ comment + \ -range + "\ comment + \ -register + "\ comment + \ -keepscript + "\ comment + \ Foo + "\ comment + \ echo "Foo" | + "\ comment + \ echo "Bar" + " errors command! -badattr=arguments -bang -badattr -nargs=* Foo echo "Foo" + " delete delcommand Foo delcommand -buffer Foo -delcommand Foo | echo "..." -delcommand -buffer Foo | echo "..." +delcommand Foo | echo "Foo" +delcommand -buffer Foo | echo "Foo" delcommand Foo " comment delcommand -buffer Foo " comment comclear comclear " comment -comclear | echo "..." +comclear | echo "Foo" -" Issue #14135 +" Issue #14135 (vim.vim syntax highlighting broken wrt system()) com Foo call system('ls') + +" Issue #17001 (Wrong vimUserCmdAttrError highlighting in vim.vim) + +command! -bang -nargs=* -complete=file Make AsyncRun -program=make @ + diff --git a/runtime/syntax/testdir/input/vim_ex_def.vim b/runtime/syntax/testdir/input/vim_ex_def.vim index d379d8f4..819a1ada 100644 --- a/runtime/syntax/testdir/input/vim_ex_def.vim +++ b/runtime/syntax/testdir/input/vim_ex_def.vim @@ -99,7 +99,7 @@ def Foo( z: string = "zed") enddef -" Issue #16243 (vimscript def parameters syntax highlight is wrong) +" Issue #16243 (Vim script def parameters syntax highlight is wrong) def Test(lines: list = [line('.'), line('.')]): void enddef diff --git a/runtime/syntax/testdir/input/vim_ex_def_return_type.vim b/runtime/syntax/testdir/input/vim_ex_def_return_type.vim new file mode 100644 index 00000000..af88721f --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_def_return_type.vim @@ -0,0 +1,60 @@ +vim9script +# Vim9 function return types +# VIM_TEST_SETUP hi link vimUserType Todo + + +# Issue #14442 (vim.vim: confusion for function return types starting on another line) + +def TestA______________________________________________________________(): + \ void +enddef + +def TestB____(result: dict>, fs: list): + \ void +enddef + +def TestC____(maybe: bool, F: func(): dict): func(): + \ void + return () => { + } +enddef + +def TestD____(fs: list>): func(): func(): + \ void + return () => () => { + } +enddef + +class Tests + def TestA__________________________________________________________(): + \ void + enddef + + def TestB(result: dict>, fs: list): + \ void + enddef + + def TestC(maybe: bool, F: func(): dict): func(): + \ void + return () => { + } + enddef + + def TestD(fs: list>): func(): func(): + \ void + return () => () => { + } + enddef +endclass + +def F(G: func(number, number, number): lib.Trampoline): + \ func(number, number, number): + \ func(): lib.Trampoline + return ((H: func(number, number, number): lib.Trampoline) => + (a1: number, a2: number, n: number) => + () => + H(a2, (a1 + a2), (n - 1)))(G) +enddef + +defcompile + diff --git a/runtime/syntax/testdir/input/vim_ex_filter.vim b/runtime/syntax/testdir/input/vim_ex_filter.vim new file mode 100644 index 00000000..baf28a1e --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_filter.vim @@ -0,0 +1,13 @@ +" Vim :filter command +" VIM_TEST_SETUP highlight link vimCmdSep Operator + + +filter pa\%(tt\)ern oldfiles +filter! pa\%(tt\)ern oldfiles + +filter /pa\%(tt\)ern/ oldfiles +filter! /pa\%(tt\)ern/ oldfiles + +filter /pa\%(t|t\)ern/ oldfiles | echo "Foo" +filter! /pa\%(t|t\)ern/ oldfiles | echo "Foo" + diff --git a/runtime/syntax/testdir/input/vim_ex_function.vim b/runtime/syntax/testdir/input/vim_ex_function.vim index 1b781913..95cf4586 100644 --- a/runtime/syntax/testdir/input/vim_ex_function.vim +++ b/runtime/syntax/testdir/input/vim_ex_function.vim @@ -163,7 +163,21 @@ function Foo( return 42 endfunction -" Issue #16243 (vimscript def parameters syntax highlight is wrong) + +" arguments + +function Foo(a, b, c) + echo a:a a:b a:c +endfunction + +function Foo(...) + echo a:000 + echo a:0 + echo a:1 a:2 a:3 a:4 a:5 a:6 a:7 a:8 a:9 a:10 a:11 a:12 a:13 a:14 a:15 a:16 a:17 a:18 a:19 a:20 +endfunction + + +" Issue #16243 (Vim script def parameters syntax highlight is wrong) function Test(lines = [line('.'), line('.')]) endfunction diff --git a/runtime/syntax/testdir/input/vim_ex_function_fold.vim b/runtime/syntax/testdir/input/vim_ex_function_fold.vim index bd0cf610..1be9c258 100644 --- a/runtime/syntax/testdir/input/vim_ex_function_fold.vim +++ b/runtime/syntax/testdir/input/vim_ex_function_fold.vim @@ -166,6 +166,19 @@ function Foo( endfunction +" arguments + +function Foo(a, b, c) + echo a:a a:b a:c +endfunction + +function Foo(...) + echo a:000 + echo a:0 + echo a:1 a:2 a:3 a:4 a:5 a:6 a:7 a:8 a:9 a:10 a:11 a:12 a:13 a:14 a:15 a:16 a:17 a:18 a:19 a:20 +endfunction + + " comments function Foo() diff --git a/runtime/syntax/testdir/input/vim_ex_grep.vim b/runtime/syntax/testdir/input/vim_ex_grep.vim new file mode 100644 index 00000000..234f2d96 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_grep.vim @@ -0,0 +1,47 @@ +" Vim :*grep and :*grepadd commands +" VIM_TEST_SETUP hi link vimCmdSep Operator +" VIM_TEST_SETUP hi link vimGrepBarEscape Special + + +grep 'pat\|tern' foo.txt +lgrep 'pat\|tern' foo.txt + +grep! 'pat\|tern' foo.txt +lgrep! 'pat\|tern' foo.txt + +grepadd 'pat\|tern' foo.txt +lgrepadd 'pat\|tern' foo.txt + +grepadd! 'pat\|tern' foo.txt +lgrepadd! 'pat\|tern' foo.txt + + +" special filename characters + +grep 'pat\|tern' % +lgrep 'pat\|tern' % + +grep! 'pat\|tern' % +lgrep! 'pat\|tern' % + +grepadd! 'pat\|tern' % +lgrepadd! 'pat\|tern' % + +grepadd! 'pat\|tern' % +lgrepadd! 'pat\|tern' % + + +" trailing bar, no tail comment + +grep 'pat\|tern' foo.txt | echo "Foo" +lgrep 'pat\|tern' foo.txt | echo "Foo" + +grep! 'pat\|tern' foo.txt | echo "Foo" +lgrep! 'pat\|tern' foo.txt | echo "Foo" + +grepadd 'pat\|tern' foo.txt | echo "Foo" +lgrepadd 'pat\|tern' foo.txt | echo "Foo" + +grepadd! 'pat\|tern' foo.txt | echo "Foo" +lgrepadd! 'pat\|tern' foo.txt | echo "Foo" + diff --git a/runtime/syntax/testdir/input/vim_ex_helpgrep.vim b/runtime/syntax/testdir/input/vim_ex_helpgrep.vim new file mode 100644 index 00000000..aeef4501 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_helpgrep.vim @@ -0,0 +1,11 @@ +" Vim :helpgrep command + + +helpgrep :help +helpgrep :help@en +helpgrep :h\%(elp\)\= + +lhelpgrep :help +lhelpgrep :help@en +lhelpgrep :h\%(elp\)\= + diff --git a/runtime/syntax/testdir/input/vim_ex_make.vim b/runtime/syntax/testdir/input/vim_ex_make.vim new file mode 100644 index 00000000..7ce87f2e --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_make.vim @@ -0,0 +1,38 @@ +" Vim :*make commands +" VIM_TEST_SETUP highlight link vimCmdSep Operator +" VIM_TEST_SETUP highlight link vimMakeBarEscape Special + + +make +lmake + +make! +lmake! + +make -options target +lmake -options target + +make! -options target +lmake! -options target + + +" special filename characters + +make % +lmake % + + +" trailing bar, no tail comment + +make tar\|get | echo "Foo" +lmake tar\|get | echo "Foo" + +make! tar\|get | echo "Foo" +lmake! tar\|get | echo "Foo" + +make | echo "Foo" +lmake | echo "Foo" + +make! | echo "Foo" +lmake! | echo "Foo" + diff --git a/runtime/syntax/testdir/input/vim_ex_map.vim b/runtime/syntax/testdir/input/vim_ex_map.vim index 3ddc9e9a..5d469b2c 100644 --- a/runtime/syntax/testdir/input/vim_ex_map.vim +++ b/runtime/syntax/testdir/input/vim_ex_map.vim @@ -5,6 +5,20 @@ map! lhs rhs map map lhs rhs +map