]> git.madduck.net Git - etc/zsh.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

extract filetype from filename in vit function
authormartin f. krafft <madduck@madduck.net>
Thu, 19 May 2022 08:34:37 +0000 (10:34 +0200)
committermartin f. krafft <madduck@madduck.net>
Thu, 19 May 2022 08:34:37 +0000 (10:34 +0200)
.zsh/zshrc/20-tempfile+dir_functions

index c45c3c347a077948e026f751c824dd746499f48a..e782fe027c3779d8381262a5cf82b3ae66682cde 100644 (file)
@@ -36,6 +36,12 @@ vit() {
   for i in "$@"; do
     case "$i" in
       -) local stdin=1; shift;;
   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
       *) if [ -z "${tag:-}" ]; then
            tag="$i"; shift
          else