Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Shift-Insert erratic behavior in edit-command-line vim
- X-seq: zsh-users 22027
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Shift-Insert erratic behavior in edit-command-line vim
- Date: Tue, 25 Oct 2016 09:25:22 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=TXEJM78HouC2Vk2hesqovcw0ZN/G/nDoKx5jATCaeZk=; b=GysKQUPHYBtAM//uQF9EFMWUem7zv8+cLh07CxDs3x7W8FRtrQRSsqOqLRMtXe18wl UQ17HSuAoXmJEsaQbjDZ9ipBdaI8UtENVQRCVp03iHmenspMuRUx1fnHnv5E27nr05Z5 9TuuVcrbs4Zk9Ip2xk9uiPwpKAaq3penmY9G5UFpv3pFbxMVUh57apd/70+81cV61ZwN 1zNverX9QPbLywFDiJCE8e3nKuqYjOi2wycEz7jwizEnTcJyjYtM7y8B0slVi8Yav+mW zqZIv1Gxtq5659lCMQh2gdGjTlak1lJ/zeuyExB39aP6eeCWqj/aEXGg2il+PR+tSYEP ESxA==
- In-reply-to: <CAMtVo_O6c3v-4ErBPOqEvG5KjJ5Jh7Vbwddq2N9w8F0GDUkKRQ@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAMtVo_O6c3v-4ErBPOqEvG5KjJ5Jh7Vbwddq2N9w8F0GDUkKRQ@mail.gmail.com>
On Oct 25, 8:48pm, lolilolicon wrote:
}
} I use ESC-e (edit-command-line) to edit the current command line in vim.
} Usually in vim Insert mode, I can use Shift-Insert to insert X PRIMARY
} selection, but for some reason, it doesn't work here.
} Instead, vim would enter Normal mode and execute... something
Another side-effect of bracketed-paste. Fixed in the forthcoming 5.3
release; partial patch was posted in zsh-users/20873, but here is the
full set of changes.
diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index 103a1c1..353f260 100644
--- a/Functions/Zle/edit-command-line
+++ b/Functions/Zle/edit-command-line
@@ -1,8 +1,8 @@
# Edit the command line using your usual editor.
-# Binding this to 'v' in the vi command mode map,
+# Binding this to '!' in the vi command mode map,
# autoload -Uz edit-command-line
# zle -N edit-command-line
-# bindkey -M vicmd v edit-command-line
+# bindkey -M vicmd '!' edit-command-line
# will give ksh-like behaviour for that key,
# except that it will handle multi-line buffers properly.
@@ -10,7 +10,9 @@
exec </dev/tty
# Compute the cursor's position in bytes, not characters.
- setopt localoptions nomultibyte
+ setopt localoptions nomultibyte noksharrays
+
+ (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[2]
# Open the editor, placing the cursor at the right place if we know how.
local editor=${${VISUAL:-${EDITOR:-vi}}}
@@ -24,6 +26,8 @@
(*) ${=editor} $1;;
esac
+ (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[1]
+
# Replace the buffer with the editor output.
print -Rz - "$(<$1)"
} =(<<<"$PREBUFFER$BUFFER")
--
Barton E. Schaefer
Messages sorted by:
Reverse Date,
Date,
Thread,
Author