Merge pull request 'feat: Update git zsh with ones from ~' (#1) from update-zsh into main

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2025-07-10 20:49:15 +00:00
3 changed files with 10 additions and 32 deletions

View File

@@ -5,3 +5,11 @@ zsh:
file=$${file#zsh/}; \ file=$${file#zsh/}; \
[ -f "$$HOME/$$file" ] && mv "$$HOME/$$file" "$$HOME/$$file.bak"; \ [ -f "$$HOME/$$file" ] && mv "$$HOME/$$file" "$$HOME/$$file.bak"; \
done && cp -r zsh/.[!.]* ~/ && echo "zsh files copied to home directory" || echo "zsh files not copied to home directory" done && cp -r zsh/.[!.]* ~/ && echo "zsh files copied to home directory" || echo "zsh files not copied to home directory"
update-zsh:
@for file in zsh/.[!.]*; do \
base=$$(basename $$file); \
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"

View File

@@ -7,17 +7,10 @@ alias gcm='git checkout origin/main'
alias gce='git fetch && git pull && git commit --allow-empty -m "run-ci" && git push' alias gce='git fetch && git pull && git commit --allow-empty -m "run-ci" && git push'
alias dcu='docker compose up -d' alias dcu='docker compose up -d'
alias dcub='docker compose up --build -d' alias dcub='docker compose up --build -d'
alias dcf='docker compose logs -f'
alias dcd='docker compose down' alias dcd='docker compose down'
alias dps='docker ps' alias dps='docker ps'
alias dk=docker_kill_fzf alias dk=docker_kill_fzf
alias zs='nvim ~/.zshrc' alias zs='nvim ~/.zshrc'
alias sz='source ~/.zshrc' alias sz='source ~/.zshrc'
alias ls="eza --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions" alias ls="eza --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions"
alias ghb='gh browse' alias gk="gitkraken"
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

View File

@@ -30,27 +30,4 @@ fzf-cd-widget() {
local dir local dir
dir=$(find ${1:-.} -path '*/\.*' -prune -o -type d -print 2> /dev/null | fzf +m) && cd "$dir" dir=$(find ${1:-.} -path '*/\.*' -prune -o -type d -print 2> /dev/null | fzf +m) && cd "$dir"
zle reset-prompt 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"
gh pr view --web
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
}