mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
- VIM: Keybindings for better coding - Gitignore in common is now a hardlinked to the root one - NVIM: Bash Alias added for Nvim - VIM: settings added from VIM-sensible and Primeagen - NVIM: Moved autocommands, keybindings & configurations specific to NVIM to lua/config - Wezterm, tmux configured. - Generic: Configurations moved inside $HOME/.config/ directory - Generic: All aliases renamed to similar names. - Generic: Relevant aliases added for reaching git root
124 lines
4.0 KiB
Bash
124 lines
4.0 KiB
Bash
# Keybinding Summary
|
|
#========================================================
|
|
# Rename Session -> <alt-a> $
|
|
# Rename Tab -> <alt-a> ,
|
|
# Next/prev tab -> <alt-a> n/p
|
|
# H-split/V-split -> <alt-a> s/v
|
|
# Resize Pane -> <alt-a> leave alt -> h,j,k,l (repeat press)
|
|
# Switch Pane -> <ctrl-h,j,k,l>
|
|
# Enter copy mode -> <alt-a>[
|
|
# Exit copy mode -> <enter>
|
|
# Reload tmux.conf -> <alt-a> r
|
|
|
|
# More at: https://tmuxcheatsheet.com
|
|
|
|
# TODO: Figure out how to save multiple sessions and resurrect them later
|
|
|
|
#========================================================
|
|
# KEY BINDINGS
|
|
#========================================================
|
|
# Change Tmux leader key to -> <alt-a>
|
|
unbind C-b
|
|
set -g prefix M-a
|
|
bind-key M-a send-prefix
|
|
|
|
# Kill current session with q
|
|
bind q confirm-before kill-session
|
|
|
|
# Intuitive split bindings to | & -
|
|
unbind %
|
|
bind s split-window -h
|
|
unbind '"'
|
|
bind v split-window -v
|
|
|
|
# Open panes in the current directory
|
|
bind - split-window -v -c "#{pane_current_path}"
|
|
bind | split-window -h -c "#{pane_current_path}"
|
|
|
|
# Use <leader> repeated(h,j,k,l)s to resize current pane
|
|
bind -r h resize-pane -L
|
|
bind -r l resize-pane -R
|
|
bind -r k resize-pane -U
|
|
bind -r j resize-pane -D
|
|
|
|
# Use Vim Navigations to copy text from the NON-vim panes
|
|
# Enable Tmux copy mode with <leader>[ -> Then use Vim navigations
|
|
bind-key -T copy-mode-vi "v" send -X begin-selection
|
|
bind-key -T copy-mode-vi "y" send -X copy-selection
|
|
unbind -T copy-mode-vi MouseDragEnd1Pane # Enable mouse selection as well
|
|
|
|
# From Tmux-sensible Plugin
|
|
bind C-p previous-window
|
|
bind C-n next-window
|
|
bind C-a send-prefix
|
|
bind a last-window
|
|
bind r source-file ~/.config/tmux/tmux.conf \; display-message "Tmux config reloaded."
|
|
|
|
# Change resurrect keys to <alt-s>(Save) & <alt-r>(Resurrect)
|
|
set -g @resurrect-save "M-s"
|
|
set -g @resurrect-restore "M-r"
|
|
|
|
#========================================================
|
|
# OPTIONS
|
|
#========================================================
|
|
set -g set-clipboard on # Use system clipboard
|
|
setw -g mode-keys vi
|
|
set-window-option -g mode-keys vi
|
|
|
|
# From tmux-sensible plugin
|
|
set -g display-time 1000 # Display message for 1s
|
|
set -g history-limit 50000 # Increase scrollback buffer
|
|
set -g mouse on # Mouse mode
|
|
set -s escape-time 0 # Address Vim switching delay
|
|
set -g status-interval 5 # Refresh status every 5s (default 15s)
|
|
set -g focus-events on # Enable focus event
|
|
setw -g aggressive-resize on # For grouped sessions
|
|
|
|
# Resurrection Options
|
|
set -g @resurrect-capture-pane-contents "on"
|
|
set -g @resurrect-strategy-nvim "session"
|
|
set -g @resurrect-dir "$HOME/.config/tmux/resurrect"
|
|
|
|
#========================================================
|
|
# APPEARANCE
|
|
#========================================================
|
|
# Start window numbers at 1 to match keyboard order with tmux window order
|
|
set -g base-index 1
|
|
set -g pane-base-index 1
|
|
set -g renumber-windows on
|
|
set-window-option -g pane-base-index 1
|
|
|
|
# Improve colors
|
|
set -g default-terminal "xterm-256color"
|
|
set-option -sa terminal-overrides ",xterm*:Tc"
|
|
|
|
# Status at top
|
|
set -g status-position top
|
|
|
|
#========================================================
|
|
# PLUGINS
|
|
#========================================================
|
|
run "~/.config/tmux/plugins/tpm/tpm" # Init Tmux Plugin Manager
|
|
|
|
# TODO: Get into Tmux copy stuff when required
|
|
# set -g @plugin 'tmux-plugins/tmux-yank'
|
|
# set -g @plugin "tmux-plugins/tmux-copycat"
|
|
|
|
set -g @plugin "christoomey/vim-tmux-navigator" # sync pane nav with Vim window nav
|
|
set -g @plugin "tmux-plugins/tmux-resurrect" # Persist sessions
|
|
set -g @plugin "tmux-plugins/tmux-continuum" # Auto save sessions every 15mins
|
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
|
set -g @plugin "tmux-plugins/tmux-copycat"
|
|
set -g @plugin "fabioluciano/tmux-tokyo-night"
|
|
|
|
#========================================================
|
|
# PLUGINS Configurations
|
|
#========================================================
|
|
|
|
# Color schemes
|
|
set -g @theme_variation "night"
|
|
set -g @theme_disable_plugins 1
|
|
set -g status-right ""
|
|
|
|
set -g @plugin "tmux-plugins/tpm"
|