2022-09-20 00:54:55 +09:00
|
|
|
#!/usr/bin/pwsh
|
2022-09-20 15:47:11 +09:00
|
|
|
# dotfiles install script for Windows
|
2022-09-27 06:27:23 +09:00
|
|
|
# Execute
|
|
|
|
# Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
|
|
# first to run pwsh scripts
|
2022-09-20 00:54:55 +09:00
|
|
|
|
|
|
|
# check administration role
|
2022-09-26 08:15:37 +09:00
|
|
|
#Requires -RunAsAdministrator
|
2022-09-20 00:54:55 +09:00
|
|
|
|
|
|
|
# check pwsh version
|
|
|
|
# ≧ 7
|
2022-09-26 08:15:37 +09:00
|
|
|
#Requires -Version 7
|
2022-09-20 01:51:16 +09:00
|
|
|
|
2023-03-16 22:29:12 +09:00
|
|
|
# check working directory
|
|
|
|
if (!(
|
|
|
|
(Test-Path bin) -and (Test-Path dotfiles)
|
|
|
|
)) {
|
|
|
|
Write-Warning -Message "wrong current path
|
|
|
|
please execute at repo root"
|
|
|
|
exit 1
|
|
|
|
}
|
2022-09-20 01:51:16 +09:00
|
|
|
|
2022-09-22 22:14:49 +09:00
|
|
|
# install powershell modules
|
2022-09-29 04:11:43 +09:00
|
|
|
Write-Output "posh git"
|
2022-09-22 22:14:49 +09:00
|
|
|
Install-Module -Name posh-git
|
2022-09-29 04:11:43 +09:00
|
|
|
Write-Output "Pscx"
|
2022-09-22 22:14:49 +09:00
|
|
|
Install-Module -Name Pscx -AllowPrerelease
|
2022-09-29 04:11:43 +09:00
|
|
|
Write-Output "z"
|
2022-10-11 18:43:32 +09:00
|
|
|
Install-Module -Name ZLocation
|
|
|
|
Write-Output "PSFzf"
|
2022-09-27 06:27:23 +09:00
|
|
|
Install-Module -Name PSFzf -RequiredVersion 2.5.10
|
2022-10-11 18:43:32 +09:00
|
|
|
Write-Output "Latest PSReadLine"
|
|
|
|
Install-Module -Name PSReadLine -Force # Override default version to get the latest one
|
|
|
|
Write-Output "CompletionPredictor"
|
|
|
|
Install-Module -Name CompletionPredictor
|
2022-10-18 17:53:45 +09:00
|
|
|
Write-Output "npm"
|
|
|
|
Install-Module -Name npm-completion
|
2022-10-11 18:43:32 +09:00
|
|
|
|
|
|
|
|
2022-09-27 06:27:23 +09:00
|
|
|
|
|
|
|
# install scoop
|
|
|
|
if(!(Get-Command scoop -ErrorAction SilentlyContinue)) {
|
2023-03-16 22:29:12 +09:00
|
|
|
Write-Output "Installing scoop..."
|
2022-09-27 06:27:23 +09:00
|
|
|
irm get.scoop.sh | iex
|
|
|
|
}
|
2023-03-16 22:29:12 +09:00
|
|
|
# install basic scoop apps
|
|
|
|
# import from exported json file
|
|
|
|
# to update the json file, execute ./bin/windows/scoop_apps/update_scoop_list.ps1
|
|
|
|
scoop import .\bin\windows\scoop_apps\scoop_minimal_apps.json
|
2022-09-22 22:14:49 +09:00
|
|
|
|
2022-09-20 01:51:16 +09:00
|
|
|
|
|
|
|
# make symbolic links
|
|
|
|
# neovim
|
2022-10-17 16:56:28 +09:00
|
|
|
New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\init.lua -Target (Resolve-Path .\dotfiles\neovim\init.lua) -Force
|
|
|
|
New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\lualine_setup.lua -Target (Resolve-Path .\dotfiles\neovim\lua\lualine_setup.lua) -Force
|
2024-02-20 05:00:41 +09:00
|
|
|
New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\term_powershell.lua -Target (Resolve-Path .\dotfiles\neovim\lua\term_powershell.lua) -Force
|
2023-03-13 02:42:54 +09:00
|
|
|
New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\lspconfig\server_configurations\satysfi_ls.lua -Target (Resolve-Path .\dotfiles\neovim\lua\lspconfig\server_configurations\satysfi_ls.lua) -Force
|
2023-03-15 16:47:20 +09:00
|
|
|
mkdir $env:LOCALAPPDATA\nvim\after\ftplugin
|
|
|
|
New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\nvim\after\ftplugin\satysfi.lua -Target (Resolve-Path .\dotfiles\neovim\after\ftplugin\satysfi.lua)
|
|
|
|
New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\nvim\after\ftplugin\tex.lua -Target (Resolve-Path .\dotfiles\neovim\after\ftplugin\tex.lua)
|
2024-10-11 12:00:19 +09:00
|
|
|
New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\nvim\after\ftplugin\typst.lua -Target (Resolve-Path .\dotfiles\neovim\after\ftplugin\typst.lua)
|
2023-03-15 16:47:20 +09:00
|
|
|
mkdir $env:LOCALAPPDATA\nvim\after\queries\satysfi
|
|
|
|
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/highlights.scm" -OutFile $env:LOCALAPPDATA\nvim\after\queries\satysfi\highlights.scm
|
|
|
|
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/indents.scm" -OutFile $env:LOCALAPPDATA\nvim\after\queries\satysfi\indents.scm
|
|
|
|
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/matchup.scm" -OutFile $env:LOCALAPPDATA\nvim\after\queries\satysfi\matchup.scm
|
2024-04-09 08:47:08 +09:00
|
|
|
mkdir $env:LOCALAPPDATA\nvim\after\queries\julia
|
|
|
|
New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\nvim\after\queries\julia\injections.scm -Target (Resolve-Path .\dotfiles\neovim\after\queries\julia\injections.scm)
|
2022-09-20 02:04:25 +09:00
|
|
|
# pwsh
|
|
|
|
New-Item -ItemType SymbolicLink -Path $PROFILE -Target (Resolve-Path .\dotfiles\pwsh\powershell_profile.ps1) -Force
|
2022-09-20 02:10:08 +09:00
|
|
|
New-Item -ItemType SymbolicLink -Path ~\.config\powershell\chezmoi_completion.ps1 -Target (Resolve-Path .\dotfiles\pwsh\chezmoi_completion.ps1) -Force
|
2022-12-20 17:09:48 +09:00
|
|
|
New-Item -ItemType SymbolicLink -Path ~\.config\powershell\rustup_completion.ps1 -Target (Resolve-Path .\dotfiles\pwsh\rustup_completion.ps1) -Force
|
2022-09-20 02:21:10 +09:00
|
|
|
# starship
|
|
|
|
New-Item -ItemType SymbolicLink -Path ~\.config\starship.toml -Target (Resolve-Path .\dotfiles\starship\starship.toml) -Force
|
2023-02-20 19:17:55 +09:00
|
|
|
# wezterm
|
|
|
|
mkdir ~\.config\wezterm
|
|
|
|
New-Item -ItemType SymbolicLink -Path ~\.config\wezterm\wezterm.lua -Target (Resolve-Path .\dotfiles\wezterm\wezterm.lua) -Force
|
2023-04-08 23:56:07 +09:00
|
|
|
# julia
|
|
|
|
mkdir ~\.config\julia\config
|
|
|
|
New-Item -ItemType SymbolicLink -Path ~\.julia\config\startup.jl -Target (Resolve-Path .\dotfiles\startup_windows.jl) -Force
|
2023-02-20 19:17:55 +09:00
|
|
|
|