summaryrefslogtreecommitdiff
path: root/after/ftplugin/go.lua
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-11 17:48:42 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-11 17:48:42 +0200
commit0b3dfbfd98b311c6228f75e6d71d917fa9aa3785 (patch)
tree0a698b1ce8147542ee6930f0066adb0296dbd0d6 /after/ftplugin/go.lua
parentd7a6755c559c9a5b296bdf65ce67112adef93edb (diff)
checkpoint
Diffstat (limited to 'after/ftplugin/go.lua')
-rw-r--r--after/ftplugin/go.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/after/ftplugin/go.lua b/after/ftplugin/go.lua
new file mode 100644
index 0000000..e17dfea
--- /dev/null
+++ b/after/ftplugin/go.lua
@@ -0,0 +1,8 @@
+local map = vim.keymap.set
+map("n", ",p", [[<cmd>s/\(\s*\)\(.\+\)/\1fmt.Printf("\2: %#v\\n", \2)<cr>]], { desc = "Surround var with fmt.Println" })
+map(
+ "n",
+ ",e",
+ [[Iif err := <esc>A; err != nil {
+}<esc>Opanic(err)<esc>]]
+)