ubuntu安装zsh和tmux

改dns

windows的host在C:\Windows\System32\drivers\etc\host
linux的host在/etc/hosts

把下面这段复制到host里

140.82.114.3  github.com
108.160.167.165 github.global.ssl.fastly.net
185.199.110.153 assets-cdn.github.com

linux下可以选择

sudo sh -c 'sed -i "/# GitHub520 Host Start/Q" /etc/hosts && curl https://raw.hellogithub.com/hosts >> /etc/hosts'

接着刷新dns
windows

ipconfig /flushdns

linux

sudo apt install nscd
sudo systemctl restart nscd

安装字体

sudo apt-get install ttf-mscorefonts-installer fontconfig -y

下载下面这4个
MesloLGS NF Regular.ttf
MesloLGS NF Bold.ttf
MesloLGS NF Italic.ttf
MesloLGS NF Bold Italic.ttf

sudo mkdir -p /usr/share/fonts/MesloLGS
sudo cp *.ttf /usr/share/fonts/MesloLGS
sudo chmod -R 777 /usr/share/fonts/MesloLGS

sudo fc-cache -fv

点终端的preferences
在这里插入图片描述
修改字体
在这里插入图片描述

仓库地址

zsh

sudo apt-get install -y zsh git-core
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
cd ~/.oh-my-zsh
zsh oh-my-zsh.sh
chsh -s `which zsh`

然后应该要输入密码
然后

reboot

打开终端
选择0
在这里插入图片描述

cp ~/.zshrc ~/.zshrc.orig
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
chsh -s $(which zsh)

然后

source ~/.zshrc

不过zsh和平常的环境有一点差别,具体的可以看下面3个

conda

如果你有配置conda,可能会发现没有前面的(base)了
所以

前面是conda所在的路径,记得修改

~/miniconda3/bin/conda init zsh
source ~/.zshrc

设置更新时间

vim ~/.zshrc

这里根据提示,然后去掉某一条注释
在这里插入图片描述
保存,退出
然后

source ~/.zshrc

cuda

如果你装了cuda
可以从~/.bashrc中复制这3句到 ~/.zshrc
在这里插入图片描述
保存,退出
然后

source ~/.zshrc

qt

和刚刚的cuda是一个道理
在这里插入图片描述
保存,退出
然后

source ~/.zshrc

powerlevel10k主题

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
vim ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k" 

在这里插入图片描述
保存,退出
然后

source ~/.zshrc

然后会叫你设置主题,可以根据自己的喜好设置

设置完了以后想改,可以用这个命令重新设置

p10k configure

自动补全

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
vim ~/.zshrc

改这
把zsh-autosuggestions添加上去
在这里插入图片描述
保存,退出
然后

source ~/.zshrc

语法高亮

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
vim ~/.zshrc

改这
把zsh-syntax-highlighting添加上去
在这里插入图片描述
保存,退出
然后

source ~/.zshrc

补全conda

git clone https://github.com/esc/conda-zsh-completion ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/conda-zsh-completion
vim ~/.zshrc

plugins部分加上conda-zsh-completion
末尾加上

autoload -U compinit && compinit

保存,退出
然后

source ~/.zshrc

更新

omz update

tmux

https://github.com/gpakosz/.tmux

sudo apt-get install -y tmux
cd ~
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .

常用命令

<prefix>表示ctrl +a或者ctrl +b
<prefix> c表示ctrl +a或者ctrl +b,然后按c
<prefix> C-c表示ctrl +a或者ctrl +b,然后按ctrl +c

会话

创建一个名为session_name的会话

tmux new -s session_name

列出所有会话

tmux ls

进入已经创建好的名为session_name的会话

tmux attach -t session_name

销毁会话

tmux kill-session -t session_name

panes

起到一个终端中,分屏的作用

<prefix> -垂直划分pane
<prefix> _水平划分pane
<prefix> arrow切换pane,arrow表示方向键
<prefix> m开/关鼠标模式
C-d关闭pane,当最后一个没了的话,就会关闭整个会话

<prefix> C-arrow改变pane大小,arrow表示方向键
鼠标模式下,直接拖动边框也可以改变pane大小

在这里插入图片描述

windows

一个session中可以有多个windows,相当于win的桌面1,桌面2…

<prefix> c创建window
<prefix> n跳转第n个window
<prefix> &退出当前window, 也可以输入exit
<prefix> :,输入move-window -t session_name可以将当前window移动到session_name里

更多命令参考:
tmux2: Productive Mouse-Free Development

输出历史命令

<prefix> :,输入capture-pane -S -3000,其中3000表示3000行
接着,<prefix> :,输入save-buffer filename,命令就会存储到filename里

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Nightmare004

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值