| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- { pkgs
- , config
- , lib
- , ...
- }:
- let
- isDarwin = pkgs.stdenv.isDarwin;
- reattach-to-user-namespace = lib.getExe' pkgs.reattach-to-user-namespace "reattach-to-user-namespace";
- lazygit = lib.getExe pkgs.lazygit;
- shell = lib.getExe config.programs.fish.package;
- in
- {
- home.packages = with pkgs; [ eza ];
- programs.sesh = {
- enable = true;
- settings = {
- dir_length = 2;
- default_session.startup_command = "nvim -c \"lua vim.defer_fn(function() require('telescope.builtin').find_files() end, 0)\"";
- default_session.preview_command = "eza --all --git --icons --color=always {}";
- };
- };
- programs.fzf.tmux.enableShellIntegration = true;
- programs.tmux = {
- sensibleOnTop = true;
- baseIndex = 1;
- clock24 = true;
- enable = true;
- escapeTime = 10;
- keyMode = "vi";
- focusEvents = true;
- mouse = true;
- prefix = "C-b";
- shell = "${lib.getExe config.programs.fish.package}";
- terminal = "tmux-256color";
- plugins = with pkgs.tmuxPlugins; [
- tmux-select-pane-no-wrap
- vim-tmux-navigator
- yank
- {
- plugin = kanagawa;
- extraConfig = ''
- set -g status-position top
- set -g @kanagawa-theme 'dragon'
- set -g @kanagawa-refresh-rate 60
- set -g @kanagawa-show-left-icon window
- set -g @kanagawa-show-battery true
- set -g @kanagawa-show-powerline true
- # set -g @kanagawa-show-left-sep
- # set -g @kanagawa-show-right-sep
- # set -g @kanagawa-show-left-sep
- # set -g @kanagawa-show-right-sep
- # set -g @kanagawa-show-left-sep
- # set -g @kanagawa-show-right-sep
- # set -g @kanagawa-show-left-sep
- # set -g @kanagawa-show-right-sep
- set -g @kanagawa-show-left-sep
- set -g @kanagawa-show-right-sep
- set -g @kanagawa-show-location false
- set -g @kanagawa-ignore-window-colors true
- '';
- }
- ];
- extraConfig = ''
- ${lib.optionalString isDarwin ''
- # sensible plugin assumes $SHELL is /bin/sh
- # --- Darwin-Specific Settings (Raw Tmux Commands) ---
- # This block is only included if the system is Darwin
- set-option -g default-command "${reattach-to-user-namespace} -l $SHELL"
- ''}
- # split windows on the current path
- unbind %
- unbind '"'
- bind-key % split-window -h -c '#{pane_current_path}'
- bind-key '"' split-window -v -c '#{pane_current_path}'
- # resize pane with vim motion keys
- bind-key -r h resize-pane -L 1
- bind-key -r l resize-pane -R 1
- bind-key -r j resize-pane -D 1
- bind-key -r k resize-pane -U 1
- # move between tmux windows
- bind-key -n C-e select-window -t :1
- bind-key -n C-a select-window -t :2
- # some display popups
- bind-key -n C-g display-popup -d "#{pane_current_path}" -w 80% -h 80% -E "${lazygit}"
- bind-key -n C-t display-popup -d "#{pane_current_path}" -w 75% -h 75% -E "${shell}"
- # sesh
- bind-key -n C-s run-shell "sesh connect \"$(
- sesh list --icons | fzf --tmux 80%,70% \
- --no-sort --ansi --border-label ' sesh ' --prompt '⚡ ' \
- --header ' ^a all ^t tmux ^g configs ^x zoxide ^d tmux kill ^f find' \
- --bind 'tab:down,btab:up' \
- --bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list --icons)' \
- --bind 'ctrl-t:change-prompt(🪟 )+reload(sesh list --icons -t)' \
- --bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list --icons -c)' \
- --bind 'ctrl-x:change-prompt(📁 )+reload(sesh list --icons -z)' \
- --bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
- --bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list --icons)' \
- --preview-window 'right:55%' \
- --preview 'sesh preview {}' \
- -- --ansi
- )\""
- # kill pane
- bind-key x kill-pane
- set -g detach-on-destroy off
- '';
- };
- }
|