commit 21c30d2a1040dd77d8d1734e4f27471c0d28e4c8 Author: xesc Date: Sat Dec 9 16:35:56 2023 +0100 initial commit diff --git a/tmux-sessionizer b/tmux-sessionizer new file mode 100755 index 0000000..86048ec --- /dev/null +++ b/tmux-sessionizer @@ -0,0 +1,23 @@ +#!/usr/bin/bash + +HOMEDIR=~ +SEL_DIR=$(find ~ -not -path "*/.*" -type d -print 2>/dev/null | fzf) +SEL_NAME=$(basename "$SEL_DIR") + +if [[ -z "$SEL_DIR" ]] || [[ -n "$SEL_DIR" ]] && [[ "$SEL_DIR" == "$HOMEDIR" ]]; then + RET=0 + while [[ $RET -eq 0 ]]; do + read -p "New session name: " SEL_NAME + if [[ -z "$SEL_NAME" ]]; then + clear + else + RET=1 + fi + done +fi + +SEL_NAME=$(tr "[:lower:]" "[:upper:]" <<< "$SEL_NAME") + +tmux new-session -d -s "$SEL_NAME" -c "$SEL_DIR" +tmux switch-client -t "$SEL_NAME" + diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..192cca6 --- /dev/null +++ b/tmux.conf @@ -0,0 +1,78 @@ +# Tmux configuration file + +set-option -s escape-time 0 + +unbind C-b +unbind C-Space +set -g prefix C-Space +bind C-Space send-prefix + +unbind Q +bind Q source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display "Reloaded config" + +unbind '\' +unbind - +unbind % +unbind '"' + +bind '\' split-window -h -c '#{pane_current_path}' +bind - split-window -v -c '#{pane_current_path}' + +bind c new-window -c '#{pane_current_path}' + +bind -r ^ last-window +bind -r h select-pane -L +bind -r j select-pane -D +bind -r k select-pane -U +bind -r l select-pane -R + +bind -r H resize-pane -L 4 +bind -r J resize-pane -D 4 +bind -r K resize-pane -U 4 +bind -r L resize-pane -R 4 + +bind -r n next-window +bind -r p previous-window + +bind X confirm kill-window +bind T confirm kill-session + +bind -r M set -g mouse + +set-window-option -g mode-keys vi +bind -T copy-mode-vi v send-keys -X begin-selection +bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' + +bind -r S run-shell "tmux new-window ~/.config/tmux/tmux-sessionizer" + +set -g pane-border-indicators colour +set -g pane-active-border-style fg="#d8a657",bg=default +set -g pane-border-style fg="#1d2021",bg=default +set -g pane-border-lines single + +set -g popup-border-style fg="#d8a657",bg=default +set -g popup-border-lines rounded + +set -g clock-mode-colour "#fabd2f" + +set -g display-panes-active-colour "#d8a657" +set -g display-panes-time 10000 + +set -g window-size largest +set -g renumber-windows on + +set -g base-index 1 +setw -g pane-base-index 1 + +set -g status-position bottom +set -g status-style bg="#1d2021",fg="#d4be98",bold +set -g status-keys vi +set -g status-left-length 100 +# set -g status-right '#{?client_prefix,#[fg=#000000]#[bg=#fabd2f]#[bold] PREFIX ,}' +set -g status-right '#{?client_prefix,#[fg=#000000]#[bg=#fabd2f]#[bold]  ,}' +set -wg window-status-current-style bg="#d8a657",fg="#1d2021" + +set -g cursor-style blinking-underline + +set -g focus-events on +set -g visual-bell off