Compare commits
2 Commits
a6e2aa616c
...
2a13f0defe
Author | SHA1 | Date | |
---|---|---|---|
2a13f0defe | |||
00e4707b25 |
@ -1,5 +1,5 @@
|
||||
Readme.md
|
||||
Readme/
|
||||
.readme/
|
||||
chezmoi.code-workspace
|
||||
|
||||
{{ if ne .chezmoi.os "darwin" }}
|
||||
|
Before Width: | Height: | Size: 729 KiB After Width: | Height: | Size: 729 KiB |
Before Width: | Height: | Size: 755 KiB After Width: | Height: | Size: 755 KiB |
Before Width: | Height: | Size: 5.6 MiB After Width: | Height: | Size: 5.6 MiB |
Before Width: | Height: | Size: 948 KiB After Width: | Height: | Size: 948 KiB |
@ -1,9 +1,9 @@
|
||||
Yuan dotfile 自用環境設定檔
|
||||
================================================================================
|
||||
來放個調了很久的做事環境... 其實是最近有轉移多臺電腦的需求😅,想說就把我的設定整理起來,之後換電腦換機器的時候,我習慣的環境可以方便一點這樣帶著走🚗。
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
主要是chezmoi用來統整這些dotfiles檔案,常用作業系統是Manjaro (Arch Linux) 和 macOS,有針對這兩個作業系統調整過了,也寫好Script盡量可以一兩行指令直接懶人安裝到好。
|
||||
|
||||
@ -168,7 +168,7 @@ Alacritty
|
||||
官方的程式不支援sixel在命令列直接顯示圖片,所以在Manjaro Linux中的套件安裝,是直接使用非官方修改版的AUR套件 alacritty-sixel-git 。
|
||||
在macOS中,並沒有homebrew套件,建議手動[去Github Release頁面](https://github.com/ayosec/alacritty/releases/)下載dmg檔自行安裝。
|
||||
|
||||

|
||||

|
||||
|
||||
因為此程式性質非常單一,重視效能而精簡,本身並沒有tab的功能。因為我的使用習慣會一直用到,所以找了純命令列又可以做到Tab功能的環境程式zellij,並將Alacritty設定成預設使用zellij開。也順便把佈景主題調好了。
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
|
||||
today = log --since=midnight --author='Roberto Bonvallet' --oneline
|
||||
pushall = !git remote | xargs -L1 git push --all
|
||||
pushmulti = !git-pushmulti
|
||||
s = status
|
||||
a = add --all
|
||||
cm = commit -m
|
||||
|
53
dot_local/bin/executable_git-pushmulti
Normal file
@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
# --------------------------
|
||||
# 擷取 remote list
|
||||
# --------------------------
|
||||
extract_list() {
|
||||
local input="$1"
|
||||
input="${input//[()]/}" # 去掉括號
|
||||
IFS=',' read -ra result <<< "$input"
|
||||
echo "${result[@]}"
|
||||
}
|
||||
|
||||
# --------------------------
|
||||
# 主邏輯
|
||||
# --------------------------
|
||||
|
||||
# 預設值
|
||||
remotes=()
|
||||
branches=()
|
||||
|
||||
# 取出第一個參數:應該是 (remote1,remote2)
|
||||
if [[ "$1" =~ ^\(.+\)$ ]]; then
|
||||
remotes=($(extract_list "$1"))
|
||||
shift
|
||||
else
|
||||
echo "❌ 請使用 (remote1,remote2) 的格式作為第一個參數"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 剩下的參數是 branches(若為空就抓當前 branch)
|
||||
if [[ $# -gt 0 ]]; then
|
||||
branches=("$@")
|
||||
else
|
||||
current_branch=$(git symbolic-ref --short HEAD 2>/dev/null)
|
||||
if [[ -z "$current_branch" ]]; then
|
||||
echo "❌ 無法偵測目前所在 branch,請指定"
|
||||
exit 1
|
||||
fi
|
||||
branches=("$current_branch")
|
||||
fi
|
||||
|
||||
# --------------------------
|
||||
# 執行 git push
|
||||
# --------------------------
|
||||
for remote in "${remotes[@]}"; do
|
||||
for branch in "${branches[@]}"; do
|
||||
echo "🚀 Pushing to '$remote' (branch: '$branch')..."
|
||||
git push "$remote" "$branch"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "❌ Push to '$remote' 失敗"
|
||||
fi
|
||||
done
|
||||
done
|
14
dot_zshrc
@ -191,3 +191,17 @@ if ! alias imgcat &>/dev/null && ! functions imgcat &>/dev/null && command -v ma
|
||||
fi
|
||||
|
||||
zinit light mass8326/zsh-chezmoi
|
||||
|
||||
# 自動補上 noglob 並禁用 Zsh 的 globbing 解析
|
||||
function git_pushmulti() {
|
||||
# 手動處理方括號或括號內容,並進行推送
|
||||
local remotes="$1"
|
||||
local branches="$2"
|
||||
remotes="${remotes//\[/\"[\"}"
|
||||
remotes="${remotes//\]/\"]\"}"
|
||||
branches="${branches//\[/\"[\"}"
|
||||
branches="${branches//\]/\"]\"}"
|
||||
|
||||
# 執行 git pushmulti
|
||||
noglob git pushmulti "$remotes" "$branches"
|
||||
}
|