Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature request: set extension for =( ) created file
- X-seq: zsh-users 21961
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Feature request: set extension for =( ) created file
- Date: Sat, 24 Sep 2016 11:22:40 -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=du217p+qoiRbOx2nxIJJfwIrvGXlX0xmT8NSLqBF2WM=; b=pRFpIq+j/8ucvCyyJORezd2mQhAqgdll2NhNGLN5dk8GlwAZXdPFrMR11XgPabXgqd /7o2ed/EwI8K66X64zCHtUFlNzNosG8Oa5TnnJbEWIBViH2RMhGsH41soAQZnnnEztdv W0deC+M4nHywMRl3+v5INVVG0WRIc1niARc0j1r5/4xQVsntKWBpG/3Wy+9gt8KBNQOq siPg7HG3byuSDAAXi1uV1yWnj/sUqCn4zPecEtG3vyO4A2XfrsRnXnPkhwddKgAltuHT j51A7RDQOpSJlgPzRTvhXt7554rQlq05pXtuUiThOZfS8D6nd+vjiNqyyimCysR/7+EV bTog==
- In-reply-to: <CAKc7PVCgakJrUneg_6sWWu0rLpJzicrKV5yyikua0_rNfDXvcg@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: <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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author