終端從沒如此爽快-oh my zsh

Linux系統現在有很多人去嘗試接觸了,但根深蒂固的win操作使得Linux操作起來很不順手,最終都放棄了。win給我們的體驗就是一切都是界面化的,我們可以很容易的去接受一個新的軟件。但是Linux的命令行卻是系統操作最高效的交互。現在win10上也預裝了powershell,並且也引進了wsl,方便了在win10 上進行命令操作。powershell配合chocolate也可以實現如Linux操作一樣安裝軟件。

今天我們就來看一下Linux下終端如何實現快捷、高效的使用

1、我使用的是manjaro Linux19版本,進入終端


終端從沒如此爽快-oh my zsh

2、終端輸入

<code>sudo pacman -S zsh
#  下載oh my zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"/<code>

3、以上已經在你的Linux系統上安裝了oh my zsh ,接下來我們設置主題

<code>sudo vim ~/.zshrc
#如果你使用的是gnome桌面,預裝了gedit,也可以是
sudo gedit  ~/.zshrc
#找到ZSH_THEME 行,直接輸入你的主題名就可以了,這裡我選擇了ys
#ZSH_THEME = "ys"/<code>

4、安裝zsh-syntax-highlighting(高亮)、zsh-autosuggestions(補全)插件

首先安裝git

<code>sudo pacman -S git
#高亮zsh-syntax-highlighting 高亮你的zsh可用命令插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
#補全命令插件zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
下載過程中如果出現403,多次使用命令即可/<code>

下一步我們終端繼續輸入

<code>sudo vim  ~./zshrc/<code>
<code># If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="/home/haoshiwen/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# 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://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="ys"#====================》這裡修改你的終端主題

# 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 ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# 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="true"

# 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:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
#==========》以下插件行將下載好的高亮、補全插件寫進去就可以了
plugins=(git
zsh-autosuggestions 
zsh-syntax-highlighting
autojump
)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$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
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# 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="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
source /home/haoshiwen/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/haoshiwen/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/haoshiwen/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/haoshiwen/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/haoshiwen/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# < conda initialize <
/<code>

囉嗦一句vim修改點擊鍵盤" i "(英文狀態下),完成之後,esc==>:wq(英文狀態下)

終端刷新

<code> source ~/.zshrc /<code>

接下來就體驗不一樣Linux吧


分享到:


相關文章: