tmux config with full path for tmux binary

feat/kile-v2
Ricard Illa 2023-02-06 16:55:44 +01:00
parent 6f3e366b36
commit 541a516c0f
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
1 changed files with 9 additions and 8 deletions

View File

@ -1,6 +1,7 @@
{ config, pkgs, ... }:
{
let tmux = "${pkgs.tmux}/bin/tmux";
in {
programs.tmux = {
enable = true;
clock24 = true;
@ -9,7 +10,7 @@
shell = "${pkgs.zsh}/bin/zsh";
extraConfig = ''
set -g default-terminal "tmux-256color"
set-option -sa terminal-overrides ',alacritty:Tc'
# set-option -sa terminal-overrides ',alacritty:Tc'
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
@ -48,7 +49,7 @@
unbind p
bind-key -T copy-mode-vi y \
send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
bind-key p run "xsel -o | ${tmux} load-buffer - ; ${tmux} paste-buffer"
bind c new-window -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
@ -75,11 +76,11 @@
set -g status-right \'\'
set-hook -g 'session-created' 'run-shell -b "if [ \#{session_windows} -eq 1 ]; then tmux set status off; else tmux set status on; fi"'
set-hook -g 'after-new-window' 'run-shell -b "if [ \#{session_windows} -eq 1 ]; then tmux set status off; else tmux set status on; fi; if [ \#{window_panes} -eq 1 ]; then tmux set pane-border-status off; fi"'
set-hook -g 'after-kill-pane' 'run-shell -b "if [ \#{session_windows} -eq 1 ]; then tmux set status off; else tmux set status on; fi; if [ \#{window_panes} -eq 1 ]; then tmux set pane-border-status off; fi"'
set-hook -g 'pane-exited' 'run-shell -b "if [ \#{session_windows} -eq 1 ]; then tmux set status off; else tmux set status on; fi; if [ \#{window_panes} -eq 1 ]; then tmux set pane-border-status off; fi"'
set-hook -g 'after-split-window' 'run-shell -b "if [ \#{window_panes} -gt 1 ]; then tmux set pane-border-status top; fi"'
set-hook -g 'session-created' 'run-shell -b "if [ \#{session_windows} -eq 1 ]; then ${tmux} set status off; else ${tmux} set status on; fi"'
set-hook -g 'after-new-window' 'run-shell -b "if [ \#{session_windows} -eq 1 ]; then ${tmux} set status off; else ${tmux} set status on; fi; if [ \#{window_panes} -eq 1 ]; then ${tmux} set pane-border-status off; fi"'
set-hook -g 'after-kill-pane' 'run-shell -b "if [ \#{session_windows} -eq 1 ]; then ${tmux} set status off; else ${tmux} set status on; fi; if [ \#{window_panes} -eq 1 ]; then ${tmux} set pane-border-status off; fi"'
set-hook -g 'pane-exited' 'run-shell -b "if [ \#{session_windows} -eq 1 ]; then ${tmux} set status off; else ${tmux} set status on; fi; if [ \#{window_panes} -eq 1 ]; then ${tmux} set pane-border-status off; fi"'
set-hook -g 'after-split-window' 'run-shell -b "if [ \#{window_panes} -gt 1 ]; then ${tmux} set pane-border-status top; fi"'
set -g default-command ${pkgs.zsh}/bin/zsh
'';
};