zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Feature request: set extension for =( ) created file
Date: Sat, 24 Sep 2016 11:22:40 -0700	[thread overview]
Message-ID: <160924112240.ZM28699@torch.brasslantern.com> (raw)
In-Reply-To: <CAKc7PVCgakJrUneg_6sWWu0rLpJzicrKV5yyikua0_rNfDXvcg@mail.gmail.com>

On Sep 24,  7:51pm, Sebastian Gniazdowski wrote:
}
} vim =( git -C /home/user/github/proj.git cat-file blob 1e08920 )
} 
} One will not get proper syntax highlighting because the file will be
} e.g.: /tmp/zshoF8Hlc, without extension like .java.

How about this?

    vimtmp () {
      local filetype="$(file $1)"
      case "$filetype" in
      (*[Jj]ava*) filetype=java;;
      (*) : etc.
      esac
      vim -c ":set filetype=$filetype" $1
    }

    vimtmp =( git -C /home/user/github/proj.git cat-file blob 1e08920 )

You can extend this with a cached mapping of "file" output to file types
and something to prompt/update the cache on unrecognized output.


      parent reply	other threads:[~2016-09-24 18:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-24 17:51 Sebastian Gniazdowski
2016-09-24 17:55 ` Vadim Zeitlin
2016-09-24 18:43   ` Lawrence Velázquez
2016-09-24 19:30     ` Sebastian Gniazdowski
2016-09-24 19:55       ` Lawrence Velázquez
2016-09-24 20:14         ` Sebastian Gniazdowski
2016-09-24 20:36           ` Lawrence Velázquez
2016-09-24 20:44             ` Sebastian Gniazdowski
2016-09-24 21:06               ` Lawrence Velázquez
2016-09-24 21:24                 ` Bart Schaefer
2016-09-24 21:58                   ` Lawrence Velázquez
2016-09-25  0:05           ` Nikolay Aleksandrovich Pavlov (ZyX)
2016-09-25  5:17             ` Bart Schaefer
2016-09-25  6:17               ` Sebastian Gniazdowski
2016-09-25 15:21                 ` Lawrence Velázquez
2016-09-26 18:03                 ` Bart Schaefer
2016-09-25 16:58               ` Nikolay Aleksandrovich Pavlov (ZyX)
2016-09-25 22:37                 ` Bart Schaefer
2016-09-24 21:06         ` Bart Schaefer
2016-09-24 18:56   ` Sebastian Gniazdowski
2016-09-24 18:22 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160924112240.ZM28699@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).