Iterm2は、カスタムフォントと強調表示をサポートする特に使いやすい端末であり、日々の開発を楽しいものにします。
iterm2(Macバージョン)のインストール
brew tap caskroom/cask
brew cask install iterm2 # 或者去网站下载安装包
設定の構成
256色セット
# report terminal type: xterm-256color
iTerm2 -> Preferences -> Profiles -> Terminal
価値の高い色を構成する
mkdir ~/.iterm2 && cd ~/.iterm2
git clone https://github.com/mbadolato/iTerm2-Color-Schemes
# 导入颜色 import...
iTerm2 -> Preferences -> Profiles -> colors
# 选择iTerm2-Color-Schemes下的schemes目录下所有文件
フォントをインストールする
オープンソースフォントをインストールする
brew tap caskroom/fonts
brew cask install font-hack-nerd-font
# 若安装失败,则可能是被墙了,需要加代理
iterm2を構成する
# iTerm2 -> Preferences -> Profiles -> Text -> Font下
# 勾选 Use a different font for non-ASCII text
# 配置字体为 Hack Nerd font
zshをインストールする
brew install zsh
# 默认的shell是bash,需要改为zsh
sudo sh -c "echo $(which zsh) >> /etc/shells"
chsh -s $(which zsh)
# 安装oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
テーマを設定する
# 下载高颜值主题
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
# 配置 ZSH_THEME="powerlevel9k/powerlevel9k"
vim ~/.zshrc
# 应用生效
source ~/.zshrc
その他の構成
vim ~/.zshrc
POWERLEVEL9K_MODE="nerdfont-complete"
# Customise the Powerlevel9k prompts
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh dir vcs newline status)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
プラグインの推奨
車のダンプ
# 安装插件
brew install autojump
# 配置 .zshrc
vim ~/.zshrc
# 添加 plugins = (git autojump)
# 并在.zshrc文件中添加如下一行
# [[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
# 应用生效
source ~/.zshrc
zsh-autosuggestions
# 安装插件
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
# 配置 .zshrc
vim ~/.zshrc
# 添加 plugins = (git zsh-autosuggestions)
# 应用生效
source ~/.zshrc
zsh-syntax-highlighting
# 安装插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# 配置 .zshrc
vim ~/.zshrc
# 添加 plugins = (git zsh-syntax-highlighting)
# 应用生效
source ~/.zshrc
レンダリング
一般的なショートカットキー
# 移动到行首
Ctrl + a
# 移动到行末
Ctrl + e
# 删除到行首
Ctrl + u
# 删除到行末
Ctrl + k
# 上一条命令
Ctrl + p
# 历史命令
Ctrl + r