From 01898f5cbfe551cf29afbcdc9aa9cd74cebaf1c2 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 27 Mar 2025 09:55:53 +0100 Subject: [PATCH] made visual mode in tmux work as in neovim --- .tmux.conf | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 3cc9f5f..1cfb720 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -8,10 +8,23 @@ set-option -sa terminal-overrides ",xterm-256color*:Tc" # ─< Enable mouse support (for scrolling, resizing, etc.) >─────────────────────────────── set -g mouse on +# Set the prefix key to C-Space instead of default C-b +unbind C-b + # ─< set the prefix to "C-Space" >──────────────────────────────────────────────────────── set -g prefix C-Space bind C-Space send-prefix bind h copy-mode +bind -T copy-mode-vi v send -X begin-selection + +# Reload tmux configuration without restarting tmux +bind r source-file ~/.tmux.conf \; display-message "Config reloaded!" + +# ─< Use C-h and C-l to switch between panes >──────────────────────────────────────────── +bind -n C-h select-pane -L +bind -n C-l select-pane -R +bind -n C-f resize-pane -Z + # Ensure that when prefix is pressed, the mode indicator is shown set -g mode-keys vi # Use vi keybindings in copy mode @@ -119,17 +132,6 @@ set -g @tmux-gruvbox-right-status-y '󰃭 %d.%m.%Y' # Date format (e.g., 30.01. # Key Bindings # ─────────────────────────────────────────────────────────────────────────── -# Set the prefix key to C-Space instead of default C-b -unbind C-b - -# ─< Use C-h and C-l to switch between panes >──────────────────────────────────────────── -bind -n C-h select-pane -L -bind -n C-l select-pane -R -bind -n C-f resize-pane -Z - -# Reload tmux configuration without restarting tmux -bind r source-file ~/.tmux.conf \; display-message "Config reloaded!" - # # ────────────────────────────────────< status configs >──────────────────────────────────── # ───────────────────────────────────────< plugins >─────────────────────────────────────