]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Strip trailing newlines from bracketed pastes
authorSergey Matveev <stargrave@stargrave.org>
Sat, 12 Nov 2022 16:18:45 +0000 (19:18 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 12 Nov 2022 16:18:45 +0000 (19:18 +0300)
zsh/.zsh/rc/025paste-notrailing-newline.zsh [new file with mode: 0644]

diff --git a/zsh/.zsh/rc/025paste-notrailing-newline.zsh b/zsh/.zsh/rc/025paste-notrailing-newline.zsh
new file mode 100644 (file)
index 0000000..18741e1
--- /dev/null
@@ -0,0 +1,4 @@
+bracketed-paste() {
+    zle .$WIDGET && LBUFFER=${LBUFFER%$'\n'}
+}
+zle -N bracketed-paste