summaryrefslogtreecommitdiff
path: root/after
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-01 12:32:15 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-01 12:46:03 +0200
commit392d3df314874fe802d51f84e3a63f82a8ab893b (patch)
treef8cfbd92339eb40a8fb8fd8aea29bad46e3ac0c5 /after
parent08fe2898811816fd0a096e6996d8ed25d2e940c8 (diff)
Changes to snippets, lsp, lazy and set.lua
- Changed go snippets to be more intuitive - lazy.lua: - Added lsp_signature plugin - Added which-keky plugin - lsp.lua: - Changed lsp.lua to have variables at the top - Added more keybinds for diagnostics - Added gopls configuration for inlay hints - Moved borders from set.lua to lsp.lua - Added ts_ls and powershell lsps - set.lua: - Added colorcolumn option - luasnip.lua: - Added shebang snippet for shell
Diffstat (limited to 'after')
-rw-r--r--after/ftplugin/sh.lua3
-rw-r--r--after/plugin/luasnip.lua12
2 files changed, 9 insertions, 6 deletions
diff --git a/after/ftplugin/sh.lua b/after/ftplugin/sh.lua
new file mode 100644
index 0000000..2cb8493
--- /dev/null
+++ b/after/ftplugin/sh.lua
@@ -0,0 +1,3 @@
+local map = vim.keymap.set
+
+map("n", ",v", [[<cmd>s/\(\s*\)\(.\+\)/\1"$(\2)"/<cr>]])
diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua
index 3a64f9a..c7ee31b 100644
--- a/after/plugin/luasnip.lua
+++ b/after/plugin/luasnip.lua
@@ -25,14 +25,14 @@ ls.config.set_config({
history = true,
})
-ls.add_snippets("all", {
- ls.parser.parse_snippet("test", "$1->$2->$3->$0\n"),
-})
ls.add_snippets("go", {
ls.parser.parse_snippet("main", "package main\n\nfunc main() {\n\t$0\n}"),
- ls.parser.parse_snippet("e", "if err != nil {\n\t$1\n}\n$0"),
- ls.parser.parse_snippet("ep", "if err != nil {\n\tpanic(err)\n}\n$0"),
- ls.parser.parse_snippet("eif", "if err := $1; err != nil {\n\tpanic(err)\n}\n$0"),
+ ls.parser.parse_snippet("e", "if err != nil {\n\tfmt.Println(err)$1\n}\n$0"),
+ ls.parser.parse_snippet("ee", "if err != nil {\n\tfmt.Println(err)$1\n\tos.Exit(${2:1})\n}\n$0"),
+ ls.parser.parse_snippet("eif", "if err := $1; err != nil {\n\tfmt.Println(err)$2\n}\n$0"),
ls.parser.parse_snippet("pf", "fmt.Printf($0)"),
ls.parser.parse_snippet("pl", "fmt.Println($0)"),
})
+ls.add_snippets("sh", {
+ ls.parser.parse_snippet("!", "#!/bin/sh\n$0"),
+})