summaryrefslogtreecommitdiff
path: root/after/ftplugin/go.lua
diff options
context:
space:
mode:
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>]]
+)