Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Set TMPSUFFIX=.zsh in edit-command-line

This patch makes the name of a temporary file to have a .zsh suffix so
that the invoked editor will know it's a zsh script. The .zsh suffix is commonly recognized by editors like Emacs, Vim and VS Code.

It's so much easier to edit a command line in a proper editing mode than in a plain text mode.

Akinori MUSHA / https://akinori.org/

From 10a2d01b5163e79374060e65f968339a5f3145ae Mon Sep 17 00:00:00 2001
From: Akinori MUSHA <knu@xxxxxxxxxxxx>
Date: Fri, 28 May 2021 22:20:33 +0900
Subject: [PATCH] Let EDITOR invoked by edit-command-line know it's a zsh

 Functions/Zle/edit-command-line | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index 3781244b2..5f7ea321f 100644
--- a/Functions/Zle/edit-command-line
+++ b/Functions/Zle/edit-command-line
@@ -8,6 +8,7 @@
 emulate -L zsh
 local left right prebuffer buffer=$BUFFER lbuffer=$LBUFFER
+local TMPSUFFIX=.zsh
 # set up parameters depending on which context we are called from,
 # see below comment for more details
 if (( REGION_ACTIVE )); then

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Messages sorted by: Reverse Date, Date, Thread, Author