Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature request: set extension for =( ) created file
- X-seq: zsh-users 21962
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Vadim Zeitlin <vz-zsh@xxxxxxxxxxxx>
- Subject: Re: Feature request: set extension for =( ) created file
- Date: Sat, 24 Sep 2016 20:56:30 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hN4p7ytZSS/5dib55yKE+zJP5wLErc2lAIiPtX9zz4g=; b=P3YgR7grjOY/UXRw22HXGuq46l450Jb8i0+PsbF0iPb7oPRbai+PlmxeKWkmziZPIi EptaAHafHyORfCER/AEfhkAUP8dMJ/qO4aYyeEx5Gg2258N5Wm6dIrAupyO+5fjGHa3l OF3l0JCLFVEU0yOrpxX3mi1NUTi4fNDzhOG3Da2FQhILakHvXIut1N77fNGLRQVY34BI 6QoAMJ9e+iWxWOIGEFr/HO97ue846pqDpae1IObI0j9w9LqcWpE/L7eEgccvylC6cAiN 9NzVZtSI7ofTwpbDCL8aI1GHJnHutV6aRZd78IV72/l8Y3j4ghNP19ffGBqUBYiJEXW1 3Q4g==
- In-reply-to: <E1bnrAX-00042r-V1@smtp.tt-solutions.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: <CAKc7PVCgakJrUneg_6sWWu0rLpJzicrKV5yyikua0_rNfDXvcg@mail.gmail.com> <E1bnrAX-00042r-V1@smtp.tt-solutions.com>
On 24 September 2016 at 19:55, Vadim Zeitlin <vz-zsh@xxxxxxxxxxxx> wrote:
> On Sat, 24 Sep 2016 19:51:26 +0200 Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
>
> SG> Hello,
> SG> when e.g. editing a file directly from git:
> SG>
> SG> vim =( git -C /home/user/github/proj.git cat-file blob 1e08920 )
> SG>
> SG> One will not get proper syntax highlighting because the file will be
> SG> e.g.: /tmp/zshoF8Hlc, without extension like .java.
>
> How could the shell possibly do anything that would be better than the
> usual workaround of
>
> vim -c 'setf java' =(...)
>
> ? You would still need to specify the extension somehow and specifying the
> file type for Vim directly is exactly as simple and doesn't require any
> changes to the shell.
>
Yes coming up with how to pass extension to =( ) is a TODO. Maybe it
indeed isn't worth implementing, but IMO it's almost always the case
when using =( ) causes an inevitable drawback of feeding the program
with random file name which is somewhat a random data at the start.
Extensions are vital part of file names, what program doesn't use
them? In my script I use $EDITOR, not exactly vim so I will be
implementing a switch statement and supporting whatever editor there
is and is worth it – except NOT, will not do this, because it also
complicates the command that I'm pasting into BUFFER.
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author