12 Commits

Author SHA1 Message Date
b6fadf5d7b up to date tmux config 2025-07-12 18:49:58 +01:00
44020e6e42 Merge pull request 'chore: remove trying to update tmux folder' (#6) from remove-saving-of-tmux-folder into main
Reviewed-on: #6
2025-07-10 21:19:00 +00:00
82901d8e8a remove trying to update tmux folder 2025-07-10 22:18:29 +01:00
8e29de1602 Merge pull request 'chore: backup tmux config' (#5) from backup-tmux into main
Reviewed-on: #5
2025-07-10 21:15:56 +00:00
fb0d692489 update make file 2025-07-10 22:14:19 +01:00
Luis Freixial
9226005534 backup tmux 2025-07-10 22:06:39 +01:00
99dfae72b6 Merge pull request 'feat: Support tmux' (#4) from tmux into main
Reviewed-on: #4
2025-07-10 21:05:22 +00:00
d0c096047a support tmux 2025-07-10 22:04:38 +01:00
37deb3574f Merge pull request 'chore: change cat to batcat' (#3) from change-cat into main
Reviewed-on: #3
2025-07-10 20:59:03 +00:00
91ef3ea915 change cat to batcat 2025-07-10 21:58:28 +01:00
12f6aca914 Merge pull request 'update-zsh' (#2) from update-zsh into main
Reviewed-on: #2
2025-07-10 20:54:11 +00:00
Luis Freixial
8b49c1b8a5 update-zsh 2025-07-10 21:53:23 +01:00
7 changed files with 237 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: zsh
.PHONY: zsh update-zsh tmux update-tmux
zsh:
@for file in zsh/.[!.]*; do \
@@ -12,4 +12,19 @@ update-zsh:
if [ -f "$$HOME/$$base" ]; then \
cp -v "$$HOME/$$base" "$$file"; \
fi \
done && echo "zsh files updated from home directory" || echo "zsh files not updated from home directory"
done && echo "zsh files updated from home directory" || echo "zsh files not updated from home directory"
tmux:
@if [ -f "$$HOME/.tmux.conf" ]; then \
mv "$$HOME/.tmux.conf" "$$HOME/.tmux.conf.bak"; \
cp tmux/.tmux.conf "$$HOME/.tmux.conf"; \
echo ".tmux.conf copied to home directory"; \
else \
echo ".tmux.conf not found in home directory"; \
fi
update-tmux:
@if [ -f "$$HOME/.tmux.conf" ]; then \
cp "$$HOME/.tmux.conf" tmux/.tmux.conf; \
fi
@echo "tmux files updated from home directory"

128
tmux/.tmux.conf Normal file
View File

@@ -0,0 +1,128 @@
##### ─────────────────────────────────────────────
##### 🎨 Terminal and UI Settings
##### ─────────────────────────────────────────────
# Enable 24-bit RGB color in supported terminals
set-option -sa terminal-overrides ",xterm*:Tc"
# Enable mouse support
set -g mouse on
# Set terminal type (helps with correct rendering in some environments like WSL)
set -s default-terminal 'tmux-256color'
# Set status bar position at the top
set -g status-position top
##### ─────────────────────────────────────────────
##### ⌨️ Prefix and Keybindings
##### ─────────────────────────────────────────────
# Change default prefix from Ctrl-b to Ctrl-Space
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Vim-style pane navigation with arrow keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use Alt + Arrow keys to switch panes (without prefix)
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Use Shift + Arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Use Alt + H/L to switch windows (Vim-style)
bind -n M-H previous-window
bind -n M-L next-window
# Start windows and panes at 1 (not 0)
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
##### ─────────────────────────────────────────────
##### 📋 Copy Mode Enhancements (Vi style)
##### ─────────────────────────────────────────────
# Use Vi-style keybindings in copy mode
set-window-option -g mode-keys vi
# Enable visual selection and copy
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
##### ─────────────────────────────────────────────
##### 🔀 Pane and Session Management
##### ─────────────────────────────────────────────
# Split panes in the same directory
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Session switcher popup (bind 'n')
bind n display-popup -E 'bash -i -c "read -p \"Session name: \" name; tmux new-session -d -s \$name && tmux switch-client -t \$name"'
# Session list with fzf (bind 'j')
bind j display-popup -E "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
##### ─────────────────────────────────────────────
##### 🔌 Plugin Management with TPM
##### ─────────────────────────────────────────────
# Plugin list
set -g @plugin 'tmux-plugins/tpm' # TPM itself
set -g @plugin 'tmux-plugins/tmux-sensible' # Basic sane defaults
set -g @plugin 'christoomey/vim-tmux-navigator' # Seamless vim + tmux pane navigation
set -g @plugin 'tmux-plugins/tmux-yank' # Copy to system clipboard
set -g @plugin 'tmux-plugins/tmux-resurrect' # Save/restore sessions
set -g @plugin 'tmux-plugins/tmux-continuum' # Auto-save + start tmux at login
##### ─────────────────────────────────────────────
##### 🧛 Dracula Theme Configuration
##### ─────────────────────────────────────────────
# Theme-specific settings
set -g @dracula-time "Europe/Belfast,America/New_York"
set -g @dracula-time-military false
set -g @dracula-show-empty-plugins false
set -g @dracula-show-powerline true
set -g @dracula-fixed-location "Antrim"
set -g @dracula-show-flags true
set -g @dracula-show-left-icon session
set -g @dracula-show-fahrenheit false
set -g @dracula-show-edge-icons false
set -g @dracula-refresh-rate 5
set -g @dracula-show-left-icon "#H | #S "
set -g @dracula-git-disable-status true
set -g @dracula-git-show-repo-name true
set -g @dracula-show-ssh-only-when-connected true
set -g @dracula-plugins "git weather battery time ssh-session"
##### ─────────────────────────────────────────────
##### 🚀 TPM Initialization (Keep at Bottom)
##### ─────────────────────────────────────────────
# Initialize TMUX Plugin Manager (TPM)
run '~/.tmux/plugins/tpm/tpm'
##### ─────────────────────────────────────────────
##### 🚀 Development Plugins
##### ─────────────────────────────────────────────
run ~/git-repos/dracula-tmux/dracula.tmux # Dracula theme for tmux

View File

@@ -13,4 +13,14 @@ alias dk=docker_kill_fzf
alias zs='nvim ~/.zshrc'
alias sz='source ~/.zshrc'
alias ls="eza --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions"
alias gk="gitkraken"
alias ghb='gh browse'
alias ghs='gh status'
alias ghl='gh pr list'
alias ghw='gh pr view --web'
alias prs='select_and_open_pr'
alias pr='select_and_open_pr_web_only'
alias e='exit'
alias ta='tmux-attach'
alias tn='tmux-new'
alias tk='tmux-kill'
alias st='tmux source-file ~/.tmux.conf'

View File

@@ -1,2 +1,3 @@
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
alias f='selected=$(find . -type f 2>/dev/null | fzf --preview "batcat --style=numbers --color=always {}") && [ -n "$selected" ] && vim "$selected"'
alias f='selected=$(find . -type f 2>/dev/null | fzf --preview "batcat --style=numbers --color=always {}") && [ -n "$selected" ] && vim "$selected"'
alias cat='batcat'

View File

@@ -30,4 +30,69 @@ fzf-cd-widget() {
local dir
dir=$(find ${1:-.} -path '*/\.*' -prune -o -type d -print 2> /dev/null | fzf +m) && cd "$dir"
zle reset-prompt
}
}
select_and_open_pr() {
local pr_info=$(gh pr list --state open --json number,title | jq -r '.[] | "\(.number) \(.title)"' | fzf -1)
if [[ -n "$pr_info" ]]; then
local pr_number=$(echo "$pr_info" | awk '{print $1}')
gh pr checkout "$pr_number"
else
echo "No PR selected."
fi
}
select_and_open_pr_web_only() {
local pr_info=$(gh pr list --state open --json number,title | jq -r '.[] | "\(.number) \(.title)"' | fzf -1)
if [[ -n "$pr_info" ]]; then
local pr_number=$(echo "$pr_info" | awk '{print $1}')
gh pr view --web
else
echo "No PR selected."
fi
}
tmux-attach() {
local session
session=$(tmux ls -F "#{session_name}" 2>/dev/null | fzf)
[[ -n "$session" ]] && tmux attach -t "$session"
}
tmux-new() {
read "session?Enter new tmux session name: "
if [[ -z "$session" ]]; then
echo "No session name entered."
return 1
fi
if tmux has-session -t "$session" 2>/dev/null; then
echo "Session '$session' already exists."
return 1
fi
tmux new -s "$session"
}
tmux-kill() {
local session
session=$(tmux ls -F "#{session_name}" 2>/dev/null | fzf --prompt="Kill session: ")
[[ -n "$session" ]] && tmux kill-session -t "$session"
}
tmux_start_music() {
local session="music"
if ! tmux has-session -t "$session" 2>/dev/null; then
tmux new-session -d -s "$session"
tmux send-keys -t "$session":1 'clear' C-m
tmux split-window -v -t "$session":1 -p 8
tmux send-keys -t "$session":1.2 'spotify_player' C-m
tmux select-pane -t "$session":1.1
fi
tmux attach -t "$session"
}

View File

@@ -1,11 +1,13 @@
if [[ -f "/opt/homebrew/bin/brew" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
export PATH="/Library/Developer/CommandLineTools/usr/bin:$PATH"
alias f='selected=$(find . -type f | fzf --preview "bat --style=numbers --color=always {}") && [ -n "$selected" ] && vim "$selected"'
alias ghostty_config='v $HOME/Library/Application\ Support/com.mitchellh.ghostty/config'
alias cat='bat'
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
#source $(brew --prefix powerlevel10k)/powerlevel10k.zsh-theme
export PATH="$PATH:/Users/luisfreixial/.cargo/bin"
#source $(brew --prefix powerlevel10k)/powerlevel10k.zsh-theme
export GOPATH=$HOME/go
export GOROOT="$(brew --prefix golang)/libexec"
alias python=/usr/bin/python3

View File

@@ -86,6 +86,11 @@ zle -N fzf-cd-widget
source ~/.zsh_exports
fi
# Secrets
if [ -f ~/.zsh_secrets ]; then
source ~/.zsh_secrets
fi
# OS-specific configurations
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [ -f ~/.zsh_debian ]; then
@@ -100,4 +105,6 @@ fi
# Initialize other tools
eval "$(zoxide init --cmd cd zsh)"
eval "$(rbenv init -)"
eval "$(starship init zsh)"
eval "$(starship init zsh)"
eval "$(gh copilot alias -- zsh)"
eval "$(/Users/luisfreixial/.local/bin/mise activate zsh)"