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

Re: Feature request: set extension for =( ) created file

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