From 2dea91e91c1680cbd03a5e60239823f56b90513c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Oct 2024 01:08:39 +0200 Subject: checkpoint --- after/ftplugin/sh.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'after/ftplugin/sh.lua') 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", [[s/\(\s*\)\(.\+\)/\1"$(\2)"/]]) +map("n", ",v", [[s/\(\s*\)\(.\+\)/\1"$(\2)"/]], { desc = "Surround with variable" }) +map("n", ",p", [[s/\(\s*\)\(.\+\)/\1printf '\2: %s\\n' "$\2"/]], { desc = "Surround var with printf" }) +map("n", ",e", [[s/\(\s*\)\(.\+\)/\1[ "$\2" ] || exit 1'/]], { desc = "Surround var with exit if empty" }) -- cgit v1.2.3