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

相關文章:

翻譯: