From 01a09f243ce07d367c539d69d4a7f4541ab1dcd7 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sun, 30 Apr 2023 18:41:13 -0400 Subject: new config old version is now on v1 branch --- lua/snippet/shorthands.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lua/snippet/shorthands.lua (limited to 'lua/snippet/shorthands.lua') diff --git a/lua/snippet/shorthands.lua b/lua/snippet/shorthands.lua new file mode 100644 index 0000000..05453bd --- /dev/null +++ b/lua/snippet/shorthands.lua @@ -0,0 +1,31 @@ +ls = require("luasnip") +s = ls.snippet +sn = ls.snippet_node +isn = ls.indent_snippet_node +t = ls.text_node +i = ls.insert_node +f = ls.function_node +c = ls.choice_node +d = ls.dynamic_node +r = ls.restore_node +events = require("luasnip.util.events") +ai = require("luasnip.nodes.absolute_indexer") +extras = require("luasnip.extras") +l = extras.lambda +rep = extras.rep +p = extras.partial +m = extras.match +n = extras.nonempty +dl = extras.dynamic_lambda +fmt = require("luasnip.extras.fmt").fmt +fmta = require("luasnip.extras.fmt").fmta +conds = require("luasnip.extras.expand_conditions") +postfix = require("luasnip.extras.postfix").postfix +types = require("luasnip.util.types") +parse = require("luasnip.util.parser").parse_snippet + +-- Repeat Insernode text +-- @param insert_node_id The id of the insert node to repeat (the first line from) +ri = function (insert_node_id) + return f(function (args) return args[1][1] end, insert_node_id) +end -- cgit v1.2.1