# HG changeset patch # User Christian Brabandt # Date 1699178403 -3600 # Node ID d7ac49e53d62861910298186231ccb9f295eaae5 # Parent 954e03e17c58eb5570b6bddbbf61c08cb300531c runtime(doc): document vim-script library function Commit: https://github.com/vim/vim/commit/da4e433dc3bee7fa521df3c7235d49a6732134ef Author: Christian Brabandt Date: Sun Nov 5 10:45:12 2023 +0100 runtime(doc): document vim-script library function Signed-off-by: Christian Brabandt diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 9.0. Last change: 2023 Jun 01 +*eval.txt* For Vim version 9.0. Last change: 2023 Nov 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -36,6 +36,7 @@ 10. Vim script version |vimscript-versi 11. No +eval feature |no-eval-feature| 12. The sandbox |eval-sandbox| 13. Textlock |textlock| +14. Vim script library |vim-script-library| Testing support is documented in |testing.txt|. Profiling is documented at |profiling|. @@ -4801,5 +4802,37 @@ This is not allowed when the textlock is - closing a window or quitting Vim - etc. +============================================================================== +14. Vim script library *vim-script-library* + +Vim comes bundled with a Vim script library, that can be used by runtime, +script authors. Currently, it only includes very few functions, but it may +grow over time. + +The functions are available as |Vim9-script| as well as using legacy vim +script (to be used for non Vim 9.0 versions and Neovim). + + *dist#vim* *dist#vim9* +The functions make use of the autoloaded prefix "dist#vim" (for legacy Vim script and +Neovim) and "dist#vim9" for Vim9 script. + +The following functions are available: + +dist#vim#IsSafeExecutable(filetype, executable) ~ +dist#vim9#IsSafeExecutable(filetype:string, executable:string): bool ~ + +This function takes a filetype and an executable and checks whether it is safe +to execute the given executable. For security reasons users may not want to +have Vim execute random executables or may have forbidden to do so for +specific filetypes by setting the "_exec" variable (|plugin_exec|). + +It returns |true| or |false| to indicate whether the plugin should run the given +exectuable. It takes the following arguments: + + argument type ~ + + filetype string + executable string + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/pi_gzip.txt b/runtime/doc/pi_gzip.txt --- a/runtime/doc/pi_gzip.txt +++ b/runtime/doc/pi_gzip.txt @@ -1,4 +1,4 @@ -*pi_gzip.txt* For Vim version 9.0. Last change: 2019 May 05 +*pi_gzip.txt* For Vim version 9.0. Last change: 2023 Nov 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -12,9 +12,17 @@ The functionality mentioned here is a |s This plugin is only available if 'compatible' is not set. You can avoid loading this plugin by setting the "loaded_gzip" variable: > :let loaded_gzip = 1 +< + *g:gzip_exec* + +For security reasons, one may prevent that Vim runs executables automatically +when opening a buffer. This option (default: "1") can be used to prevent +executing the executables command when set to "0": > + :let g:gzip_exec = 0 +< ============================================================================== -1. Autocommands *gzip-autocmd* +2. Autocommands *gzip-autocmd* The plugin installs autocommands to intercept reading and writing of files with these extensions: diff --git a/runtime/doc/pi_zip.txt b/runtime/doc/pi_zip.txt --- a/runtime/doc/pi_zip.txt +++ b/runtime/doc/pi_zip.txt @@ -1,4 +1,4 @@ -*pi_zip.txt* For Vim version 9.0. Last change: 2023 Mar 12 +*pi_zip.txt* For Vim version 9.0. Last change: 2023 Nov 05 +====================+ | Zip File Interface | @@ -70,6 +70,13 @@ 2. Usage *zip-usage* *zip-manual* extract a file from a zip archive. By default, > let g:zip_extractcmd= g:zip_unzipcmd < + *g:zip_exec* + For security reasons, one may prevent that Vim runs executables + automatically when opening a buffer. This option (default: "1") + can be used to prevent executing the "unzip" command when set to + "0": > + let g:zip_exec=0 +< PREVENTING LOADING~ If for some reason you do not wish to use vim to examine zipped files, diff --git a/runtime/doc/tags b/runtime/doc/tags --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -6758,6 +6758,8 @@ dircolors.vim syntax.txt /*dircolors.vim dis motion.txt /*dis* disable-menus gui.txt /*disable-menus* discard editing.txt /*discard* +dist#vim eval.txt /*dist#vim* +dist#vim9 eval.txt /*dist#vim9* distribute-script usr_51.txt /*distribute-script* distributed-plugins usr_05.txt /*distributed-plugins* distribution intro.txt /*distribution* @@ -7422,6 +7424,7 @@ g:gnat.Project_File ft_ada.txt /*g:gnat. g:gnat.Set_Project_File() ft_ada.txt /*g:gnat.Set_Project_File()* g:gnat.Tags() ft_ada.txt /*g:gnat.Tags()* g:gnat.Tags_Command ft_ada.txt /*g:gnat.Tags_Command* +g:gzip_exec pi_gzip.txt /*g:gzip_exec* g:html_charset_override syntax.txt /*g:html_charset_override* g:html_diff_one_file syntax.txt /*g:html_diff_one_file* g:html_dynamic_folds syntax.txt /*g:html_dynamic_folds* @@ -7616,6 +7619,7 @@ g:vimsyn_minlines syntax.txt /*g:vimsyn_ g:vimsyn_noerror syntax.txt /*g:vimsyn_noerror* g:yaml_schema syntax.txt /*g:yaml_schema* g:zipPlugin_ext pi_zip.txt /*g:zipPlugin_ext* +g:zip_exec pi_zip.txt /*g:zip_exec* g:zip_extractcmd pi_zip.txt /*g:zip_extractcmd* g:zip_nomax pi_zip.txt /*g:zip_nomax* g:zip_shq pi_zip.txt /*g:zip_shq* @@ -10987,6 +10991,7 @@ vim-modes intro.txt /*vim-modes* 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-use intro.txt /*vim-use* vim-variable eval.txt /*vim-variable* vim.b if_lua.txt /*vim.b*