Oh My Zsh is a delightful, open source, community-driven framework for manag" />

成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

CentOS 7 安裝配置 ohmyzsh

Tecode / 2277人閱讀

摘要:如果有網(wǎng)絡(luò)代理可以直接直接使用以下命令安裝。安裝命令行字體,解決命令行亂碼問題。在執(zhí)行完上面命令之后需要注銷用戶重新登錄或者重啟電腦。終端重啟之后會自動加載的配置文件。

ohmyzsh

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...

安裝 ohmyzsh

# 安裝必要軟件
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

# 更換默認(rèn) 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

# 注銷用戶重新登錄或者重啟電腦
  1. 因?yàn)閲鴥?nèi)網(wǎng)絡(luò)原因,導(dǎo)致在安裝過程中訪問下載 Github 資源的速度不是很理想,所以在這里選擇了手動安裝。如果有網(wǎng)絡(luò)代理可以直接直接使用以下命令安裝。

    MethodCommand
    curlsh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    wgetsh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    fetchsh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  2. 安裝命令行字體,解決命令行亂碼問題。

    使用 agnoster 等主題時(shí)會出現(xiàn)亂碼,所以需要安裝命令行字體。

    推薦字體:Powerline fonts Cascadia Code 。 其中 Cascadia (Code|Mono) PL 包含 Powerline fonts。

    powerline

    cascadia-code

  3. 在執(zhí)行完上面命令之后需要注銷用戶重新登錄或者重啟電腦。終端重啟之后會自動加載 zsh 的配置文件。

配置 ohmyzsh

下面是 我的 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

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/125974.html

相關(guān)文章

  • 打造Win10下完美Linux體驗(yàn)(WSL2+WindowsTerminal+oh-my-zsh),

    摘要:以管理員身份打開分別輸入輸入完成后重啟電腦,以完成安裝并更新到。將設(shè)置為默認(rèn)版本在微軟商店內(nèi)下載分發(fā)版,這里我下載的是。且被視為管理員,能夠運(yùn)行管理命令。 目錄 ...

    孫淑建 評論0 收藏0
  • IPFS安裝與概覽

    摘要:安裝與概覽由于我使用的實(shí)現(xiàn)為,所以首先要安裝配置環(huán)境。六安裝輔助工具和,前者是一個桌面客戶端,后者是一個瀏覽器插件,可以在及等瀏覽器上安裝。你可以新開一個終端使用下等功能好了,本次對的安裝配置到此結(jié)束,后續(xù)會更新更多內(nèi)容。 IPFS安裝與概覽 由于我使用的IPFS實(shí)現(xiàn)為go-ipfs,所以首先要安裝配置Golang環(huán)境。 我使用的系統(tǒng)為Ubuntu18.04,后面所有操作均在此系統(tǒng)下完...

    leanxi 評論0 收藏0
  • Centos 7 安裝Nginx-yum方式

    摘要:前言是一個高性能的和反向代理服務(wù)器,也是一個服務(wù)器。??梢园l(fā)現(xiàn)已經(jīng)安裝到本機(jī)了。步驟反向代理是一個很方便的反向代理,配置反向代理可以參考。需要指出的是的,使用反向代理需要打開網(wǎng)絡(luò)訪問權(quán)限。結(jié)論本文演示了下安裝,配置服務(wù)等。 前言 Nginx (engine x) 是一個高性能的 HTTP 和反向代理服務(wù)器,也是一個 IMAP/POP3/SMTP 服務(wù)器。。 本例演示 CentOS 7 ...

    objc94 評論0 收藏0

發(fā)表評論

0條評論

最新活動
閱讀需要支付1元查看
<