mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-25 01:47:25 +08:00
Compare commits
No commits in common. "be10a9127731e7c6a9a57f8c8c1789e233117ae9" and "fd8f72b27614d48ec06421fb80aff2eb10674a69" have entirely different histories.
be10a91277
...
fd8f72b276
@ -20,7 +20,6 @@ function chruby_prompt_info \
|
|||||||
jenv_prompt_info \
|
jenv_prompt_info \
|
||||||
azure_prompt_info \
|
azure_prompt_info \
|
||||||
tf_prompt_info \
|
tf_prompt_info \
|
||||||
conda_prompt_info \
|
|
||||||
{
|
{
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,44 +0,0 @@
|
|||||||
# conda-env
|
|
||||||
|
|
||||||
The plugin displays information of the created virtual container of conda and allows background theming.
|
|
||||||
|
|
||||||
To use it, add `conda-env` to the plugins array of your zshrc file:
|
|
||||||
```
|
|
||||||
plugins=(... conda-env)
|
|
||||||
```
|
|
||||||
|
|
||||||
The plugin creates a `conda_prompt_info` function that you can use in your theme, which displays the
|
|
||||||
basename of the current `$CONDA_DEFAULT_ENV`.
|
|
||||||
|
|
||||||
You can use this prompt function in your themes, by adding it to the `PROMPT` or `RPROMPT` variables. See [Example](#example) for more information.
|
|
||||||
|
|
||||||
## Settings
|
|
||||||
|
|
||||||
It uses two variables to control how the information is shown:
|
|
||||||
|
|
||||||
- `ZSH_THEME_CONDA_PREFIX`: sets the prefix of the CONDA_DEFAULT_ENV.
|
|
||||||
Defaults to `[`.
|
|
||||||
|
|
||||||
- `ZSH_THEME_CONDA_SUFFIX`: sets the suffix of the CONDA_DEFAULT_ENV.
|
|
||||||
Defaults to `]`.
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ZSH_THEME_CONDA_PREFIX='conda:%F{green}'
|
|
||||||
ZSH_THEME_CONDA_SUFFIX='%f'
|
|
||||||
RPROMPT='$(conda_prompt_info)'
|
|
||||||
```
|
|
||||||
|
|
||||||
## `CONDA_CHANGEPS1`
|
|
||||||
|
|
||||||
This plugin also automatically sets the `CONDA_CHANGEPS1` variable to `false` to avoid conda changing the prompt
|
|
||||||
automatically. This has the same effect as running `conda config --set changeps1 false`.
|
|
||||||
|
|
||||||
You can override this behavior by adding `unset CONDA_CHANGEPS1` in your `.zshrc` file, after Oh My Zsh has been
|
|
||||||
sourced.
|
|
||||||
|
|
||||||
References:
|
|
||||||
|
|
||||||
- https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#determining-your-current-environment
|
|
||||||
- https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#precedence
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
function conda_prompt_info(){
|
|
||||||
[[ -n ${CONDA_DEFAULT_ENV} ]] || return
|
|
||||||
echo "${ZSH_THEME_CONDA_PREFIX=[}${CONDA_DEFAULT_ENV:t:gs/%/%%}${ZSH_THEME_CONDA_SUFFIX=]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Has the same effect as `conda config --set changeps1 false`
|
|
||||||
# - https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#determining-your-current-environment
|
|
||||||
# - https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#precedence
|
|
||||||
export CONDA_CHANGEPS1=false
|
|
||||||
@ -1,8 +1,5 @@
|
|||||||
# Support Compose v2 as docker CLI plugin
|
# support Compose v2 as docker CLI plugin
|
||||||
#
|
(( ${+commands[docker-compose]} )) && dccmd='docker-compose' || dccmd='docker compose'
|
||||||
# This tests that the (old) docker-compose command is in $PATH and that
|
|
||||||
# it resolves to an existing executable file if it's a symlink.
|
|
||||||
[[ -x "${commands[docker-compose]:A}" ]] && dccmd='docker-compose' || dccmd='docker compose'
|
|
||||||
|
|
||||||
alias dco="$dccmd"
|
alias dco="$dccmd"
|
||||||
alias dcb="$dccmd build"
|
alias dcb="$dccmd build"
|
||||||
|
|||||||
@ -24,4 +24,3 @@ fi
|
|||||||
|
|
||||||
# Generate and load mise completion
|
# Generate and load mise completion
|
||||||
$__mise completion zsh >| "$ZSH_CACHE_DIR/completions/_$__mise" &|
|
$__mise completion zsh >| "$ZSH_CACHE_DIR/completions/_$__mise" &|
|
||||||
unset __mise
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ function pyuserpaths() {
|
|||||||
alias pygrep='grep -nr --include="*.py"'
|
alias pygrep='grep -nr --include="*.py"'
|
||||||
|
|
||||||
# Run proper IPython regarding current virtualenv (if any)
|
# Run proper IPython regarding current virtualenv (if any)
|
||||||
alias ipython='python3 -c "import sys; del sys.path[0]; import IPython; sys.exit(IPython.start_ipython())"'
|
alias ipython='python3 -c "import IPython, sys; sys.exit(IPython.start_ipython())"'
|
||||||
|
|
||||||
# Share local directory as a HTTP server
|
# Share local directory as a HTTP server
|
||||||
alias pyserver="python3 -m http.server"
|
alias pyserver="python3 -m http.server"
|
||||||
|
|||||||
2
plugins/rtx/rtx.plugin.zsh
Normal file
2
plugins/rtx/rtx.plugin.zsh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# TODO: 2024-01-03 remove rtx support
|
||||||
|
echo "[oh-my-zsh] 'rtx' plugin has been renamed to 'mise'"
|
||||||
@ -50,7 +50,6 @@ fi
|
|||||||
|
|
||||||
# ALIASES
|
# ALIASES
|
||||||
function _build_tmux_alias {
|
function _build_tmux_alias {
|
||||||
setopt localoptions no_rc_expand_param
|
|
||||||
eval "function $1 {
|
eval "function $1 {
|
||||||
if [[ -z \$1 ]] || [[ \${1:0:1} == '-' ]]; then
|
if [[ -z \$1 ]] || [[ \${1:0:1} == '-' ]]; then
|
||||||
tmux $2 \"\$@\"
|
tmux $2 \"\$@\"
|
||||||
|
|||||||
@ -2,7 +2,6 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
|||||||
local user_host="%B%(!.%{$fg[red]%}.%{$fg[green]%})%n@%m%{$reset_color%} "
|
local user_host="%B%(!.%{$fg[red]%}.%{$fg[green]%})%n@%m%{$reset_color%} "
|
||||||
local user_symbol='%(!.#.$)'
|
local user_symbol='%(!.#.$)'
|
||||||
local current_dir="%B%{$fg[blue]%}%~ %{$reset_color%}"
|
local current_dir="%B%{$fg[blue]%}%~ %{$reset_color%}"
|
||||||
local conda_prompt='$(conda_prompt_info)'
|
|
||||||
|
|
||||||
local vcs_branch='$(git_prompt_info)$(hg_prompt_info)'
|
local vcs_branch='$(git_prompt_info)$(hg_prompt_info)'
|
||||||
local rvm_ruby='$(ruby_prompt_info)'
|
local rvm_ruby='$(ruby_prompt_info)'
|
||||||
@ -15,7 +14,7 @@ fi
|
|||||||
|
|
||||||
ZSH_THEME_RVM_PROMPT_OPTIONS="i v g"
|
ZSH_THEME_RVM_PROMPT_OPTIONS="i v g"
|
||||||
|
|
||||||
PROMPT="╭─${conda_prompt}${user_host}${current_dir}${rvm_ruby}${vcs_branch}${venv_prompt}${kube_prompt}
|
PROMPT="╭─${user_host}${current_dir}${rvm_ruby}${vcs_branch}${venv_prompt}${kube_prompt}
|
||||||
╰─%B${user_symbol}%b "
|
╰─%B${user_symbol}%b "
|
||||||
RPROMPT="%B${return_code}%b"
|
RPROMPT="%B${return_code}%b"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user