vim.snippet.jump({direction}) *vim.snippet.jump()*
Jumps to the next (or previous) placeholder in the current snippet, if
possible.
By default `<Tab>` is setup to jump if a snippet is active. The default
mapping looks like: >lua
vim.keymap.set({ 'i', 's' }, '<Tab>', function()
if vim.snippet.active({ direction = 1 }) then
return '<Cmd>lua vim.snippet.jump(1)<CR>'
else
return '<Tab>'
end
end, { descr = '...', expr = true, silent = true })
<
Parameters: ~
• {direction} (`vim.snippet.Direction`) Navigation direction. -1 for
previous, 1 for next.
vim.snippet.stop() *vim.snippet.stop()*
Exits the current snippet.
==============================================================================
Lua module: vim.text *vim.text*
vim.text.hexdecode({enc}) *vim.text.hexdecode()*
Hex decode a string.
Parameters: ~
• {enc} (`string`) String to decode
Return (multiple): ~
(`string?`) Decoded string
(`string?`) Error message, if any
vim.text.hexencode({str}) *vim.text.hexencode()*
Hex encode a string.
Parameters: ~
• {str} (`string`) String to encode
Return: ~
(`string`) Hex encoded string
vim.text.indent({size}, {text}, {opts}) *vim.text.indent()*
Sets the indent (i.e. the common leading whitespace) of non-empty lines in
`text` to `size` spaces/tabs.
Indent is calculated by number of consecutive indent chars.
• The first indented, non-empty line decides the indent char (space/tab):
• `SPC SPC TAB …` = two-space indent.
• `TAB SPC …` = one-tab indent.
• Set `opts.expandtab` to treat tabs as spaces.
To "dedent" (remove the common indent), pass `size=0`: >lua
vim.print(vim.text.indent(0, ' a\n b\n'))
<
To adjust relative-to an existing indent, call indent() twice: >lua
local indented, old_indent