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就到了某個工作環境,斷電了也不怕。

alacritty tmux

最後, tmux彌補了alacritty沒有tab的問題, 開發者也是建議結合tmux使用, tmux使用時還是是可以滾動查看命令輸出的, 快捷鍵爲 Ctrl-b, [ 左中括號, 推出滾動模式按q即可

相關文章:

翻譯: