So lets just get started for setting up zsh
, tmux
, and Alacritty
.
Alacritty Installation
Alacritty is fast and awesome terminal emulator with multi-platform support. My best choice an alternative for urxvt
and terminator
. I still considering for setting up st
.
For archlinux user, install alacritty
via pacman
.
|
|
Setup the alacritty configuration directory.
|
|
- Alacritty configuration file
alacritty.yml
Below is the simple configuration I found on GitHub.
|
|
Fonts configuration fonts.yml
.
|
|
- Color schema configuration
color.yml
- for more color schema.
|
|
ZSH and Prezto
- Install ZSH.
|
|
Setup user to use ZSH as default shell.
|
|
- Install Prezto - it’s zsh framework just like
oh-my-zsh
but more simple and fast. Also support all ofoh-my-zsh
plugins.
Clone repository.
|
|
Create new zsh configuration needed using the following command.
|
|
Now restart your terminal and you will get zsh
shell with prezto
.
Prezto comes with additional command prompt
for choosing theme.
|
|
More info about prezto.
Tmux Configuration
- Install tmux via
pacman
.
|
|
- Tmux configuration
~/.tmux.conf
.
# Use C-s (control and s key at the same time) as the prefix key
unbind C-b
set -g prefix C-s
bind-key -r C-s send-prefix
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
bind-key -n C-h select-pane -L
bind-key -n C-j select-pane -D
bind-key -n C-k select-pane -U
bind-key -n C-l select-pane -R
set-option -g default-terminal "screen-256color"
set-option -g status-keys "emacs"
bind-key - split-window -v -c '#{pane_current_path}'
bind-key '"' split-window -h -c '#{pane_current_path}'
# Fine adjustment (1 or 2 cursor cells per bump)
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
# Coarse adjustment (5 or 10 cursor cells per bump)
bind -n C-Left resize-pane -L 10
bind -n C-Right resize-pane -R 10
bind -n C-Down resize-pane -D 5
bind -n C-Up resize-pane -U 5
bind c new-window -c "#{pane_current_path}"
set -g base-index 1
set -g renumber-windows on
set -g mouse on
setw -g mode-keys vi
bind-key b break-pane -d
bind-key C-j choose-tree
set-option -g status-left-length 100
# setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c" \; display-message "copied to system clipboard"
# Update default binding of `Enter` to also use copy-selection
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c" \; display-message "copied to system clipboard"
# copy from tmux to clipboard
#bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -r" \; display-message "Copied to selection"
#bind-key -T copy-mode-vi Y send-keys -X copy-pipe "xclip -r -selection clipboard" \; display-message "Copied to clipboard"
#bind-key C-p run-shell "xclip -o | tmux load-buffer - && tmux paste-buffer"
set -g @yank_selection 'primary'
#set -g @themepack 'powerline/block/green'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
#set -g @plugin 'jimeh/tmux-themepack'
set -g @plugin "arcticicestudio/nord-tmux"
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# 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 -b '~/.tmux/plugins/tpm/tpm'
For this configuration I use tmux theme nord-tmux
- I dont need any additional status-bar on tmux.
Learn more on this tmux course - free and thanks.
Setup zsh and tmux as default shell
Using prezto is simple.
|
|
Add the tmux plugin - below is my tmux plugin I use.
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'colorize' \
'tmux' \
'history-substring-search' \
'prompt' \
'git' \
'pacman' \
'ssh' \
'vagrant' \
'autojump'
Now go to the bottom of the line and uncomment the tmux options.
#
# Tmux
#
# Auto start a session when Zsh is launched in a local terminal.
zstyle ':prezto:module:tmux:auto-start' local 'yes'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:tmux:auto-start' remote 'yes'
# Integrate with iTerm2.
# zstyle ':prezto:module:tmux:iterm' integrate 'yes'
# Set the default session name:
zstyle ':prezto:module:tmux:session' name 'NAME-YOUR-SESSION'
and viola is done.