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/

About the Author

Trần Huy

View all author's posts

Bài viết khác

So sánh giữa gorm vs go-pg vs bun

Trong thế giới phát triển Golang, việc tương tác với cơ sở dữ liệu là một phần không thể thiếu của hầu hết các ứng dụng. Để đơn giản hóa quy trình này, các thư viện ORM (Object-Relational Mapping) ra đời, giúp các nhà phát triển thao tác với database thông qua các đối tượng […]

So sánh GORM vs go-pg vs Bun

Cộng đồng GORM Là ORM phổ biến nhất trong cộng đồng Go. Có nhiều tài liệu, ví dụ, StackOverflow câu trả lời, và nhiều package hỗ trợ mở rộng. Nhiều developer đã từng dùng Gorm. go-pg Từng rất phổ biến khi chỉ dùng PostgreSQL, nhưng đang bị Bun thay thế dần. Ít được duy trì […]

clean architecture golang

  1.Clean Architecture là gì? Clean Architecture là một kiến trúc phần mềm được đề xuất bởi Robert C. Martin (Uncle Bob) nhằm mục tiêu tách biệt rõ ràng giữa các tầng trong ứng dụng, giúp mã nguồn dễ bảo trì, mở rộng, và kiểm thử. 2.Tổng quan kiến trúc Entity (Domain Model): Là tầng […]

Tìm hiểu Hexagonal Architecture

Hexagonal Architecture là gì? Hexagonal Architecture (tên gọi khác là ports and adapters architecture), là một mẫu kiến trúc được dùng trong thiết kế phần mềm. Nó hướng tới việc xây dựng ứng dụng xoay quanh business/application logic mà không ảnh hưởng hoặc phụ thuộc bởi bất kì thành phần bên ngoài, mà chỉ giao […]

Sử dụng Request/Response trong ứng dụng RESTful mô hình MVC

DTO là gì? DTO (Data Transfer Object) là một object trung gian dùng để truyền dữ liệu giữa client – server hoặc giữa các service trong ứng dụng web/API theo kiến trúc RESTful API. DTO chỉ chứa các thông tin cần thiết mà client hoặc service khác cần (ví dụ: Login Form chỉ cần thông […]

Docker

Docker là gì? Docker là một nền tảng mã nguồn mở cho phép bạn đóng gói, phân phối và chạy ứng dụng bên trong các “container” – những môi trường ảo nhẹ, cô lập nhưng vẫn chia sẻ nhân hệ điều hành của máy chủ. Khái niệm then chốt ở đây là “containerization”: thay vì […]