linux-config/files/dotfiles/tmux/tmux.conf

137 lines
4.4 KiB
Text
Raw Permalink Normal View History

2021-11-18 08:59:41 +00:00
# Send prefix - Ctrl+a
2021-10-22 11:45:20 +00:00
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
# Esc fast
set -s escape-time 0
# For gapless window numbers
set-option -g renumber-windows on
# Use Ctrl+[hjkl] to switch panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
2022-11-06 13:59:01 +00:00
# <prefix>-h|l|Left|Right - move windows
2021-11-18 08:59:41 +00:00
bind-key h previous-window
2021-12-13 13:53:19 +00:00
bind-key Left previous-window
2021-11-18 08:59:41 +00:00
bind-key l next-window
2021-12-13 13:53:19 +00:00
bind-key Right next-window
2022-11-06 13:59:01 +00:00
2021-10-22 11:45:20 +00:00
# Mouse mode
setw -g mouse on
2022-11-06 13:59:01 +00:00
2021-10-22 11:45:20 +00:00
# Set easier window split keys
bind-key | split-window -h -c "#{pane_current_path}"
bind-key \\ split-window -h -c "#{pane_current_path}"
2021-10-22 11:45:20 +00:00
bind-key - split-window -v -c "#{pane_current_path}"
# close window with <prefix-q>
bind-key q kill-window
# refresh window with <prefix-e>
2022-01-13 17:29:48 +00:00
bind-key e respawn-window -k -c "#{pane_current_path}"
# <prefix>-j/k for up down (useful to move between history commands)
bind-key k send-keys Up
bind-key j send-keys Down
2021-10-22 11:45:20 +00:00
# Easy config reload
bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "~/.config/tmux/.tmux.conf reloaded."
# Lookup the cheat sheet <prefix>-i
bind-key i run-shell "tmux neww -n '🏳️ CHEATER\! 😎' ~/.shellconfig/cheat.sh"
# Open Workspace
bind-key o run-shell "tmux neww -n '🖥 Workspace Manager' ~/.shellconfig/workspaces/open_workspace.sh"
# Add/Save Workspace
bind-key a run-shell "tmux neww -n '🖥 Workspace Manager' 'cd #{pane_current_path} && ~/.shellconfig/workspaces/add_workspace.sh'"
# Delete (x) Workspace
bind-key x run-shell "tmux neww -n '🖥 Workspace Manager' ~/.shellconfig/workspaces/delete_workspace.sh"
# Change git branches fast <prefix>-b
#bind-key b send-keys "gitB" C-m
bind-key b run-shell "tmux neww -n ' Git Branches' 'cd #{pane_current_path} && (zsh -c \"source ~/.shellconfig/common.sh && gitB\" || sleep 1)' "
# Git add + fzf
bind-key g run-shell "tmux neww -n ' 🞥 Git Add' 'cd #{pane_current_path} && (git ls-files -m -o --exclude-standard | fzf -m --print0 --reverse --header \"🞥 Select files to stage. use [tab] for multi selection\" --preview \"bat --diff --color=always --style=numbers,changes,grid {}\" | xargs -0 -o -t git add)'"
# Get weather (Prefix-!)
bind-key ! run-shell "tmux neww -n '🌡️ Weather Peek' '(echo \"Fetching Weather...\" && curl -s \"https://wttr.in/?lang=en\") | bat --paging always -p'"
2021-10-22 11:45:20 +00:00
############################
# Themes
###########################
# Nord theme
# set -g @plugin "arcticicestudio/nord-tmux"
2021-10-22 11:45:20 +00:00
# Gruvbox Theme
# set -g @plugin 'egel/tmux-gruvbox'
# set -g @tmux-gruvbox 'dark' # or 'light'
############################
# Plugins
###########################
2021-10-22 11:45:20 +00:00
# Tmux yank (For clipboard integration)
set -g @plugin 'tmux-plugins/tmux-yank'
# Mouse select to clipboard
set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary'
set -g @plugin 'catppuccin/tmux'
# vim
set -g @plugin 'christoomey/vim-tmux-navigator'
2021-10-22 11:45:20 +00:00
# Buffer line size (History)
set -g history-limit 5000
# Use Ctrl-K to clear buffer
bind -n C-k clear-history
# Default Colors
set-option -sa terminal-overrides ",xterm*:Tc"
2021-11-18 08:59:41 +00:00
# Home/End support
bind -n End send-key C-e
bind -n Home send-key C-a
set -g @catppuccin_flavour 'macchiato' # latte, frappe, macchiato, mocha
set -g @catppuccin_window_left_separator ""
set -g @catppuccin_window_right_separator " "
set -g @catppuccin_window_middle_separator " █"
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#W"
set -g @catppuccin_status_modules_right "directory user host session"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator ""
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_host_icon ""
set -g @catppuccin_directory_text "#{pane_current_path}"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.config/tmux/plugins/tpm/tpm'
# set copy mode vim
set-window-option -g mode-keys vi
# keybindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# Enter/Exit compy mode
bind-key v copy-mode
bind-key -T copy-mode-vi Escape send-keys -X cancel