mirror of
https://github.com/zoriya/flake.git
synced 2026-08-15 18:43:42 +00:00
Remake tmux config
This commit is contained in:
+45
-29
@@ -3,39 +3,55 @@
|
||||
(pkgs.writeShellScriptBin "tmux-sessionizer" (builtins.readFile ./tmux-sessionizer.sh))
|
||||
];
|
||||
|
||||
xdg.configFile."tmux/tmux.conf".text = ''
|
||||
unbind C-b
|
||||
set -g prefix C-t
|
||||
bind -N "Send the prefix key through to the application" t send-prefix
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
terminal = "tmux-256color";
|
||||
|
||||
set -g mouse on
|
||||
set -g status off
|
||||
set -g set-clipboard on
|
||||
set -g focus-events on
|
||||
mouse = true;
|
||||
focusEvents = true;
|
||||
aggressiveResize = true;
|
||||
clock24 = true;
|
||||
|
||||
set-window-option -g mode-keys vi
|
||||
bind-key v copy-mode
|
||||
bind-key -T copy-mode-vi i send -X cancel
|
||||
bind-key -T copy-mode-vi v send -X begin-selection
|
||||
bind-key -T copy-mode-vi V send -X select-line
|
||||
bind-key -T copy-mode-vi y send -X copy-selection -x
|
||||
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection -x
|
||||
historyLimit = 50000;
|
||||
# default is 500 which makes vim's esc slow, we do not want 0 because it won't be able to read osc
|
||||
escapeTime = 50;
|
||||
|
||||
bind-key [ copy-mode \; send-keys -X previous-prompt
|
||||
bind-key ] copy-mode \; send-keys -X next-prompt
|
||||
bind-key -T copy-mode-vi [ send-keys -X previous-prompt
|
||||
bind-key -T copy-mode-vi ] send-keys -X next-prompt
|
||||
keyMode = "vi";
|
||||
prefix = "C-t";
|
||||
|
||||
bind-key f run-shell "tmux neww tmux-sessionizer"
|
||||
bind-key C-h run-shell "tmux-sessionizer ~/projects/kyoo"
|
||||
bind-key C-s run-shell "tmux-sessionizer ~/projects/flake"
|
||||
bind-key C-n run-shell "tmux-sessionizer ~/projects/blog"
|
||||
plugins = with pkgs.tmuxPlugins; [fzf-tmux-url];
|
||||
|
||||
run-shell ${pkgs.tmuxPlugins.sensible.rtp}
|
||||
run-shell ${pkgs.tmuxPlugins.fzf-tmux-url.rtp}
|
||||
extraConfig =
|
||||
#tmux
|
||||
''
|
||||
set -g status off
|
||||
set -s set-clipboard on
|
||||
|
||||
# https://github.com/tmux/tmux/issues/4162
|
||||
set -gu default-command
|
||||
set -g default-shell "$SHELL"
|
||||
'';
|
||||
# from tmux-sensible
|
||||
set -g display-time 4000
|
||||
set -g status-interval 5
|
||||
|
||||
bind-key v copy-mode
|
||||
bind-key -T copy-mode-vi i send -X cancel
|
||||
bind-key -T copy-mode-vi v send -X begin-selection
|
||||
bind-key -T copy-mode-vi V send -X select-line
|
||||
bind-key -T copy-mode-vi y send -X copy-selection -x
|
||||
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection -x
|
||||
bind-key -T copy-mode-vi p { refresh-client -l; run -d0.05; paste-buffer; send -X cancel }
|
||||
|
||||
bind-key [ copy-mode \; send-keys -X previous-prompt
|
||||
bind-key ] copy-mode \; send-keys -X next-prompt
|
||||
bind-key -T copy-mode-vi [ send-keys -X previous-prompt
|
||||
bind-key -T copy-mode-vi ] send-keys -X next-prompt
|
||||
|
||||
bind-key f run-shell "tmux neww tmux-sessionizer"
|
||||
bind-key C-h run-shell "tmux-sessionizer ~/projects/kyoo"
|
||||
bind-key C-s run-shell "tmux-sessionizer ~/projects/flake"
|
||||
bind-key C-n run-shell "tmux-sessionizer ~/projects/blog"
|
||||
|
||||
# suspend inner tmux (to allow nested sessions)
|
||||
bind -T root @ { set prefix None; set key-table off }
|
||||
bind -T off C-@ { set -u prefix; set -u key-table }
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user