common.sh: 根據常改的部份,挪動位置

This commit is contained in:
Yuan Chiu 2025-05-02 20:32:07 +08:00
parent fb6cdffa61
commit e32b7a10a5

View File

@ -1,5 +1,21 @@
{{/* 以下是套用到 ~/.zshrc ~/.bashrc 用的共通內容 */ -}} {{/* 以下是套用到 ~/.zshrc ~/.bashrc 用的共通內容 */ -}}
{{/* ---- 設定ailas ------------------------------------------------------ */ -}}
# alias
alias gitu='git add . && git commit && git push'
{{/* ---- 設定環境變數 ---------------------------------------------------- */ -}}
# 設定預設編輯器
{{ if false -}} {{/* 不執行 */}}
{{ if eq .chezmoi.os "linux" }}
[ -n "$DISPLAY" ] && export EDITOR=kate|| export EDITOR=nvim
{{ else }}
export EDITOR=nvim
{{ end }}
{{ end -}}
export EDITOR=nvim
export VISUAL=nvim
{{/* ---- 設定與修復PATH路徑對應 ------------------------------------------- */ -}} {{/* ---- 設定與修復PATH路徑對應 ------------------------------------------- */ -}}
@ -21,23 +37,6 @@ export PATH="/usr/local/opt/ruby/bin:$PATH"¬
export PATH="/usr/local/lib/ruby/gems/3.3.0/bin:$PATH export PATH="/usr/local/lib/ruby/gems/3.3.0/bin:$PATH
export PATH="$HOME/.local/share/gem/ruby/3.3.0/bin:$PATH" export PATH="$HOME/.local/share/gem/ruby/3.3.0/bin:$PATH"
{{/* ---- 設定環境變數 ---------------------------------------------------- */ -}}
# 設定預設編輯器
{{ if false -}} {{/* 不執行 */}}
{{ if eq .chezmoi.os "linux" }}
[ -n "$DISPLAY" ] && export EDITOR=kate|| export EDITOR=nvim
{{ else }}
export EDITOR=nvim
{{ end }}
{{ end -}}
export EDITOR=nvim
export VISUAL=nvim
{{/* ---- 設定ailas ------------------------------------------------------ */ -}}
# alias
alias gitu='git add . && git commit && git push'
{{/* ---- 擴充功能 ------------------------------------------------------- */ -}} {{/* ---- 擴充功能 ------------------------------------------------------- */ -}}
# 圖片顯示 # 圖片顯示
# 既然即使加入判斷後還是「進入函數定義段落且噴錯」那就代表zsh 在解析 .zshrc 時,在到達 if 邏輯前,就已經知道 imgcat 是 alias並因此直接報錯這是因為 # 既然即使加入判斷後還是「進入函數定義段落且噴錯」那就代表zsh 在解析 .zshrc 時,在到達 if 邏輯前,就已經知道 imgcat 是 alias並因此直接報錯這是因為