add tmux clipper

This commit is contained in:
2026-08-20 20:58:01 +01:00
parent 124075506c
commit 47ef9d05f0
+17 -3
View File
@@ -1,9 +1,10 @@
# History
HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000
SAVEHIST=10000
setopt share_history
setopt append_history
# Aliases
alias gp='git push'
alias gcm='git commit -am'
alias gsw='git switch'
@@ -11,10 +12,12 @@ alias gst='git status'
alias ga='git add .'
alias gtree="git log --graph --all --pretty=format:'%C(yellow)%h%Creset%C(cyan)%d%Creset %s %C(dim)(%cr) <%an>%Creset'"
# Environment
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export GOPATH="${GOPATH:-$HOME/go}"
export PATH="$HOME/.scripts:$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.bun/bin:$HOME/bin/zig:$HOME/bin/zls:$GOPATH/bin:$PATH"
# SSH agent
start-ssh-agent() {
local agent_env="$HOME/.ssh/agent.env"
if [[ -f "$agent_env" ]]; then
@@ -28,6 +31,18 @@ start-ssh-agent() {
fi
}
# Clipboard via OSC 52 (works through tmux, including remote sessions)
clip() {
local input
if [ -t 0 ]; then
input="$*"
else
input=$(cat)
fi
printf "\033]52;c;%s\007" "$(echo -n "$input" | base64)" > "$(tmux display-message -p '#{client_tty}')"
}
# Plugins
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
@@ -35,5 +50,4 @@ eval "$(fzf --zsh)"
eval "$(starship init zsh)"
. "$HOME/.atuin/bin/env"
eval "$(atuin init zsh)"