alacritty 终端使用
日常工作使用Linux, 需要一个轻便快捷的终端, Terminator感觉有点卡, alacritty + tmux轻量满足大部分使用场景, tmux加上tmux-resurrect插件,断电或者电脑重启后,都可以快速进入基本工作环境, 感觉很方便, 节约时间
1. 安装
建议直接cargo安装
cargo install alacritty
2. tmux 插件配置
具体参考: https://github.com/tmux-plugins/tmux-resurrect
我的配置比较简单:
➜ cat .tmux.conf
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g default-terminal "xterm-256color"
#set -g status-style bg=black
set -g window-status-current-style bg=lime
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin '[email protected]:user/plugin'
# set -g @plugin '[email protected]:user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
创建好常用的几个session, Ctrl-b, Ctrl-s即可保存session, 下次电脑开机后, 启动tmux, Ctrl-b, Ctrl-r即可, 无痛可靠.
3. tmux 活动window底色设置
tmux默认活动window无底色, *星号标记, 不够显眼, 配置底色:
set -g window-status-current-style bg=lime
我这里设置的是lime色, 上面的配置里面有显示, tmux不同版本, 配置可能不相同, 根据自己使用的版本搜索处理
4. 图示
保留4个常用的session,每个session根据自己需要开启一定个数的windows,这样就相当于长期保留了几个workspace(类似操作系统桌面环境的概念),不用cd来cd去的, 切换到某个session就到了某个工作环境,断电了也不怕。
最后, tmux弥补了alacritty没有tab的问题, 开发者也是建议结合tmux使用, tmux使用时还是是可以滚动查看命令输出的, 快捷键为 Ctrl-b, [ 左中括号, 推出滚动模式按q即可