add :lua =expr example

This commit is contained in:
Timothée Sterle 2022-01-04 21:04:33 +01:00
parent 358b6b4273
commit 5f18514d21
No known key found for this signature in database
GPG Key ID: 136D558122196ED5
2 changed files with 9 additions and 0 deletions

View File

@ -432,6 +432,10 @@ put({1, 2, 3})
:lua put(vim.loop)
```
Alternatively, you can use the `:lua` command to pretty-print a Lua expression by prefixing it with `=` (Neovim 0.7+ only):
```lua
:lua =vim.loop
```
Additionally, you may find that built-in Lua functions are sometimes lacking compared to what you would find in other languages (for example `os.clock()` only returns a value in seconds, not milliseconds). Be sure to look at the Neovim stdlib (and `vim.fn`, more on that later), it probably has what you're looking for.

View File

@ -528,6 +528,11 @@ or from the command-line:
:lua put(vim.loop)
<
Alternatively, you can use the `:lua` command to pretty-print a Lua
expression by prefixing it with `=` (Neovim 0.7+ only):
>
:lua =vim.loop
<
Additionally, you may find that built-in Lua functions are sometimes
lacking compared to what you would find in other languages (for example