diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-07 16:48:18 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-07 17:26:26 +0200 |
| commit | 7cb95de38967a3d2dd403ede97213ae5b22d630d (patch) | |
| tree | ea00504d844cfbea71f90a3fc3747cf9da8f4043 /.config/nvim/after/ftplugin/lua.lua | |
| parent | ffe7a3aa865b81b1876e4968b60aa7ca79d3cc84 (diff) | |
| download | dotfiles-7cb95de38967a3d2dd403ede97213ae5b22d630d.tar.gz dotfiles-7cb95de38967a3d2dd403ede97213ae5b22d630d.zip | |
feat(nvim): support custom snippets
Diffstat (limited to '.config/nvim/after/ftplugin/lua.lua')
| -rw-r--r-- | .config/nvim/after/ftplugin/lua.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/.config/nvim/after/ftplugin/lua.lua b/.config/nvim/after/ftplugin/lua.lua index 05e4978..b7d29c1 100644 --- a/.config/nvim/after/ftplugin/lua.lua +++ b/.config/nvim/after/ftplugin/lua.lua @@ -28,7 +28,18 @@ vim.opt_local.textwidth = vim.g.dotfiles.textwidth.lua -- gw wraps at this value vim.opt_local.colorcolumn = "+1" -- Highlight one column after 'textwidth' vim.opt_local.complete = { "o", -- 'omnifunc' + "F", -- 'completefunc' (snippet source, see plugin/50-completion.lua) } vim.b.autoformat = true vim.b.format_func = format + +------------------------------------------------------------------------------------------------------------------------ +-- Snippets +------------------------------------------------------------------------------------------------------------------------ +-- Trigger word -> LSP snippet body. `$1` mirrors the `${1:X}` placeholder, so the variable is typed once. +-- Surfaced in the completion menu via the "F" source in 'complete' above (see plugin/50-completion.lua). +vim.b.snippets = { + ["debug_print"] = 'vim.print("${1:X} = " .. vim.inspect($1))', +} +vim.bo.completefunc = "v:lua.dotfiles_snippet_source" |
