diff --git a/_home/.chezmoi.toml.tmpl b/_home/.chezmoi.toml.tmpl new file mode 100644 index 0000000..56873e0 --- /dev/null +++ b/_home/.chezmoi.toml.tmpl @@ -0,0 +1,32 @@ +{{- $sysname := promptStringOnce . "sysname" "System name" -}} +{{- $sysgroup := promptStringOnce . "sysgroup" "System group" -}} +{{- $sysarea := promptStringOnce . "sysarea" "System area" -}} +{{- $gitEmail := promptStringOnce . "gitEmail" "email address (for git commits)" -}} +{{- $gitName := promptStringOnce . "gitName" "Full name (for git commits)" -}} + +[data] +{{- if ($sysname) }} + sysname = {{ $sysname | quote }} +{{- end -}} +{{- if ($sysgroup) }} + sysgroup = {{ $sysgroup | quote }} +{{- end -}} +{{- if ($sysarea) }} + sysarea = {{ $sysarea | quote }} +{{ end -}} + +{{ if ($gitEmail) }} + gitEmail = {{ $gitEmail | quote }} +{{- end -}} +{{- if ($gitName) }} + gitName = {{ $gitName | quote }} +{{- end }} + +[diff] +# command = "nvim" +# args = ["-d", "{{- "{{ .Destination }}" -}}", "{{- "{{ .Target }}" -}}"] + + command = "delta" + args = ["--paging=never", "{{ "{{ .Destination }}" }}", "{{ "{{ .Target }}" }}"] + pager = "delta" + diff --git a/_home/dot_gitconfig.tmpl b/_home/dot_gitconfig.tmpl index d2b8496..930a684 100644 --- a/_home/dot_gitconfig.tmpl +++ b/_home/dot_gitconfig.tmpl @@ -1,7 +1,14 @@ # This is Git's per-user configuration file. +# It is recommended to edit this using chezmoi: +# cz edit ~/.gitconfig + +[include] + path = .config/sz.env/lib/delta.themes.gitconfig + [user] - name = Lockszmith (kateryna) - email = code@lksz.me + name = {{ .gitName }} + email = {{ .gitEmail }} + [credential] helper = cache --timeout 21600 helper = oauth @@ -13,5 +20,37 @@ # oauthDeviceAuthURL = /login/oauth/authorize # oauthDeviceAuthURL = /login/oauth/authorize_device # oauthScopes = read_repository +[core] + editor = nvim + pager = delta + +[init] + defaultBranch = main + +[core] + pager = delta + +[interactive] + diffFilter = delta --color-only + +[delta] + features = colibri + navigate = true # use n and N to move between diff sections + line-numbers = true + side-by-side = true + [diff] - tool = vimdiff + tool = nvimdiff +[difftool] + prompt = false +[difftool "nvimdiff"] + cmd = "nvim -d \"$LOCAL\" \"$REMOTE\"" + +[merge] + tool = nvimdiff + conflictstyle = zdiff3 +[mergetool] + prompt = true +[mergetool "nvimdiff"] + cmd = "nvim -d \"$LOCAL\" \"$REMOTE\" \"$MERGED\" -c 'wincmd w' -c 'wincmd J'" +