Skip to main content

Configurando o tmux

Install plugin manager

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Exemplo config pentest

# UPDATED 29/01/2025 - Krisofferson Marini
# -----
# Inspiration from Ham Vocke
# https://hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# -----
  
# change the prefix from 'C-b' to 'C-a'
# (remap capslock to CTRL for easy access)
unbind C-b
set -g prefix C-a
bind C-a send-prefix
setw -g mode-keys vi

# start with window 1 (instead of 0)
set -g base-index 1

# start with pane 1
set -g pane-base-index 1

# split panes using | and -, make sure they open in the same path
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

unbind '"'
unbind %

# open new windows in the current path
bind c new-window -c "#{pane_current_path}"

# reload config file
bind r source-file ~/.tmux.conf

unbind p
bind p previous-window

# shorten command delay
set -sg escape-time 1

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

# mouse control (clickable windows, panes, resizable panes)
set -g mouse on

# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# Use Shift-arrow keys without prefix key to switch windows
bind -n S-Left  previous-window
bind -n S-Right next-window

# set default terminal mode to 256 colors
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",xterm-256color:Tc"

# allow focus events to get through to applications running in tmux
set -g focus-events on

set -g @plugin 'tmux-plugins/tpm'

set -g @plugin 'b0o/tmux-autoreload'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-logging'
set -g @plugin 'fabioluciano/tmux-tokyo-night'

### Tokyo Night Theme configuration
set -g status-position top
set -g @theme_variation 'night'
set -g @theme_left_separator ''
set -g @theme_right_separator ''
set -g @theme_plugins 'datetime,weather,playerctl,yay'

# Tmux hjkl pane navigator
set -g @plugin 'codxse/tmux-hjkl-pane-navigator'

run '~/.tmux/plugins/tpm/tpm'
tmux source-file ~/.tmux.conf
sudo apt install entr

O plugin tmux-hjkl-pane-navegator muda o comportamento natural do neovim e precisa de ajustes também no neovim, disponíveis aqui: [[Como utilizar o editor VIM#Better Tmux and Neovim integration|Configurando o plugin tmux-navegator no neovim]]