summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2023-11-05 10:45:12 +0100
committerChristian Brabandt <cb@256bit.org>2023-11-05 10:45:49 +0100
commitda4e433dc3bee7fa521df3c7235d49a6732134ef (patch)
tree5eb77e021412749ea1d28f7681679fda2a331b4e /runtime
parentb2a4c110a5d13bc794f4eddb2e88a4e8fe9dfbea (diff)
runtime(doc): document vim-script library function
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt35
-rw-r--r--runtime/doc/pi_gzip.txt12
-rw-r--r--runtime/doc/pi_zip.txt9
-rw-r--r--runtime/doc/tags5
4 files changed, 57 insertions, 4 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index e7152bb670..c91145ce73 100644
--- 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 @@ a remark is given.
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 active:
- 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 "<filetype>_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
index e5d5ffb25f..c5d8ab0d84 100644
--- 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 |standard-plugin|.
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
index 8673324e11..14ae340155 100644
--- 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 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
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
index fde5bda1a4..f450288fd8 100644
--- 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.Project_File*
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_minlines*
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*