From 3e5bf34d6d49739852961004447e8756d2a06661 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 20 Mar 2022 21:09:22 +0000 Subject: [PATCH] # Adds Vim-style text surround bindings --- zsh/lib/surround.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 zsh/lib/surround.zsh diff --git a/zsh/lib/surround.zsh b/zsh/lib/surround.zsh new file mode 100644 index 0000000..a8ba9fb --- /dev/null +++ b/zsh/lib/surround.zsh @@ -0,0 +1,14 @@ +# Mimic Tim Pope’s Vim surround plugin +# When in normal mode, use: +# - cs (change surrounding) +# - ds (delete surrounding) +# - ys (add surrounding) + +autoload -Uz surround +zle -N delete-surround surround +zle -N add-surround surround +zle -N change-surround surround +bindkey -M vicmd cs change-surround +bindkey -M vicmd ds delete-surround +bindkey -M vicmd ys add-surround +bindkey -M visual S add-surround \ No newline at end of file