From c3da6fd36611ed2f8f251f07262830b21b2a562b Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 19 May 2022 10:34:37 +0200 Subject: [PATCH] extract filetype from filename in vit function --- .zsh/zshrc/20-tempfile+dir_functions | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.39.5