# Tmux trick

cheatsheet (opens new window)

# Open new window or split pane with the same directory

bind c new-window      -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

# Use tmuxp

Use tmuxp to freeze and load a session with config file(json or yaml).

# Install

pip install --user tmuxp

# Load

tmuxp load ./mysession.yaml
# or
tmuxp load my-session

If load from .tmuxp.yaml or .tmuxp.json in project

tmuxp load path/to/my/project/

Load multiple session

tmuxp load session1 session2

# Freeze a session to a config

tmuxp freeze session-name

# Use tmux-mem-cpu-load

# Install

git clone https://github.com/thewtex/tmux-mem-cpu-load.git
cd tmux-mem-cpu-load
cmake .
make
sudo make install

# Add config

set -g status-interval 2
set -g status-right-length 60
set -g status-right "#[fg=black,bg=green]#(tmux-mem-cpu-load -m 0 -a 0 -g 0 )"