Install tmux for macos

brew install tmux

Install tmux for ubuntu

sudo apt-get install tmux -y

Config file in tmux

Config file is located at
~/.tmux.conf

Leader key in tmux

By default, leader key is Ctrl+b (Press Ctrl and b)
It will activate more tmux function

Install plugin manager for tmux

Install plugin for tmux

+ Add plugin in config file
+ update source file with
tmux source ~/.tmux.conf
+ Run install
Ctrl+b I (capital I)
Or use this command

tmux mode and how to access these mode

Copy mode : Ctrl+b [

Create a new session with tmux

tmux new -s name_of_session

Access session with tmux

tmux a -t name_of_session

List all session with tmux

tmux ls
or use those command below to last and choose another session
Ctrl+b w (list all windows)
or
Ctrl+b s (list all session)

Create / delete a windows with tmux

To create a new window
Ctrl+b c

To delete a window
Ctrl+b &

To switch between 2 windows
Ctrl+b l

Create / delete a pane with tmux

Use this command to create a new pane
Ctrl+b % : create a new vertical pane
Ctrl+b ” : create a new horizontal pane

To delete a pane:
Ctrl+b x

To move between pane
Ctrl+b arrow-key (up/down/left/right)

Resize pane with tmux

Try those command
tmux resize-pane -R
tmux resize-pane -L
tmux resize-pane -U
tmux resize-pane -D

Copy and paste in tmux

Use the plugin
set -g @plugin ‘tmux-plugins/tmux-yank’

Or use the following method
Access Copy mode : Ctrl+b [
Use arrow key to go to the position where you want to start copying
Use Ctrl+Space to start copying
Use Ctrl+c or y to copy / Or use Alt+w or Ctrl+w to copy to tmux buffer
Use Ctrl+] to paste

More reference for a better understanding of tmux

https://www.seanh.cc/2020/12/27/copy-and-paste-in-tmux/

https://www.rockyourcode.com/copy-and-paste-in-tmux/

Bài viết khác

Build for global scale: AFK scale cube and basic rule to build an application for global scale

REF https://akfpartners.com/growth-blog/scale-cube

PostgreSQL : subquery, CTE

What is subquery in PostgreSQL? In PostgreSQL, a subquery is a query that is nested inside another query. The subquery is executed first, and its results are used as input to the outer query. Subqueries can be used in various contexts, such as in the SELECT, WHERE, and HAVING clauses of a query. For example, […]

Optimize SQL : rule and todo list

Some rule and todo list to Optimize SQL REF https://www.pgmustard.com/blog/indexing-best-practices-postgresql

PostgreSQL Compound indexes

What is Compound indexes in PostgreSQL? A compound index (also known as a composite index or a multi-column index) refers to an index that is created on two or more columns of a table. It allows PostgreSQL to quickly find rows that match a query condition based on the values in multiple columns, which can […]

Use AWS to deploy your applications and services

Amazon Web Services (AWS) is a cloud computing platform that provides a wide range of services to help businesses and individuals build and deploy applications in the cloud. AWS offers a variety of services such as compute, storage, databases, networking, security, and more. In this guide, we will walk through the steps to get started […]

Use docker to run go project

Docker is a powerful tool that enables developers to create, deploy and run applications in a containerized environment. Using Docker to run Go projects has many advantages, including the ability to isolate your application from the underlying operating system, simplifying the deployment process, and allowing for greater scalability and flexibility. In this guide, we will […]