Compare commits
8 Commits
c5472fc27b
...
backup-tmu
| Author | SHA1 | Date | |
|---|---|---|---|
| fb0d692489 | |||
|
|
9226005534 | ||
| 99dfae72b6 | |||
| d0c096047a | |||
| 37deb3574f | |||
| 91ef3ea915 | |||
| 12f6aca914 | |||
|
|
8b49c1b8a5 |
22
Makefile
22
Makefile
@@ -1,4 +1,4 @@
|
||||
.PHONY: zsh
|
||||
.PHONY: zsh update-zsh tmux update-tmux
|
||||
|
||||
zsh:
|
||||
@for file in zsh/.[!.]*; do \
|
||||
@@ -12,4 +12,22 @@ 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
|
||||
@if [ -d "$$HOME/.tmux" ]; then \
|
||||
cp -r $$HOME/.tmux/* tmux/.tmux/; \
|
||||
fi
|
||||
@echo "tmux files updated from home directory"
|
||||
77
tmux/.tmux.conf
Normal file
77
tmux/.tmux.conf
Normal file
@@ -0,0 +1,77 @@
|
||||
set-option -sa terminal-overrides ",xterm*:Tc"
|
||||
set -g mouse on
|
||||
|
||||
unbind C-b
|
||||
set -g prefix C-Space
|
||||
bind C-Space send-prefix
|
||||
|
||||
# Vim style pane selection
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
|
||||
# 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
|
||||
|
||||
# Use Alt-arrow keys without prefix key to switch panes
|
||||
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
|
||||
|
||||
# Shift arrow to switch windows
|
||||
bind -n S-Left previous-window
|
||||
bind -n S-Right next-window
|
||||
|
||||
# Shift Alt vim keys to switch windows
|
||||
bind -n M-H previous-window
|
||||
bind -n M-L next-window
|
||||
|
||||
# --- Plugins ---
|
||||
set -g @plugin 'tmux-plugins/tpm':
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'christoomey/vim-tmux-navigator'
|
||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||
set -s default-terminal 'tmux-256color'
|
||||
run ~/git-repos/dracula-tmux/dracula.tmux
|
||||
|
||||
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"
|
||||
|
||||
|
||||
set -g status-position top
|
||||
|
||||
# set vi-mode
|
||||
set-window-option -g mode-keys vi
|
||||
# keybindings
|
||||
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
|
||||
|
||||
bind n display-popup -E 'bash -i -c "read -p \"Session name: \" name; tmux new-session -d -s \$name && tmux switch-client -t \$name"'
|
||||
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"
|
||||
|
||||
bind '"' split-window -v -c "#{pane_current_path}"
|
||||
bind % split-window -h -c "#{pane_current_path}"
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user