comparison runtime/doc/if_lua.txt @ 16553:0e473e9e70c2 v8.1.1280

patch 8.1.1280: remarks about functionality not in Vi clutters the help commit https://github.com/vim/vim/commit/25c9c680ec4dfbb51f4ef21c3460a48d3c67ffc8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 5 18:13:34 2019 +0200 patch 8.1.1280: remarks about functionality not in Vi clutters the help Problem: Remarks about functionality not in Vi clutters the help. Solution: Move all info about what is new in Vim or already existed in Vi to vi_diff.txt. Remove {not in Vi} remarks. (closes #4268) Add "noet" to the help files modeline. Also include many other help file improvements.
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 May 2019 18:15:06 +0200
parents a2f0e93a5857
children 2704c4e3e20a
comparison
equal deleted inserted replaced
16552:deb3d4f5be8b 16553:0e473e9e70c2
1 *if_lua.txt* For Vim version 8.1. Last change: 2015 Oct 16 1 *if_lua.txt* For Vim version 8.1. Last change: 2019 May 05
2 2
3 3
4 VIM REFERENCE MANUAL by Luis Carvalho 4 VIM REFERENCE MANUAL by Luis Carvalho
5 5
6 6
15 7. Buffer userdata |lua-buffer| 15 7. Buffer userdata |lua-buffer|
16 8. Window userdata |lua-window| 16 8. Window userdata |lua-window|
17 9. luaeval() Vim function |lua-luaeval| 17 9. luaeval() Vim function |lua-luaeval|
18 10. Dynamic loading |lua-dynamic| 18 10. Dynamic loading |lua-dynamic|
19 19
20 {Vi does not have any of these commands} 20 {only available when Vim was compiled with the |+lua| feature}
21
22 The Lua interface is available only when Vim was compiled with the
23 |+lua| feature.
24 21
25 ============================================================================== 22 ==============================================================================
26 1. Commands *lua-commands* 23 1. Commands *lua-commands*
27 24
28 *:lua* 25 *:lua*
29 :[range]lua {chunk} 26 :[range]lua {chunk}
30 Execute Lua chunk {chunk}. {not in Vi} 27 Execute Lua chunk {chunk}.
31 28
32 Examples: 29 Examples:
33 > 30 >
34 :lua print("Hello, Vim!") 31 :lua print("Hello, Vim!")
35 :lua local curbuf = vim.buffer() curbuf[7] = "line #7" 32 :lua local curbuf = vim.buffer() curbuf[7] = "line #7"
36 < 33 <
37 34
38 :[range]lua << {endmarker} 35 :[range]lua << {endmarker}
39 {script} 36 {script}
40 {endmarker} 37 {endmarker}
41 Execute Lua script {script}. {not in Vi} 38 Execute Lua script {script}.
42 Note: This command doesn't work when the Lua 39 Note: This command doesn't work when the Lua
43 feature wasn't compiled in. To avoid errors, see 40 feature wasn't compiled in. To avoid errors, see
44 |script-here|. 41 |script-here|.
45 42
46 {endmarker} must NOT be preceded by any white space. If {endmarker} is 43 {endmarker} must NOT be preceded by any white space. If {endmarker} is
73 argument being set to the text of each line in turn, 70 argument being set to the text of each line in turn,
74 without a trailing <EOL>, and the current line number. 71 without a trailing <EOL>, and the current line number.
75 If the value returned by the function is a string it 72 If the value returned by the function is a string it
76 becomes the text of the line in the current turn. The 73 becomes the text of the line in the current turn. The
77 default for [range] is the whole file: "1,$". 74 default for [range] is the whole file: "1,$".
78 {not in Vi}
79 75
80 Examples: 76 Examples:
81 > 77 >
82 :luado return string.format("%s\t%d", line:reverse(), #line) 78 :luado return string.format("%s\t%d", line:reverse(), #line)
83 79
87 :luado if bp:match(line) then return "-->\t" .. line end 83 :luado if bp:match(line) then return "-->\t" .. line end
88 < 84 <
89 85
90 *:luafile* 86 *:luafile*
91 :[range]luafile {file} 87 :[range]luafile {file}
92 Execute Lua script in {file}. {not in Vi} 88 Execute Lua script in {file}.
93 The whole argument is used as a single file name. 89 The whole argument is used as a single file name.
94 90
95 Examples: 91 Examples:
96 > 92 >
97 :luafile script.lua 93 :luafile script.lua