Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
shell:zsh [2020/10/31 12:16] – [Configuration .zshrc] d2air | shell:zsh [2025/01/01 19:54] (Version actuelle) – [Configuration de ZSH] d2air | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== Z Shell ====== | ====== Z Shell ====== | ||
+ | Configuration de [[wpfr> | ||
===== Fonctionnalités ===== | ===== Fonctionnalités ===== | ||
Zsh apporte les fonctionnalités suivantes : | Zsh apporte les fonctionnalités suivantes : | ||
Ligne 28: | Ligne 29: | ||
Le nouveau fichier '' | Le nouveau fichier '' | ||
Cependant les plugins doivent absolument se déclarer dans le fichier '' | Cependant les plugins doivent absolument se déclarer dans le fichier '' | ||
+ | L' | ||
+ | < | ||
+ | plugins=(git github...) | ||
+ | </ | ||
+ | Pour obtenir la liste des plugins disponibles il faudra utiliser la commande '' | ||
+ | <code sh> | ||
+ | omz plugin list | ||
+ | </ | ||
<file sh .zshrc> | <file sh .zshrc> | ||
+ | # | ||
# | # | ||
# |__ / ___|| | | | _ \ / ___| | # |__ / ___|| | | | _ \ / ___| | ||
Ligne 36: | Ligne 45: | ||
# | # | ||
# | # | ||
+ | # | ||
# Plugins | # Plugins | ||
# | # | ||
- | plugins=(git github common-aliases dirhistory sudo nmap web-search python pip urltools copyfile encode64 history colored-man-pages) | + | plugins=(git github common-aliases dirhistory sudo nmap web-search python pip urltools copyfile encode64 history colored-man-pages |
# | # | ||
</ | </ | ||
Ligne 86: | Ligne 96: | ||
echo " | echo " | ||
</ | </ | ||
+ | Enfin, pour connaître les fonctionnalités d'un plugin la commande '' | ||
+ | <code sh> | ||
+ | omz plugin info git | ||
+ | </ | ||
==== Thèmes ==== | ==== Thèmes ==== | ||
Il possible de modifier un thème en le copiant ou d'en créer un dans le dossier '' | Il possible de modifier un thème en le copiant ou d'en créer un dans le dossier '' | ||
+ | Pour obtenir la liste des thèmes disponibles avec la commande '' | ||
+ | <code bash> | ||
+ | omz plugin themes | ||
+ | </ | ||
+ | Le thème se délare dans le fichier '' | ||
+ | <file sh .zshrc> | ||
+ | # | ||
+ | # | ||
+ | # |__ / ___|| | | | _ \ / ___| | ||
+ | # / /\___ \| |_| | |_) | | | ||
+ | # _ / /_ ___) | _ | _ <| |___ | ||
+ | # | ||
+ | # | ||
+ | # Set name of the theme to load --- if set to " | ||
+ | # load a random theme each time oh-my-zsh is loaded, in which case, | ||
+ | # to know which specific one was loaded, run: echo $RANDOM_THEME | ||
+ | # See https:// | ||
+ | ZSH_THEME=" | ||
+ | # | ||
+ | plugins=(git github common-aliases dirhistory sudo nmap web-search python pip urltools copyfile encode64 history colored-man-pages ubuntu) | ||
+ | # | ||
+ | source $ZSH/ | ||
+ | # | ||
+ | </ | ||
+ | Et pour obtenir la liste des thèmes disponibles avec la commande '' | ||
+ | <code sh> | ||
+ | omz theme list | ||
+ | </ | ||
+ | |||
+ | ===== Configuration de ZSH ===== | ||
+ | Un exemple de fichier de configuration : | ||
+ | <file sh .zshrc> | ||
+ | # | ||
+ | # | ||
+ | # |__ / ___|| | | | _ \ / ___| | ||
+ | # / /\___ \| |_| | |_) | | | ||
+ | # _ / /_ ___) | _ | _ <| |___ | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Complétion | ||
+ | autoload -U compinit | ||
+ | compinit | ||
+ | zstyle ': | ||
+ | zstyle ': | ||
+ | zstyle ': | ||
+ | / | ||
+ | # Crée un cache des complétion possibles | ||
+ | # très utile pour les complétion qui demandent beaucoup de temps | ||
+ | # comme la recherche d'un paquet aptitude install moz< | ||
+ | zstyle ': | ||
+ | zstyle ': | ||
+ | # des couleurs pour la complétion | ||
+ | # faites un kill -9 < | ||
+ | zmodload zsh/ | ||
+ | setopt extendedglob | ||
+ | zstyle ': | ||
+ | |||
+ | # Correction des commandes | ||
+ | setopt correctall | ||
+ | |||
+ | # If you come from bash you might have to change your $PATH. | ||
+ | # export PATH=$HOME/ | ||
+ | |||
+ | # Path to your oh-my-zsh installation. | ||
+ | export ZSH="/ | ||
+ | |||
+ | # Set name of the theme to load --- if set to " | ||
+ | # load a random theme each time oh-my-zsh is loaded, in which case, | ||
+ | # to know which specific one was loaded, run: echo $RANDOM_THEME | ||
+ | # See https:// | ||
+ | ZSH_THEME=" | ||
+ | |||
+ | # Set list of themes to pick from when loading at random | ||
+ | # Setting this variable when ZSH_THEME=random will cause zsh to load | ||
+ | # a theme from this variable instead of looking in ~/ | ||
+ | # If set to an empty array, this variable will have no effect. | ||
+ | # ZSH_THEME_RANDOM_CANDIDATES=( " | ||
+ | |||
+ | # Uncomment the following line to use case-sensitive completion. | ||
+ | # CASE_SENSITIVE=" | ||
+ | |||
+ | # Uncomment the following line to use hyphen-insensitive completion. | ||
+ | # Case-sensitive completion must be off. _ and - will be interchangeable. | ||
+ | # HYPHEN_INSENSITIVE=" | ||
+ | |||
+ | # Uncomment the following line to disable bi-weekly auto-update checks. | ||
+ | # DISABLE_AUTO_UPDATE=" | ||
+ | |||
+ | # Uncomment the following line to change how often to auto-update (in days). | ||
+ | # export UPDATE_ZSH_DAYS=13 | ||
+ | |||
+ | # Uncomment the following line to disable colors in ls. | ||
+ | # DISABLE_LS_COLORS=" | ||
+ | |||
+ | # Uncomment the following line to disable auto-setting terminal title. | ||
+ | # DISABLE_AUTO_TITLE=" | ||
+ | |||
+ | # Uncomment the following line to enable command auto-correction. | ||
+ | # ENABLE_CORRECTION=" | ||
+ | |||
+ | # Uncomment the following line to display red dots whilst waiting for completion. | ||
+ | # COMPLETION_WAITING_DOTS=" | ||
+ | |||
+ | # Uncomment the following line if you want to disable marking untracked files | ||
+ | # under VCS as dirty. This makes repository status check for large repositories | ||
+ | # much, much faster. | ||
+ | # DISABLE_UNTRACKED_FILES_DIRTY=" | ||
+ | |||
+ | # Uncomment the following line if you want to change the command execution time | ||
+ | # stamp shown in the history command output. | ||
+ | # You can set one of the optional three formats: | ||
+ | # " | ||
+ | # or set a custom format using the strftime function format specifications, | ||
+ | # see 'man strftime' | ||
+ | # HIST_STAMPS=" | ||
+ | |||
+ | # Would you like to use another custom folder than $ZSH/ | ||
+ | # ZSH_CUSTOM=/ | ||
+ | |||
+ | # Which plugins would you like to load? | ||
+ | # Standard plugins can be found in ~/ | ||
+ | # Custom plugins may be added to ~/ | ||
+ | # Example format: plugins=(rails git textmate ruby lighthouse) | ||
+ | # Add wisely, as too many plugins slow down shell startup. | ||
+ | #plugins=( | ||
+ | # git nmap github web-search | ||
+ | #) | ||
+ | plugins=(git github common-aliases dirhistory sudo nmap web-search python pip urltools copyfile encode64 history colored-man-pages ubuntu) | ||
+ | |||
+ | source $ZSH/ | ||
+ | |||
+ | # User configuration | ||
+ | |||
+ | # export MANPATH="/ | ||
+ | |||
+ | # You may need to manually set your language environment | ||
+ | # export LANG=en_US.UTF-8 | ||
+ | |||
+ | # Preferred editor for local and remote sessions | ||
+ | if [[ -n $SSH_CONNECTION ]]; then | ||
+ | | ||
+ | else | ||
+ | | ||
+ | fi | ||
+ | |||
+ | # Compilation flags | ||
+ | # export ARCHFLAGS=" | ||
+ | |||
+ | # ssh | ||
+ | # export SSH_KEY_PATH=" | ||
+ | |||
+ | # Set personal aliases, overriding those provided by oh-my-zsh libs, | ||
+ | # plugins, and themes. Aliases can be placed here, though oh-my-zsh | ||
+ | # users are encouraged to define aliases within the ZSH_CUSTOM folder. | ||
+ | # For a full list of active aliases, run `alias`. | ||
+ | # | ||
+ | # Example aliases | ||
+ | # alias zshconfig=" | ||
+ | # alias ohmyzsh=" | ||
+ | alias zshconf=" | ||
+ | alias ohmyzsh=" | ||
+ | # | ||
+ | </ | ||