Skip to content

Instantly share code, notes, and snippets.

@mcollina
Created August 7, 2023 16:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcollina/3596f6e06b1ecabfcb402695b3ff655e to your computer and use it in GitHub Desktop.
Save mcollina/3596f6e06b1ecabfcb402695b3ff655e to your computer and use it in GitHub Desktop.
My tmux.conf
# set-option -g default-command "reattach-to-user-namespace -l /bin/bash"
set -g default-terminal "screen-256color"
# Pane resizing
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# splitting panes
bind | split-window -h
bind - split-window -v
# moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Setting the prefix from C-b to C-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b
#setting the delay between prefix and command
set -sg escape-time 1
# Ensure that we can send Ctrl-A to other apps
bind C-a send-prefix
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Center the window list
set -g status-justify centre
# enable vi keys.
setw -g mode-keys vi
# enable xterm keys
set-window-option -g xterm-keys on
# setup mac os x clipboard
# set -g default-command "reattach-to-user-namespace -l /bin/bash"
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy; tmux display 'copied'"
bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste); tmux paste-buffer; tmux display 'pasted'"
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
# bind -t vi-copy 'v' begin-selection
# bind -t vi-copy 'y' copy-selection
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe 'reattach-to-user-namespace pbcopy'
#unbind Up
#bind Up new-window -d -n tmp \; swap-pane -s tmp \; select-window -t tmp
#
#unbind Down
#bind Down last-window \; swap-pane -s tmp \; kill-window -t tmp
# source /Users/matteo/.tmuxline.conf
source-file "${HOME}/.tmux-themepack/powerline/block/magenta.tmuxtheme"
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind '%' split-window -h -c "#{pane_current_path}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment