alacritty terminal use

If you use Linux for daily work, you need a light and fast terminal. Terminator feels a bit stuck, and alacritty + tmux is light enough to meet most usage scenarios. With tmux and the tmux-resurrect plug-in, you can quickly enter basic work after power failure or computer restart environment, feel very convenient, save time

1. Installation

It is recommended to install alacritty by cargo directly

1cargo install alacritty

2. tmux plugin configuration

Specific reference: https://github.com/tmux-plugins/tmux-resurrect

My configuration is relatively simple:

 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 'git@github.com:user/plugin'
14# set -g @plugin 'git@bitbucket.com:user/plugin'
15
16# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
17run '~/.tmux/plugins/tpm/tpm'

Create several commonly used sessions, Ctrl-b, Ctrl-s to save the session, next time the computer is turned on, start tmux, Ctrl-b, Ctrl-r, painless and reliable.

3. tmux active window background color setting

The default active window of tmux has no background color, the * star mark is not conspicuous enough, configure the background color:

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

I set the lime color here, as shown in the above configuration, different versions of tmux, the configuration may be different, search and process according to the version you use

4. Example

Keep 4 commonly used sessions, and each session opens a certain number of windows according to its own needs, which is equivalent to keeping several workspaces for a long time (similar to the concept of the operating system desktop environment), instead of using cd to cd, switch to a certain After one session, you have reached a certain working environment, and you are not afraid of power failure.

alacritty tmux

Finally, tmux makes up for the problem that alacritty has no tabs. The developer also recommends using it in combination with tmux. When using tmux, you can still scroll to view the command output. The shortcut key is Ctrl-b, [ left square bracket, press q to launch the scrolling mode

Lastmod: Monday, August 28, 2023

Translations: