Cheat_Sheet

This blog records my workflow cheat sheet.

Tmux

Tmux is a terminal multiplexer that allows you to access multiple terminal sessions within a single terminal window or remote terminal session.

In tmux, there is a concept of a session, window, and pane.

  • Session: A tmux session is a container for one or more windows.
  • Window: A tmux window occupies the entire screen and may be split into rectangular panes.
  • Pane: A tmux pane is a rectangular part of a window that runs a specific command.

Session, Window and Pane

Here are some basic commands for tmux:

Cli commands

Command Description
tmux new -s session_name Create a new session with the name session_name
tmux a -t session_name Attach to the session session_name
tmux ls List all sessions
tmux kill-session -t session_name Kill the session session_name

Session management

Session management:

Hotkeys Description
Ctrl + A Prefix Default: Ctrl + B
[prefix] s list sessions
[prefix] $ rename the current session
[prefix] ( switch to the previous session
[prefix] ) switch to the next session
[prefix] d detach the current session

Window management:

Hotkeys Description
[prefix] c create a new window
[prefix] & kill the current window
[prefix] n/p move to the next / previous window
[prefix] w list windows
[prefix] f find window
[prefix] , rename the current window

Pane management:

Hotkeys Description
[prefix] | split the current pane vertically Default: -v
[prefix] - split the current pane horizontally Default: -h
[prefix] x kill the current pane
[prefix] z toggle pane zoom
[prefix] { move the current pane to the left

Pane movement:

Hotkeys Description
[prefix] Space toggle between layouts
[prefix] h/j/k/l move to the left/down/up/right pane

Copy mode (Vi mode)

Hotkeys Description
[prefix] [ enter copy mode
[prefix] ] paste the copied text
[prefix] v start selection Default: -[
[prefix] y copy the selected text Default: -]
[prefix] / search forward
[prefix] ? search backward

Neovim

NeoVim is a highly customizable text editor that is based on Vim. It is designed to be more extensible and easier to maintain than Vim.

In Neovim, there is a concept of normal mode, insert mode, and visual mode.

  • Normal mode: The default mode for navigating and editing text.
  • Insert mode: The mode for inserting text.
  • Visual mode: The mode for selecting text.

Neovim


Cheat_Sheet
http://xxblog.net/Computer-Science/Cheat-sheet/
Author
XX
Posted on
July 6, 2024
Updated on
July 7, 2024
Licensed under