# Adds Vim-style text surround bindings

This commit is contained in:
Alicia Sykes 2022-03-20 21:09:22 +00:00
parent ae2d451a37
commit 3e5bf34d6d

14
zsh/lib/surround.zsh Normal file
View File

@ -0,0 +1,14 @@
# Mimic Tim Popes 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