A z-shell function to quickly cd into projects
Remove unused variables

The variable argument_count is not used for anything, so you should remove it.

Simplify shell arithmetics

Instead of this:


(( argument_count=argument_count-1 ))



You could simplify using the postfix operator:

(( argument_count-- ))


Simplify condition

This condition can be written simpler:


if [[ ! (( -n $root &amp;&amp; -n $project_name )) ]]; then



Like this:

if ! [[ -n $root &amp;&amp; -n $project_name ]]; then


Note that you could also drop both of the -n flags there,
the expression will still mean the same:

if ! [[ $root &amp;&amp; $project_name ]]; then


For the same reason, I suggest to drop all the -n in all conditions.

Always double-quote path variables

At some places you did a good job double-quoting path variables:


  target_dir="$target_dir/$root/$project_name"
  if [[ -n $app_name ]]; then
    target_dir="$target_dir/$app_name"
  fi



At others you didn't:


  # When the create flag is true (-c), create target directory
  if [[ $create == true ]]; then
    mkdir -p $target_dir
  fi

  # Finally, cd to the targeted directory
  cd $target_dir



Make it a habit to double-quote path variables always.