From dc87cb2fb42ff45b93c07ed25da41750f535f914 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 29 May 2023 01:46:56 +0200 Subject: added javascript dbconnect snippet --- config/essentials/nvim/after/plugin/luasnip.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (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 bade3be..eabc0be 100644 --- a/config/essentials/nvim/after/plugin/luasnip.lua +++ b/config/essentials/nvim/after/plugin/luasnip.lua @@ -164,6 +164,17 @@ ls.add_snippets("javascript", { -- print s("pt", fmt("console.log({});{}", { i(1, "\"Hello World!\"") , i(0) })), s("rq", fmt("const {} = require('{}');", { i(1), rep(1) })), + s("dbconn", fmt( + [[ + let conn = null; + try {{ + conn = await dbConnect();{} + conn.end() + }} catch(err) {{ + console.error('Error:', err); + }} + ]], + { i(0) })), s("apr", fmt( [[ app.get('{}', (req, res) => {{ -- cgit v1.2.3