Skip to content

Commit da4e433

Browse files
committed
runtime(doc): document vim-script library function
Signed-off-by: Christian Brabandt <[email protected]>
1 parent b2a4c11 commit da4e433

4 files changed

Lines changed: 57 additions & 4 deletions

File tree

runtime/doc/eval.txt

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 9.0. Last change: 2023 Jun 01
1+
*eval.txt* For Vim version 9.0. Last change: 2023 Nov 05
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -36,6 +36,7 @@ a remark is given.
3636
11. No +eval feature |no-eval-feature|
3737
12. The sandbox |eval-sandbox|
3838
13. Textlock |textlock|
39+
14. Vim script library |vim-script-library|
3940

4041
Testing support is documented in |testing.txt|.
4142
Profiling is documented at |profiling|.
@@ -4801,5 +4802,37 @@ This is not allowed when the textlock is active:
48014802
- closing a window or quitting Vim
48024803
- etc.
48034804

4805+
==============================================================================
4806+
14. Vim script library *vim-script-library*
4807+
4808+
Vim comes bundled with a Vim script library, that can be used by runtime,
4809+
script authors. Currently, it only includes very few functions, but it may
4810+
grow over time.
4811+
4812+
The functions are available as |Vim9-script| as well as using legacy vim
4813+
script (to be used for non Vim 9.0 versions and Neovim).
4814+
4815+
*dist#vim* *dist#vim9*
4816+
The functions make use of the autoloaded prefix "dist#vim" (for legacy Vim script and
4817+
Neovim) and "dist#vim9" for Vim9 script.
4818+
4819+
The following functions are available:
4820+
4821+
dist#vim#IsSafeExecutable(filetype, executable) ~
4822+
dist#vim9#IsSafeExecutable(filetype:string, executable:string): bool ~
4823+
4824+
This function takes a filetype and an executable and checks whether it is safe
4825+
to execute the given executable. For security reasons users may not want to
4826+
have Vim execute random executables or may have forbidden to do so for
4827+
specific filetypes by setting the "<filetype>_exec" variable (|plugin_exec|).
4828+
4829+
It returns |true| or |false| to indicate whether the plugin should run the given
4830+
exectuable. It takes the following arguments:
4831+
4832+
argument type ~
4833+
4834+
filetype string
4835+
executable string
4836+
48044837

48054838
vim:tw=78:ts=8:noet:ft=help:norl:

runtime/doc/pi_gzip.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*pi_gzip.txt* For Vim version 9.0. Last change: 2019 May 05
1+
*pi_gzip.txt* For Vim version 9.0. Last change: 2023 Nov 05
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -12,9 +12,17 @@ The functionality mentioned here is a |standard-plugin|.
1212
This plugin is only available if 'compatible' is not set.
1313
You can avoid loading this plugin by setting the "loaded_gzip" variable: >
1414
:let loaded_gzip = 1
15+
<
16+
*g:gzip_exec*
17+
18+
For security reasons, one may prevent that Vim runs executables automatically
19+
when opening a buffer. This option (default: "1") can be used to prevent
20+
executing the executables command when set to "0": >
21+
:let g:gzip_exec = 0
22+
<
1523

1624
==============================================================================
17-
1. Autocommands *gzip-autocmd*
25+
2. Autocommands *gzip-autocmd*
1826

1927
The plugin installs autocommands to intercept reading and writing of files
2028
with these extensions:

runtime/doc/pi_zip.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*pi_zip.txt* For Vim version 9.0. Last change: 2023 Mar 12
1+
*pi_zip.txt* For Vim version 9.0. Last change: 2023 Nov 05
22

33
+====================+
44
| Zip File Interface |
@@ -69,6 +69,13 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
6969
This option specifies the program (and any options needed) used to
7070
extract a file from a zip archive. By default, >
7171
let g:zip_extractcmd= g:zip_unzipcmd
72+
<
73+
*g:zip_exec*
74+
For security reasons, one may prevent that Vim runs executables
75+
automatically when opening a buffer. This option (default: "1")
76+
can be used to prevent executing the "unzip" command when set to
77+
"0": >
78+
let g:zip_exec=0
7279
<
7380
PREVENTING LOADING~
7481

runtime/doc/tags

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6758,6 +6758,8 @@ dircolors.vim syntax.txt /*dircolors.vim*
67586758
dis motion.txt /*dis*
67596759
disable-menus gui.txt /*disable-menus*
67606760
discard editing.txt /*discard*
6761+
dist#vim eval.txt /*dist#vim*
6762+
dist#vim9 eval.txt /*dist#vim9*
67616763
distribute-script usr_51.txt /*distribute-script*
67626764
distributed-plugins usr_05.txt /*distributed-plugins*
67636765
distribution intro.txt /*distribution*
@@ -7422,6 +7424,7 @@ g:gnat.Project_File ft_ada.txt /*g:gnat.Project_File*
74227424
g:gnat.Set_Project_File() ft_ada.txt /*g:gnat.Set_Project_File()*
74237425
g:gnat.Tags() ft_ada.txt /*g:gnat.Tags()*
74247426
g:gnat.Tags_Command ft_ada.txt /*g:gnat.Tags_Command*
7427+
g:gzip_exec pi_gzip.txt /*g:gzip_exec*
74257428
g:html_charset_override syntax.txt /*g:html_charset_override*
74267429
g:html_diff_one_file syntax.txt /*g:html_diff_one_file*
74277430
g:html_dynamic_folds syntax.txt /*g:html_dynamic_folds*
@@ -7616,6 +7619,7 @@ g:vimsyn_minlines syntax.txt /*g:vimsyn_minlines*
76167619
g:vimsyn_noerror syntax.txt /*g:vimsyn_noerror*
76177620
g:yaml_schema syntax.txt /*g:yaml_schema*
76187621
g:zipPlugin_ext pi_zip.txt /*g:zipPlugin_ext*
7622+
g:zip_exec pi_zip.txt /*g:zip_exec*
76197623
g:zip_extractcmd pi_zip.txt /*g:zip_extractcmd*
76207624
g:zip_nomax pi_zip.txt /*g:zip_nomax*
76217625
g:zip_shq pi_zip.txt /*g:zip_shq*
@@ -10987,6 +10991,7 @@ vim-modes intro.txt /*vim-modes*
1098710991
vim-modes-intro intro.txt /*vim-modes-intro*
1098810992
vim-raku ft_raku.txt /*vim-raku*
1098910993
vim-script-intro usr_41.txt /*vim-script-intro*
10994+
vim-script-library eval.txt /*vim-script-library*
1099010995
vim-use intro.txt /*vim-use*
1099110996
vim-variable eval.txt /*vim-variable*
1099210997
vim.b if_lua.txt /*vim.b*

0 commit comments

Comments
 (0)