From 2102e1ed005293b73e105729cc404ee6557a0508 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 27 Feb 2024 17:33:46 +0100 Subject: [zsh] added surround_in_var in widgets.zsh --- config/essentials/zsh/.zshrc | 1 + config/essentials/zsh/widgets.zsh | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 config/essentials/zsh/widgets.zsh (limited to 'config/essentials') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 02d0ddf..b9c1173 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -23,6 +23,7 @@ zle -N change-surround surround . $XDG_CONFIG_HOME/shell/functions.sh . $XDG_CONFIG_HOME/shell/aliases.sh . $XDG_CONFIG_HOME/zsh/comp.zsh +. $XDG_CONFIG_HOME/zsh/widgets.zsh # . $XDG_CONFIG_HOME/zsh/prompt.zsh # . $XDG_CONFIG_HOME/zsh/plugins.zsh diff --git a/config/essentials/zsh/widgets.zsh b/config/essentials/zsh/widgets.zsh new file mode 100644 index 0000000..e0cbf98 --- /dev/null +++ b/config/essentials/zsh/widgets.zsh @@ -0,0 +1,9 @@ +# surround line in variable +surround_in_var() +{ + BUFFER=" \$($BUFFER)" + zle beginning-of-line +} +zle -N surround_in_var +bindkey '\ev' surround_in_var + -- cgit v1.2.3