From fb792171c4f2d2a5ad45516b0639beb83b640364 Mon Sep 17 00:00:00 2001 From: Sahid Rahman Date: Sun, 18 Dec 2022 11:33:29 +0700 Subject: [PATCH] add tmux config --- .config/tmux/.tmux.conf | 90 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .config/tmux/.tmux.conf diff --git a/.config/tmux/.tmux.conf b/.config/tmux/.tmux.conf new file mode 100644 index 0000000..483dc22 --- /dev/null +++ b/.config/tmux/.tmux.conf @@ -0,0 +1,90 @@ +# ----------------------------------------------------------------------------- +# This config is targeted for tmux 3.0+. +# +# Read the "Plugin Manager" section (bottom) before trying to use this config! +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# Global options +# ----------------------------------------------------------------------------- + +# Set a new prefix / leader key. +set -g prefix C-a +bind C-a send-prefix + +# Allow opening multiple terminals to view the same session at different sizes. +setw -g aggressive-resize on + +# Remove delay when switching between Vim modes. +set -sg escape-time 0 + +# Allow Vim's FocusGained to work when your terminal gains focus. +# Requires Vim plugin: https://github.com/tmux-plugins/vim-tmux-focus-events +set -g focus-events on + +# Add a bit more scroll history in the buffer. +set -g history-limit 50000 + +# Enable color support inside of tmux. +set -g default-terminal "xterm-256color" +set -ga terminal-overrides ",*256col*:Tc" + +# Send xterm compatible control arrow keys so they work with Vim. +setw -g xterm-keys on + +# Ensure window titles get renamed automatically. +setw -g automatic-rename + +# Ensure window index numbers get reordered on delete. +set-option -g renumber-windows on + +# Start windows and panes index at 1, not 0. +set -g base-index 1 +setw -g pane-base-index 1 + +# Enable full mouse support. +set -g mouse on + +# Various colors. +set -g status-style fg=colour244 +set -g window-status-current-style fg=colour222 +set -g pane-border-style fg=colour240 +set -g pane-active-border-style fg=colour243 + +set -g status-left '' +set -g status-left-length 0 +set -g status-right '' +set -g status-right-length 0 + +# Display a clock on the bottom right of the status bar. +#set -g status-right '%a %Y-%m-%d %H:%M' +#set -g status-right-length 20 + +# ----------------------------------------------------------------------------- +# Key bindings +# ----------------------------------------------------------------------------- + +# Unbind default keys +# unbind C-b +unbind '"' +unbind % + +# Reload the tmux config. +bind-key r source-file ~/.tmux.conf + +# Split panes. +bind-key b split-window -v +bind-key v split-window -h + +# Move around panes with ALT + arrow keys. +bind-key -n M-Up select-pane -U +bind-key -n M-Left select-pane -L +bind-key -n M-Down select-pane -D +bind-key -n M-Right select-pane -R + +setw -g mode-keys vi + +bind -T copy-mode-vi v send -X begin-selection +bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel --clipboard" +bind P paste-buffer +bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xsel --clipboard"