chezmoi: windows symlink for config

This commit is contained in:
dogeystamp 2024-08-14 22:49:22 -04:00
parent 72e4a9f3c7
commit 8d19e64087
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 28 additions and 1 deletions

View File

@ -27,4 +27,4 @@ keymap("<C-e>", "<Plug>luasnip-next-choice", { mode = { "s", "i" } })
-- snippets
--------------------------------
require("luasnip.loaders.from_lua").load({paths = vim.env.XDG_CONFIG_HOME .. "/nvim/snippets"})
require("luasnip.loaders.from_lua").load({paths = vim.fn.stdpath("config") .. "/snippets"})

View File

@ -0,0 +1,27 @@
{{- /* symlink into ~/.config and ~/.local/share/ on windows */ -}}
{{- $roamingconfdirs := list "alacritty" "nushell" -}}
{{- $localconfdirs := list "nvim" -}}
{{- if eq .chezmoi.os "windows" -}}
$userdir = ([Environment]::GetFolderPath("UserProfile"))
$roamingconfdir = ([Environment]::GetFolderPath("ApplicationData"))
$localconfdir = ([Environment]::GetFolderPath("LocalApplicationData"))
{{ range $roamingconfdirs }}
If (-Not (Test-Path $roamingconfdir\{{ . }})) {
New-Item -Path $roamingconfdir\{{ . }} -ItemType Junction -Value $userdir\.config\{{ . }}
}
{{ end }}
{{ range $localconfdirs }}
If (-Not (Test-Path $localconfdir\{{ . }})) {
New-Item -Path $localconfdir\{{ . }} -ItemType Junction -Value $userdir\.config\{{ . }}
}
{{ end }}
If (-Not (Test-Path $localconfdir\nvim-data\site)) {
New-Item -Path $localconfdir\nvim-data\site -ItemType Junction -Value $userdir\.local\share\nvim\site
}
{{- end -}}