增加預設編輯器,並調整chezmoi架構

This commit is contained in:
Yuan Chiu 2025-05-02 09:30:44 +08:00
parent 79c2ae90c6
commit ee6816e276
3 changed files with 22 additions and 8 deletions

View File

@ -2,9 +2,6 @@
{{- $email := promptStringOnce . "email" "輸入您的Email地址" -}} {{- $email := promptStringOnce . "email" "輸入您的Email地址" -}}
sourceDir = "~/.local/share/chezmoi" sourceDir = "~/.local/share/chezmoi"
[edit]
command = "vim"
[data] [data]
name = {{ $name | quote }} name = {{ $name | quote }}
email = {{ $email | quote }} email = {{ $email | quote }}

View File

@ -0,0 +1,21 @@
{{- /* ---- 設定環境變數 -------------------------------------------------- */ -}}
{{- /* 設定預設編輯器 */ -}}
{{ if eq .chezmoi.os "linux" }}
# linux config
[ -n "$DISPLAY" ] && export EDITOR=kate|| export EDITOR=nvim
{{ else }}
export EDITOR=nvim
# non-linux config
{{ end }}
export VISUAL=nvim
{{- /* ---- 設定ailas ---------------------------------------------------- */ -}}
## Alias section
alias cp="cp -i" # Confirm before overwriting something
alias df='df -h' # Human-readable sizes
alias free='free -m' # Show sizes in MB
alias gitu='git add . && git commit && git push'

View File

@ -123,11 +123,7 @@ zstyle ':completion:*:directory-stack' list-colors '=(#b) #([0-9]#)*( *)==95=38;
# highlight case in select # highlight case in select
zstyle ':completion:*' menu select zstyle ':completion:*' menu select
## Alias section {{ template "sh_common.tmpl" . }}
alias cp="cp -i" # Confirm before overwriting something
alias df='df -h' # Human-readable sizes
alias free='free -m' # Show sizes in MB
alias gitu='git add . && git commit && git push'
# overwrite ls # overwrite ls
if command -v colorls &> /dev/null; then if command -v colorls &> /dev/null; then