diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-10-06 14:31:03 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-10-06 14:31:03 +0200 |
commit | e8ff563a53306ef3f6344ccd197bf7d737cf851c (patch) | |
tree | e868cb7b3f7c9d7a828ab8f1b4528f0c01e46f3a | |
parent | 2dea91e91c1680cbd03a5e60239823f56b90513c (diff) |
checkpoint
-rw-r--r-- | after/ftplugin/markdown.lua | 3 | ||||
-rw-r--r-- | after/ftplugin/sql.lua | 1 | ||||
-rw-r--r-- | after/ftplugin/typescript.lua | 3 | ||||
-rw-r--r-- | after/plugin/luasnip.lua | 8 | ||||
-rw-r--r-- | lua/config/set.lua | 6 |
5 files changed, 15 insertions, 6 deletions
diff --git a/after/ftplugin/markdown.lua b/after/ftplugin/markdown.lua new file mode 100644 index 0000000..4d58eea --- /dev/null +++ b/after/ftplugin/markdown.lua @@ -0,0 +1,3 @@ +-- -- Custom highlight for markdown definitions +vim.cmd("hi mdDefs guifg=" .. require("nord.colors").palette.frost.ice) +vim.cmd("match mdDefs /^[[:space:]]*-[^:]\\+:/") diff --git a/after/ftplugin/sql.lua b/after/ftplugin/sql.lua new file mode 100644 index 0000000..34c50a9 --- /dev/null +++ b/after/ftplugin/sql.lua @@ -0,0 +1 @@ +vim.opt.commentstring = "-- %s" diff --git a/after/ftplugin/typescript.lua b/after/ftplugin/typescript.lua new file mode 100644 index 0000000..3eb1653 --- /dev/null +++ b/after/ftplugin/typescript.lua @@ -0,0 +1,3 @@ +local map = vim.keymap.set + +map("n", ",p", [[<cmd>s/\(\s*\)\(.\+\)/\1console.log("\2:", \2);<cr>]], { desc = "Surround var with console.log" }) diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua index 7959de9..9ff00de 100644 --- a/after/plugin/luasnip.lua +++ b/after/plugin/luasnip.lua @@ -23,6 +23,8 @@ map("n", " s", "<cmd>source ~/.config/nvim/after/plugin/luasnip.lua<cr>") ls.config.set_config({ history = true, + -- Will update multiple nodes at the same time when in insert mode + update_events = { "TextChanged", "TextChangedI" }, }) ls.add_snippets("go", { @@ -39,3 +41,9 @@ ls.add_snippets("sh", { ls.add_snippets("c", { ls.parser.parse_snippet("main", "int main(void) {\n\t$0\n\treturn 0;\n}"), }) +ls.add_snippets("typescript", { + ls.parser.parse_snippet("cl", "console.log($0);"), +}) +ls.add_snippets("html", { + ls.parser.parse_snippet("t", [[<$1>$0</$1>]]), +}) diff --git a/lua/config/set.lua b/lua/config/set.lua index 05e3803..e921234 100644 --- a/lua/config/set.lua +++ b/lua/config/set.lua @@ -103,12 +103,6 @@ opt.title = true -- Highlighting vim.cmd("match Todo /\\(TODO\\|FIXME\\):/") --- -- Custom highlight for markdown definitions -if vim.filetype.match({ buf = 0 }) == "markdown" then - vim.cmd("hi mdDefs guifg=" .. require("nord.colors").palette.frost.ice) - vim.cmd("match mdDefs /^[[:space:]]*-[^:]\\+:/") -end - -- TODO: this is some text vim.cmd("syntax match matchURL /" .. "\\(https\\?\\|ftp\\|magnet\\):\\/\\/[[:alnum:]%\\/_#.-~:]*" .. "/") vim.cmd("hi matchURL guifg=" .. require("nord.colors").palette.aurora.yellow) |