增加預設編輯器,並調整chezmoi架構
This commit is contained in:
parent
79c2ae90c6
commit
ee6816e276
@ -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 }}
|
||||||
|
21
.chezmoitemplates/sh_common.tmpl
Normal file
21
.chezmoitemplates/sh_common.tmpl
Normal 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'
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user