diff --git a/.config/fish/functions/brew-save.fish b/.config/fish/functions/brew-save.fish
new file mode 100755
index 0000000..e5097c4
--- /dev/null
+++ b/.config/fish/functions/brew-save.fish
@@ -0,0 +1,15 @@
+function brew-save -d "Install a new homebrew cask and update the global Brewfile"
+  set -f package $argv
+  if set -f info_output (brew info $package 2> /dev/null)
+    if echo $info_output | grep homebrew-cask &> /dev/null
+      set -f brewfile_keyword cask
+    else
+      set -f brewfile_keyword brew
+    end
+    echo "$brewfile_keyword \"$package\"" >> ~/.Brewfile
+    brew bundle --global
+  else
+    echo "package not found: $argv"
+    return 1
+  end
+end
diff --git a/.config/fish/functions/cask.fish b/.config/fish/functions/cask.fish
deleted file mode 100755
index 7cbff77..0000000
--- a/.config/fish/functions/cask.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function cask -d "Install a new homebrew cask and update the global Brewfile"
-  echo "cask \"$argv\"" >> ~/.Brewfile
-  brew bundle --global
-end