本文将来还会持续进行补充。
自从用了远程开发机,天天和命令行打交道,一套属于自己的 shell 配置已经刻不容缓,否则工作效率太低了。
Zsh
- 安装 zsh:
sudo apt install zsh
- 安装:
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
- 安装主题【可选】:
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
- 启用主题【可选】:设置
.zhsrc
中的ZSH_THEME="powerlevel10k/powerlevel10k"
- 安装 zsh-autosuggestions:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
- 安装 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
中的plugins=(git extract zsh-autosuggestions zsh-syntax-highlighting)
TMUX
- 安装 oh my tmux:
cd ~
,git clone https://github.com/gpakosz/.tmux.git
,ln -s -f .tmux/.tmux.conf
,cp .tmux/.tmux.conf.local .
- 设置
.tmux.conf.local
中的配置:tmux_conf_new_window_retain_current_path=true
- 不要启用:
set -g mouse on
两个不常用的 tmux 命令
tmux new -s session-name
ctrl + b + ,
tmux rename window