From: martin f. krafft Date: Thu, 19 May 2022 08:34:37 +0000 (+0200) Subject: extract filetype from filename in vit function X-Git-Url: https://git.madduck.net/etc/zsh.git/commitdiff_plain/c3da6fd36611ed2f8f251f07262830b21b2a562b?ds=sidebyside;hp=db608883d834ac7e99469eb6332a1671bf450bf0 extract filetype from filename in vit function --- diff --git a/.zsh/zshrc/20-tempfile+dir_functions b/.zsh/zshrc/20-tempfile+dir_functions index c45c3c3..e782fe0 100644 --- a/.zsh/zshrc/20-tempfile+dir_functions +++ b/.zsh/zshrc/20-tempfile+dir_functions @@ -36,6 +36,12 @@ vit() { for i in "$@"; do case "$i" in -) local stdin=1; shift;; + .*) if [ -z "${ft:-}" ]; then + ft="${i#.}"; shift + else + zwarn "filetype $ft already specified, skipping: ${i#.}" + fi + ;; *) if [ -z "${tag:-}" ]; then tag="$i"; shift else