改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里