个人使用的 Shell 环境搭建

自从用了远程开发机,天天和命令行打交道,一套属于自己的 shell 配置已经刻不容缓,否则工作效率太低了。

现在

我自己搞了一个 dotfiles 仓库,专门用来一键初始化机器。

git clone https://github.com/Smith-Cruise/dotfiles.git

然后执行如下命令:

# install prepared software
bash install.sh

# enter zsh shell
zsh

# setup zsh plugins and theme
zsh setup.sh

过去,仅供参考

ZSH

  1. 安装 zsh:sudo apt install zsh
  2. 安装:sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
  3. 安装主题【可选】:git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
  4. 启用主题【可选】:设置 .zhsrc 中的 ZSH_THEME="powerlevel10k/powerlevel10k"
  5. 安装 zsh-autosuggestions:git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  6. 安装 zsh-syntax-highlighting:git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  7. 开启插件:编辑 .zshrc 中的 plugins=(git extract zsh-autosuggestions zsh-syntax-highlighting)

TMUX

  1. 安装 oh my tmux:cd ~git clone https://github.com/gpakosz/.tmux.gitln -s -f .tmux/.tmux.confcp .tmux/.tmux.conf.local .
  2. 设置 .tmux.conf.local 中的配置:tmux_conf_new_window_retain_current_path=true
  3. 不要启用: set -g mouse on

两个不常用的 tmux 命令

tmux new -s session-name

ctrl + b + , tmux rename window

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
搜索