这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions conda/shell/etc/fish/conf.d/conda.fish
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,19 @@ end
# Faster but less tested (?)
function __fish_conda_commands
string replace -r '.*_([a-z]+)\.py$' '$1' $_CONDA_ROOT/lib/python*/site-packages/conda/cli/main_*.py
for f in $_CONDA_ROOT/bin/conda-*
if test -x "$f" -a ! -d "$f"
string replace -r '^.*/conda-' '' "$f"
end
end
echo activate
echo deactivate
end

function __fish_conda_env_commands
string replace -r '.*_([a-z]+)\.py$' '$1' $_CONDA_ROOT/lib/python*/site-packages/conda_env/cli/main_*.py
end

function __fish_conda_envs
conda config --show envs_dirs | awk 'NR > 1 {print $2}' | xargs -IX find X -maxdepth 1 -mindepth 1 -type d -printf '%f\n' | sort
end
Expand Down Expand Up @@ -139,6 +148,7 @@ end

# Conda commands
complete -f -c conda -n '__fish_conda_needs_command' -a '(__fish_conda_commands)'
complete -f -c conda -n '__fish_conda_using_command env' -a '(__fish_conda_env_commands)'

# Commands that need environment as parameter
complete -f -c conda -n '__fish_conda_using_command activate' -a '(__fish_conda_envs)'
Expand Down