初始化 fish 和 tmux 配置
一般来说,拿到一台 Linux 服务器,没有好用的 shell,没有好用的 tmux 配置,用起来很让人头疼。特别是有时候不知道 sudo 密码,但是可以不用密码 sudo,设置默认终端也是很麻烦的一件事情。
下面我就分享一下我的开机配置方案:
脚本如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| sudo apt-get update -y && \ sudo apt install -y software-properties-common
sudo apt-add-repository -y ppa:fish-shell/release-3 && \ sudo apt-get update -y && \ sudo apt-get install -y fish && \ sudo rm /etc/apt/sources.list.d/fish-shell-*
command -v fish | sudo tee -a /etc/shells sudo chsh -s "$(command -v fish)" "${USER}"
sudo apt update -y && sudo apt install tmux cd && git clone https://github.com/gpakosz/.tmux.git && \ ln -s -f .tmux/.tmux.conf && \ cp .tmux/.tmux.conf.local .
|
退出重新 ssh 服务器,或者重新打开终端,即可有一个非常爽 fish+tmux 环境
更改 .tmux.conf 的 tmux prefix 配置
由于 https://github.com/gpakosz/.tmux.git 的 .tmux 配置可以使用 C-b 也可以使用 C-a,但是作为 emacs 终端快捷键使用者,这两个键分别是左移和回到行首,不是很方便,我一般改成 C-x,更改方案是,进入 ~/.tmux.conf,更改下述两行
1 2
| set -g prefix2 C-a # GNU-Screen compatible prefix bind C-a send-prefix -2
|
为
1 2 3 4
| set -g prefix2 C-x # GNU-Screen compatible prefix bind C-x send-prefix -2 set -g prefix C-x # GNU-Screen compatible prefix bind C-x send-prefix
|
即可。