alacritty 终端使用

日常工作使用 Linux, 需要一个轻便快捷的终端, Terminator 感觉有点卡, alacritty + tmux 轻量满足大部分使用场景, tmux 加上 tmux-resurrect 插件,断电或者电脑重启后,都可以快速进入基本工作环境, 感觉很方便, 节约时间

1. 安装

建议直接 cargo 安装

1cargo install alacritty

2. tmux 插件配置

具体参考: https://github.com/tmux-plugins/tmux-resurrect

我的配置比较简单:

 1➜ cat .tmux.conf
 2# List of plugins
 3set -g @plugin 'tmux-plugins/tpm'
 4set -g @plugin 'tmux-plugins/tmux-sensible'
 5set -g @plugin 'tmux-plugins/tmux-resurrect'
 6set -g default-terminal "xterm-256color"
 7#set -g status-style bg=black
 8set -g window-status-current-style bg=lime
 9
10# Other examples:
11# set -g @plugin 'github_username/plugin_name'
12# set -g @plugin 'github_username/plugin_name#branch'
13# set -g @plugin '[email protected]:user/plugin'
14# set -g @plugin '[email protected]:user/plugin'
15
16# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
17run '~/.tmux/plugins/tpm/tpm'

创建好常用的几个 session, Ctrl-b, Ctrl-s 即可保存 session, 下次电脑开机后, 启动 tmux, Ctrl-b, Ctrl-r 即可, 无痛可靠.

3. tmux 活动 window 底色设置

tmux 默认活动 window 无底色, *星号标记, 不够显眼, 配置底色:

1set -g window-status-current-style bg=lime

我这里设置的是 lime 色, 上面的配置里面有显示, tmux 不同版本, 配置可能不相同, 根据自己使用的版本搜索处理

4. 图示

保留 4 个常用的 session,每个 session 根据自己需要开启一定个数的 windows,这样就相当于长期保留了几个 workspace(类似操作系统桌面环境的概念),不用 cd 来 cd 去的, 切换到某个 session 就到了某个工作环境,断电了也不怕。

alacritty tmux

最后, tmux 弥补了 alacritty 没有 tab 的问题, 开发者也是建议结合 tmux 使用, tmux 使用时还是是可以滚动查看命令输出的, 快捷键为 Ctrl-b, [ 左中括号, 推出滚动模式按 q 即可

最后修改于: Monday, August 28, 2023
欢迎关注微信公众号,留言交流。

相关文章:

翻译: