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 'git@github.com:user/plugin'
	# set -g @plugin 'git@bitbucket.com: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不同版本, 配置可能不相同, 根据自己使用的版本搜索处理

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