From e0ba0fb4c965c50bfadc30b93f5c8217cfe5c22c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 14 May 2023 21:32:18 +0200 Subject: added snippets --- config/essentials/nvim/after/plugin/luasnip.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'config/essentials/nvim/after/plugin/luasnip.lua') diff --git a/config/essentials/nvim/after/plugin/luasnip.lua b/config/essentials/nvim/after/plugin/luasnip.lua index bba2f9f..13f4432 100644 --- a/config/essentials/nvim/after/plugin/luasnip.lua +++ b/config/essentials/nvim/after/plugin/luasnip.lua @@ -137,6 +137,7 @@ ls.add_snippets("java", { }) ls.add_snippets("sh", { + s("TD", t "THISDIR=$(dirname $(readlink -f \"$0\"))"), parse("fn", "$1 ()\n{\n\t$2\n}$0", {}), parse("fdie", [[ @@ -162,7 +163,14 @@ ls.add_snippets("sh", { ls.add_snippets("javascript", { -- print s("pt", fmt("console.log({});{}", { i(1, "\"Hello World!\"") , i(0) })), - s("rq", fmt("var {} = require('{}');", { i(1), rep(1) })), + s("rq", fmt("const {} = require('{}');", { i(1), rep(1) })), + s("apr", fmt( + [[ + app.get('{}', (req, res) => {{ + {} + }});{} + ]], + { i(1), i(2, "app.get(\"Hello world!\")"), i(0) })), }) ls.add_snippets("telekasten", { -- cgit v1.2.3