diff --git a/packages/devkit/tmux/config.conf b/packages/devkit/tmux/config.conf deleted file mode 100644 index 7217149..0000000 --- a/packages/devkit/tmux/config.conf +++ /dev/null @@ -1,76 +0,0 @@ - -set -g default-terminal "screen-256color" -set -g base-index 1 -setw -g pane-base-index 1 - -set -g status-keys vi -set -g mode-keys vi - -# rebind main key: C-g -unbind C-b -set -g prefix C-g -bind -N "Send the prefix key through to the application" \ - C-g send-prefix - -set -g mouse on -setw -g aggressive-resize off -setw -g clock-mode-style 12 -set -s escape-time 500 -set -g history-limit 2000 - -set -sg terminal-overrides ",*:RGB" - -set -g renumber-windows on - -# Split panes -bind -T prefix / split-window -v -c "#{pane_current_path}" -bind -T prefix \\ split-window -h -c "#{pane_current_path}" - -# Panes -bind 'h' select-pane -L # move left after prefix -bind 'j' select-pane -D # move down after prefix -bind 'k' select-pane -U # move up after prefix -bind 'l' select-pane -R # move right after prefix - -# Conflicts with neovim -# bind -n 'C-h' select-pane -L # move left -# bind -n 'C-j' select-pane -D # move down -# bind -n 'C-k' select-pane -U # move up -# bind -n 'C-l' select-pane -R # move right - -# bind -r 'S-h' resize-pane -L 5 -# bind -r 'S-j' resize-pane -D 5 -# bind -r 'S-k' resize-pane -U 5 -# bind -r 'S-l' resize-pane -R 5 - -bind '<' swap-pane -D # swap current pane with the next one -bind '>' swap-pane -U # swap current pane with the previous one - -# Windows -bind 'C-h' previous-window # select previous window -bind 'C-l' next-window # select next window -bind 'Tab' last-window # select last window - -bind 'c' new-window -c "${pane_current_path}" # new window - -# Theme -set -g @catppuccin_window_number_position "right" - -set -g @catppuccin_window_default_fill "number" -set -g @catppuccin_window_default_text "#W" - -set -g @catppuccin_window_current_fill "number" -set -g @catppuccin_window_current_text "#W" - -set -g @catppuccin_status_modules_right "directory user host session" -set -g @catppuccin_status_fill "icon" -set -g @catppuccin_status_connect_separator "no" - -set -g @catppuccin_directory_text "#{pane_current_path}" - -set -g @resurrect-strategy-nvim 'session' - -set-option -g mouse on - -set -g @continuum-restore 'on' - diff --git a/packages/devkit/tmux/default.nix b/packages/devkit/tmux/default.nix deleted file mode 100644 index e03b06f..0000000 --- a/packages/devkit/tmux/default.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - symlinkJoin, - makeWrapper, - pkgs, - lib, - fetchFromGitHub, - tmux ? pkgs.tmux, - fzf ? pkgs.fzf, - shell ? pkgs.zsh, -}: let - # colors = import ../colors.nix; - sessionizer = pkgs.writeShellScriptBin "sessionizer" '' - function tmux() { ${lib.getExe tmux} "$@"; } - function fzf() { ${lib.getExe fzf} "$@"; } - - ${builtins.readFile ./sessionizer.sh} - ''; - - plugins = with pkgs.tmuxPlugins; [ - sensible - - better-mouse-mode - continuum - resurrect - - (catppuccin.overrideAttrs (_: { - src = fetchFromGitHub { - owner = "guz013"; - repo = "frappuccino-tmux"; - rev = "4255b0a769cc6f35e12595fe5a33273a247630aa"; - sha256 = "0k8yprhx5cd8v1ddpcr0dkssspc17lq2a51qniwafkkzxi3kz3i5"; - }; - })) - ]; - - cfg = pkgs.writeText "tmux.conf" '' - ${(lib.concatMapStringsSep "\n\n" (p: '' - run-shell ${p.rtp} - '') - plugins)} - - set -g default-shell "${lib.getExe shell}" - - ${builtins.readFile ./config.conf} - - bind -T prefix g run-shell "tmux neww ${lib.getExe sessionizer}" - ''; -in - symlinkJoin ({ - paths = [tmux]; - nativeBuildInputs = [makeWrapper]; - postBuild = '' - wrapProgram $out/bin/tmux \ - --add-flags '-f' --add-flags '${cfg}' - ''; - } - // {inherit (tmux) name pname man meta;}) diff --git a/packages/devkit/tmux/sessionizer.sh b/packages/devkit/tmux/sessionizer.sh deleted file mode 100644 index ff75bde..0000000 --- a/packages/devkit/tmux/sessionizer.sh +++ /dev/null @@ -1,41 +0,0 @@ -# "Chat is MIT" -# https://github.com/ThePrimeagen/.dotfiles/blob/master/bin/.local/scripts/tmux-sessionizer - -SEARCH_PATHS=("$HOME/.projects" "$HOME/.job" "$HOME/.work") - -function tmux_sessionizer() { - local paths=() - - for p in "${SEARCH_PATHS[@]}"; do - if [ -d "$p" ]; then - paths+=("$p") - fi - done - - local selected="" - if [[ $# -eq 1 ]]; then - selected="$1" - else - selected="$(find "${paths[@]}" -mindepth 1 -maxdepth 1 -type d | fzf)" - fi - - if [[ -z "$selected" ]]; then - exit 0 - fi - - local selected_name="$(basename "$selected" | tr . _)" - local tmux_running="$(pgrep tmux)" - - if [[ -z "$TMUX" ]] && [[ -z "$tmux_running" ]]; then - tmux new-session -s "$selected_name" -c "$selected" - exit 0 - fi - - if ! tmux has-session -t="$selected_name" 2>/dev/null; then - tmux new-session -ds "$selected_name" -c "$selected" - fi - - tmux switch-client -t "$selected_name" -} - -tmux_sessionizer "$@"