diff options
| author | bh <qn+git@excalibur.computer> | 2026-04-09 15:46:00 +0800 |
|---|---|---|
| committer | bh <qn+git@excalibur.computer> | 2026-04-09 15:46:00 +0800 |
| commit | 6c81e38e15455fb3074d9d46c94ec2c951b5a382 (patch) | |
| tree | c103a81c733ff200b4114f3a1caee058c10f374e /lua/config/luasnip.lua | |
| parent | 0a67a5614c1716c8ccf46980e13826616aa70c28 (diff) | |
Fix indentation
Diffstat (limited to 'lua/config/luasnip.lua')
| -rw-r--r-- | lua/config/luasnip.lua | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/lua/config/luasnip.lua b/lua/config/luasnip.lua index 4524322..1dbc039 100644 --- a/lua/config/luasnip.lua +++ b/lua/config/luasnip.lua @@ -1,36 +1,36 @@ -- Return a function so we can call it from Lazy.nvim return function() - local ls = require("luasnip") + local ls = require("luasnip") - -- Load snippets from friendly-snippets - require("luasnip.loaders.from_vscode").lazy_load() + -- Load snippets from friendly-snippets + require("luasnip.loaders.from_vscode").lazy_load() - -- Example Lua snippets - ls.add_snippets("lua", { - ls.parser.parse_snippet("hi", "print('Hello, world!')"), - ls.parser.parse_snippet("fn", "function ${1:name}(${2:args})\n\t$0\nend"), - }) + -- Example Lua snippets + ls.add_snippets("lua", { + ls.parser.parse_snippet("hi", "print('Hello, world!')"), + ls.parser.parse_snippet("fn", "function ${1:name}(${2:args})\n\t$0\nend"), + }) - local opts = { silent = true, noremap = true } + local opts = { silent = true, noremap = true } - -- Expand snippet or jump forward - vim.keymap.set({ "i", "s" }, "<C-k>", function() - if ls.expand_or_jumpable() then - ls.expand_or_jump() - end - end, opts) + -- Expand snippet or jump forward + vim.keymap.set({ "i", "s" }, "<C-k>", function() + if ls.expand_or_jumpable() then + ls.expand_or_jump() + end + end, opts) - -- Jump backward - vim.keymap.set({ "i", "s" }, "<C-j>", function() - if ls.jumpable(-1) then - ls.jump(-1) - end - end, opts) + -- Jump backward + vim.keymap.set({ "i", "s" }, "<C-j>", function() + if ls.jumpable(-1) then + ls.jump(-1) + end + end, opts) - -- Change choice in choice node - vim.keymap.set({ "i", "s" }, "<C-l>", function() - if ls.choice_active() then - ls.change_choice(1) - end - end, opts) + -- Change choice in choice node + vim.keymap.set({ "i", "s" }, "<C-l>", function() + if ls.choice_active() then + ls.change_choice(1) + end + end, opts) end |
