Feat: tmux config + plugin manager

This commit is contained in:
2023-04-26 23:45:28 +03:00
parent 6126827503
commit 74df61ed1d
4 changed files with 72 additions and 26 deletions

3
.gitmodules vendored
View File

@@ -26,3 +26,6 @@
url = https://github.com/cheat/cheatsheets.git
ignore = dirty
[submodule "tmux/tpm"]
path = config/tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm.git

View File

@@ -3,3 +3,5 @@
git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git dotbot-brew
git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git dotbot-include
git submodule add --name cheat-community -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
git submodule add --name tmux/tpm -f https://github.com/tmux-plugins/tpm.git config/tmux/plugins/tpm

View File

@@ -2,44 +2,81 @@
#
# Contains configuration from the follwing sources:
# - https://tmuxguide.readthedocs.io/en/latest/tmux/tmux.html
# -
# - https://github.com/dreamsofcode-io/tmux/blob/main/tmux.conf
# unbind default prefix and set it to ctrl-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
set-option -sa terminal-overrides ",xterm*:Tc"
# make delay shorter
# Mouse support
set -g mouse on
# Make delay shorter
set -sg escape-time 0
# Set <prefix> to Control + Space
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
#### key bindings ####
# reload config file
bind r source-file ~/.dotfiles/config/tmux/tmux.conf \; display "tmux.conf reloaded!"
# quickly open a new window
bind N new-window
# synchronize all panes in a window
bind y setw synchronize-panes
# pane movement shortcuts (same as vim)
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# enable mouse support for switching panes/windows
#set -g mouse-utf8 on
#set -g mouse on
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows 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
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Shift Alt vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
# Reload tmux config with <prefix> + r
bind r source-file ~/.dotfiles/config/tmux/tmux.conf \; display "tmux cfg reloaded!"
# Open a new window with <prefix> + N
bind N new-window
# Plugins related configurations
## https://github.com/catppuccin/tmux
set -g @catppuccin_flavour 'mocha' # latte/frappe/macchiato/mocha
set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'seebi/tmux-colors-solarized'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# set vi-mode
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
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# synchronize all panes in a window
bind y setw synchronize-panes
#### copy mode : vim ####
# set vi mode for copy mode
setw -g mode-keys vi
# copy mode using 'Esc'
unbind [
bind Escape copy-mode
@@ -51,3 +88,6 @@ bind Escape copy-mode
unbind p
bind p paste-buffer
# Finally run the tmux plugin manager
run '~/.config/tmux/plugins/tpm/tpm'