Tmux

Logging Plugin

git clone https://github.com/tmux-plugins/tmux-logging ~/.tmux/tmux-logging
  • Prefix+D : Detach

  • tmux ls [List Sessions]

  • tmux attach -t [Name of session]

  • tmux -S [Name of session]

    • -S : socket path [ Specify a full alternative path to the server socket. eg: /.dev/dev_sess]

  • Prefix + c [New tab]

  • Ctrl+ R [Recursive search]

  • Prefix + Alt + Shift + P [Save history]

  • Prefix + [ [Move up/down screen using Page up/down]

  • tmux kill-server [Kills all tmux sessions]

  • Less /root/tmux-history- [Tmux history]

COPY MODE

  • Prefix + [ : To enable scrolling

  • PressCTRL + Space -> Then Arrow-keys for navigationto start copying.

  • Use arrow keys to go to the end of text you want to copy. PressCTRL + w to copy into Tmux buffer.

  • Press Prefix + ] to paste

SCREEN SPLITTING

  • Prefix + -

  • Prefix + |

  • [Hold Prefix] + '-' [To Resize]

  • [Hold Prefix] + '+' [To Resize]

  • Prefix + , [Rename session]

Config File

  • Location : ~/.tmux.conf

  • Tips

    • Detach: Ctrl+ A -> d

# scrollback size
set -g history-limit 10000

##Keybinds

#Don't rename windows automatically
set -g allow-rename off

#Changing prefix to Ctrl+C
unbind C-b
set -g prefix C-a

#Set first window to index 1(not 0)
set -g base-index 1
set -g pane-base-index 1

#Split pames using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %

#Logging
run-shell ~/.tmux/tmux-logging/logging.tmux

tmux source-file ~/.tmux.conf

Last updated