Oh My Zsh is a delightful, open source, community-driven framework for manag" />
摘要:如果有網絡代理可以直接直接使用以下命令安裝。安裝命令行字體,解決命令行亂碼問題。在執行完上面命令之后需要注銷用戶重新登錄或者重啟電腦。終端重啟之后會自動加載的配置文件。
Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout...
# 安裝必要軟件
yum install -y wget curl rh-git zsh vim
# 克隆 ohmyzsh 倉庫
git clone --depth=1 https://hub.fastgit.org/ohmyzsh/ohmyzsh.git /usr/share/oh-my-zsh
# 安裝 zsh 插件
git clone --depth=1 https://hub.fastgit.org/zsh-users/zsh-syntax-highlighting.git /usr/share/zsh/plugins/zsh-syntax-highlighting
git clone --depth=1 https://hub.fastgit.org/zsh-users/zsh-completions.git /usr/share/zsh/plugins/zsh-completions
git clone --depth=1 https://hub.fastgit.org/zsh-users/zsh-autosuggestions.git /usr/share/zsh/plugins/zsh-autosuggestions
git clone --depth=1 https://hub.fastgit.org/zsh-users/zsh-history-substring-search.git /usr/share/zsh/plugins/zsh-history-substring-search
# 備份 zsh 配置文件(.zshrc)
cp ~/.zshrc ~/.zshrc.bak
# 生成 zsh 配置文件(.zshrc)
cp /usr/share/oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
# 更換默認 shell
# chsh -s $(which zsh)
# echo "exec zsh" >> .bashrc
chsh -s /bin/zsh
# 解決命令行亂碼問題
git clone --depth=1 https://hub.fastgit.org/powerline/fonts.git
cd fonts && bash install.sh
cd ..
rm -rf fonts
# 注銷用戶重新登錄或者重啟電腦
因為國內網絡原因,導致在安裝過程中訪問下載 Github 資源的速度不是很理想,所以在這里選擇了手動安裝。如果有網絡代理可以直接直接使用以下命令安裝。
Method | Command |
---|---|
curl | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
wget | sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
fetch | sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
使用 agnoster
等主題時會出現亂碼,所以需要安裝命令行字體。
推薦字體:Powerline fonts
Cascadia Code
。 其中 Cascadia (Code|Mono) PL
包含 Powerline fonts
。
下面是 我的 zsh 配置文件(.zshrc)。
# Path to your oh-my-zsh installation.
export ZSH="/usr/share/oh-my-zsh"
# Case-sensitive completion.
CASE_SENSITIVE="true"
# Disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Disable auto-setting terminal title.
DISABLE_AUTO_TITLE="true"
# Disable marking untracked files under VCS as dirty.
DISABLE_UNTRACKED_FILES_DIRTY="true"
# History.
HIST_STAMPS="yyyy-mm-dd"
# Themes
# See https://github.com/ohmyzsh/ohmyzsh/wiki
ZSH_THEME="agnoster"
# Would you like to use another custom folder than $ZSH/custom?
ZSH_CUSTOM=/usr/share/zsh
## Plugins section: Enable fish style features
# Use Auto suggestions
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# Use completions
source /usr/share/zsh/plugins/zsh-completions/zsh-completions.plugin.zsh
# Use syntax highlighting
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Use history substring search
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
# bind UP and DOWN arrow keys to history substring search
zmodload zsh/terminfo
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
bindkey ^[[A history-substring-search-up
bindkey ^[[B history-substring-search-down
# Plugins
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins
plugins=(extract git docker-compose git-flow git-hubflow git-prompt gitignore zsh-syntax-highlighting zsh-completions zsh-autosuggestions zsh-history-substring-search)
source $ZSH/oh-my-zsh.sh
# Aliases.
source ~/.aliases
# Environment variables.
source ~/.exports
# Functions.
source ~/.functions
# dircolors.
if [ -x "$(command -v dircolors)" ]; then
eval "$(dircolors -b ~/.dircolors)"
fi
# You may need to manually set your language environment
# export LANG=zh_CN.UTF-8
## Options section
setopt correct # Auto correct mistakes
setopt extendedglob # Extended globbing. Allows using regular expressions with *
setopt nocaseglob # Case insensitive globbing
setopt rcexpandparam # Array expension with parameters
setopt nocheckjobs # Dont warn about running processes when exiting
setopt numericglobsort # Sort filenames numerically when it makes sense
setopt nobeep # No beep
setopt appendhistory # Immediately append history instead of overwriting
setopt histignorealldups # If a new command is a duplicate, remove the older one
setopt autocd
# enable substitution for prompt
setopt prompt_subst # if only directory path is entered, cd there.
zstyle :completion:* matcher-list m:{a-zA-Z}={A-Za-z} # Case insensitive tab completion
zstyle :completion:* list-colors "${(s.:.)LS_COLORS}" # Colored completion (different colors for dirs/files/etc)
zstyle :completion:* rehash true # automatically find new executables in path
# Speed up completions
zstyle :completion:* accept-exact *(N)
zstyle :completion:* use-cache on
zstyle :completion:* cache-path ~/.zsh/cache
HISTFILE=~/.zhistory
HISTSIZE=1000
SAVEHIST=500
#export EDITOR=/usr/bin/nano
#export VISUAL=/usr/bin/nano
WORDCHARS=${WORDCHARS///[&.;]} # Dont consider certain characters part of the word
## Keybindings section
bindkey -e
bindkey ^[[7~ beginning-of-line # Home key
bindkey ^[[H beginning-of-line # Home key
if [[ "${terminfo[khome]}" != "" ]]; then
bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line
fi
bindkey ^[8~ end-of-line # End key
bindkey ^[[F end-of-line # End key
if [[ "${terminfo[kend]}" != "" ]]; then
bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line
fi
bindkey ^[[2~ overwrite-mode # Insert key
bindkey ^[[3~ delete-char # Delete key
bindkey ^[[C forward-char # Right key
bindkey ^[[D backward-char # Left key
bindkey ^[[5~ history-beginning-search-backward # Page up key
bindkey ^[[6~ history-beginning-search-forward # Page down key
# Navigate words with ctrl+arrow keys
bindkey ^[Oc forward-word #
bindkey ^[Od backward-word #
bindkey ^[[1;5D backward-word #
bindkey ^[[1;5C forward-word #
bindkey ^H backward-kill-word # delete previous word with ctrl+backspace
bindkey ^[[Z undo
# Theming section
autoload -U compinit colors zcalc
compinit -d
colors
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/125974.html
摘要:以管理員身份打開分別輸入輸入完成后重啟電腦,以完成安裝并更新到。將設置為默認版本在微軟商店內下載分發版,這里我下載的是。且被視為管理員,能夠運行管理命令。 目錄 ...
摘要:前言是一個高性能的和反向代理服務器,也是一個服務器。。可以發現已經安裝到本機了。步驟反向代理是一個很方便的反向代理,配置反向代理可以參考。需要指出的是的,使用反向代理需要打開網絡訪問權限。結論本文演示了下安裝,配置服務等。 前言 Nginx (engine x) 是一個高性能的 HTTP 和反向代理服務器,也是一個 IMAP/POP3/SMTP 服務器。。 本例演示 CentOS 7 ...
閱讀 3514·2023-04-25 20:09
閱讀 3720·2022-06-28 19:00
閱讀 3035·2022-06-28 19:00
閱讀 3058·2022-06-28 19:00
閱讀 3133·2022-06-28 19:00
閱讀 2860·2022-06-28 19:00
閱讀 3015·2022-06-28 19:00
閱讀 2611·2022-06-28 19:00