summaryrefslogtreecommitdiff
path: root/after/ftplugin/sh.lua
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-06 01:08:39 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-06 01:08:39 +0200
commit2dea91e91c1680cbd03a5e60239823f56b90513c (patch)
treecff916ff0eb400ccebf4b3fe9873c71d5d780dfb /after/ftplugin/sh.lua
parentdea978318e7a0244362706795ac777e7cd46c4da (diff)
checkpoint
Diffstat (limited to 'after/ftplugin/sh.lua')
-rw-r--r--after/ftplugin/sh.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/after/ftplugin/sh.lua b/after/ftplugin/sh.lua
index 2cb8493..5bd9b4b 100644
--- a/after/ftplugin/sh.lua
+++ b/after/ftplugin/sh.lua
@@ -1,3 +1,5 @@
local map = vim.keymap.set
-map("n", ",v", [[<cmd>s/\(\s*\)\(.\+\)/\1"$(\2)"/<cr>]])
+map("n", ",v", [[<cmd>s/\(\s*\)\(.\+\)/\1"$(\2)"/<cr>]], { desc = "Surround with variable" })
+map("n", ",p", [[<cmd>s/\(\s*\)\(.\+\)/\1printf '\2: %s\\n' "$\2"/<cr>]], { desc = "Surround var with printf" })
+map("n", ",e", [[<cmd>s/\(\s*\)\(.\+\)/\1[ "$\2" ] || exit 1'/<cr>]], { desc = "Surround var with exit if empty" })