From 21a1fd09d50ea20ca91a9301eefe80093b090a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czy=C5=BC?= Date: Tue, 23 Apr 2024 23:35:57 +0200 Subject: [PATCH] tmux mods --- home-manager/features/cli/zsh/default.nix | 3 +-- home-manager/features/tmux.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/home-manager/features/cli/zsh/default.nix b/home-manager/features/cli/zsh/default.nix index b1489bd..825433c 100644 --- a/home-manager/features/cli/zsh/default.nix +++ b/home-manager/features/cli/zsh/default.nix @@ -39,8 +39,7 @@ in { [[ ! -f ${./p10k.zsh} ]] || source ${./p10k.zsh} eval "$(zoxide init --cmd cd zsh)" if [ -x "$(command -v tmux)" ] && [ -n "$DISPLAY" ] && [ -z "$TMUX" ]; then - # exec tmux new-session -A -s $USER >/dev/null 2>&1 - exec tmux new -AD -t main -s main + exec tmux new-session -A -s $USER >/dev/null 2>&1 fi ''; }; diff --git a/home-manager/features/tmux.nix b/home-manager/features/tmux.nix index ee80b52..2da88eb 100644 --- a/home-manager/features/tmux.nix +++ b/home-manager/features/tmux.nix @@ -13,6 +13,26 @@ yank ]; extraConfig = '' + # reattach userspaces + set -g default-command "reattach-to-user-namespace -l zsh" + + # history limit + set -g history-limit 5000 + + # increase repeat time + set -g repeat-time 1000 + + # decrese command delay + set -sg escape-time 1 + + # faster key repetition + set -s escape-time 0 + + setw -g aggressive-resize on + + # reload tmux while using tmux + bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!" + # Shift Alt vim keys to switch windows bind -n M-H previous-window bind -n M-L next-window @@ -25,6 +45,8 @@ # Open panes in current directory bind '"' split-window -v -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}" + + ''; }; }