mirror of
https://github.com/nanotee/nvim-lua-guide
synced 2024-11-15 06:13:00 +00:00
add :lua =expr
example
This commit is contained in:
parent
358b6b4273
commit
5f18514d21
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user