title: Using anyenv in Fish Shell
body: <p>I tried to using <a href="https://github.com/riywo/anyenv" rel="nofollow noreferrer">anyenv</a> in Fish Shell but the error occured.</p>
  
  <p>This is my <code>~./config/fish/config.fish</code> file.</p>
  
  <pre><code>set -x PATH $HOME/.anyenv/bin $PATH
  eval (anyenv init -)
  </code></pre>
  
  <p>What's wrong with this?</p>
  
  <p>Errors which I got:</p>
  
  <pre><code>$# is not supported. In fish, please use 'count $argv'.
  - (line 1): begin; source "/Users/kasumi/.anyenv/libexec/../completions/anyenv.bash" anyenv() {   typeset command   command="$1"   if [ "$#" -gt 0 ]; then     shift   fi   command anyenv "$command" "$@" } export NDENV_ROOT="/Users/kasumi/.anyenv/envs/ndenv" export PATH="/Users/kasumi/.anyenv/envs/ndenv/bin:$PATH" export PATH="/Users/kasumi/.anyenv/envs/ndenv/shims:${PATH}" source "/Users/kasumi/.anyenv/envs/ndenv/libexec/../completions/ndenv.bash" ndenv rehash 2&gt;/dev/null ndenv() {   typeset command   command="$1"   if [ "$#" -gt 0 ]; then     shift   fi    case "$command" in   rehash|shell)     eval "`ndenv "sh-$command" "$@"`";;   *)     command ndenv "$command" "$@";;   esac }
                                                                                                                                        ^
  from sourcing file -
      called on line 60 of file /usr/local/Cellar/fish/2.4.0/share/fish/functions/eval.fish
  
  in function 'eval'
      called on line 6 of file ~/.config/fish/config.fish
  
  from sourcing file ~/.config/fish/config.fish
      called on standard input
  
  source: Error while reading file '-'
  </code></pre>
  
  <hr>
  
  <p><strong>Added:</strong></p>
  
  <p>I tried answer (<a href="https://stackoverflow.com/a/42119354/7524270">https://stackoverflow.com/a/42119354/7524270</a>) but I get some new errors.</p>
  
  <p>New Errors:</p>
  
  <pre><code>Variables cannot be bracketed. In fish, please use "$PATH".
  - (line 1): begin; source     "/Users/kasumi/.anyenv/libexec/../completions/anyenv.fish" function anyenv   set command $argv[1]   set -e argv[1]    command anyenv "$command" $argv end set -x NDENV_ROOT "/Users/kasumi/.anyenv/envs/ndenv" set -x PATH $PATH "/Users/kasumi/.anyenv/envs/ndenv/bin" export PATH="/Users/kasumi/.anyenv/envs/ndenv/shims:${PATH}" ndenv rehash 2&gt;/dev/null ndenv() {   typeset command   command="$1"   if [ "$#" -gt 0 ]; then     shift   fi    case "$command" in   rehash|shell)     eval "`ndenv "sh-$command" "$@"`";;   *)     command ndenv "$command" "$@";;   esac } 
                                                                                                                                                                                                                                                                                                                                                     ^
  from sourcing file -
  called on line 60 of file /usr/local/Cellar/fish/2.5.0/share/fish/functions/eval.fish
  
  in function 'eval'
  called on line 4 of file ~/.config/fish/config.fish
  
  from sourcing file ~/.config/fish/config.fish
  called during startup
  
  source: Error while reading file '-'
  </code></pre>