mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat(pwsh): Windows Migration and optimize powershell scripts
This commit is contained in:
parent
567c8d1b3b
commit
8306264bdb
12 changed files with 141 additions and 133 deletions
36
bootstrap/set_symlink_win.ps1
Normal file
36
bootstrap/set_symlink_win.ps1
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# $DOTFILES\bootstrap\set_symlink_win.ps1
|
||||
# Date: 2024-12-01
|
||||
# Author: contact@js0ny.net
|
||||
# Set symlinks for dotfiles on Windows
|
||||
# 在 Windows 上设置 dotfiles 的符号链接
|
||||
|
||||
$DOTFILES = Join-Path $env:UserProfile ".dotfiles"
|
||||
$BASE_COMMON = Join-Path $DOTFILES "common"
|
||||
$BASE_TOOLS = Join-Path $DOTFILES "tools"
|
||||
$BASE_WIN = Join-Path $DOTFILES "platforms" "win"
|
||||
$linkDots = @{
|
||||
"$BASE_WIN\wslconfig" = "$env:UserProfile\.wslconfig"
|
||||
"$BASE_WIN\neovide.toml" = "$Env:AppData\neovide\config.toml"
|
||||
"$BASE_COMMON\condarc.yaml" = "$env:XDG_CONFIG_HOME\conda\.condarc"
|
||||
"$BASE_COMMON\gitconfig" = "$env:UserProfile\.gitconfig"
|
||||
"$BASE_COMMON\glow.yaml" = "$env:AppData\glow\glow.yml"
|
||||
"$BASE_COMMON\haskeline" = "$env:UserProfile\.haskeline"
|
||||
"$BASE_COMMON\ideavimrc" = "$env:XDG_CONFIG_HOME\ideavim\ideavimrc"
|
||||
"$BASE_COMMON\lesskey" = "$env:LessKeyIn"
|
||||
"$BASE_COMMON\npmrc" = "$env:NPM_CONFIG_USERCONFIG"
|
||||
"$BASE_COMMON\NuGet.Config" = "$env:AppData\NuGet\NuGet.Config"
|
||||
"$BASE_COMMON\obsidian.vimrc" = "$env:UserProfile\Obsidian\.obsidian.vimrc"
|
||||
"$BASE_COMMON\pip.conf" = "$env:AppData\pip\pip.ini"
|
||||
"$BASE_COMMON\vimrc" = "$env:Vim\_vimrc"
|
||||
"$BASE_TOOLS\ipython" = "$env:IPYTHONDIR"
|
||||
"$BASE_TOOLS\nvim" = "$env:XDG_CONFIG_HOME\nvim"
|
||||
}
|
||||
|
||||
# TODO: Auto create directories
|
||||
|
||||
foreach ($target in $linkDots.Keys) {
|
||||
$path = $linkDots[$target]
|
||||
New-Item -ItemType SymbolicLink -Target $target -Path $path -Force
|
||||
}
|
||||
|
||||
New-Item -ItemType SymbolicLink -Target "$BASE_WIN\Microsoft.PowerShell_profile.ps1" -Path "$env:UserProfile\Documents\PowerShell\Microsoft.PowerShell_profile.ps1" -Force
|
||||
Loading…
Add table
Add a link
Reference in a new issue