diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-07-23 10:00:34 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-07-23 10:00:34 +0200 |
| commit | b504e16f941470d46c0f8495f7ea4368e5d14871 (patch) | |
| tree | b920a22930ec8bd158225e10eb4e20e428e8474d | |
| parent | fe4db25063224c51f9970f2f41d355f60d751b1b (diff) | |
| download | dotfiles-b504e16f941470d46c0f8495f7ea4368e5d14871.tar.gz dotfiles-b504e16f941470d46c0f8495f7ea4368e5d14871.tar.bz2 dotfiles-b504e16f941470d46c0f8495f7ea4368e5d14871.zip | |
windows: install-win.cmd durch install-win.ps1 ersetzt, neovim-dict-win.ps1 ergaenzt
install-win.cmd entfernt, install-win.ps1 (reines PowerShell) uebernimmt
dieselbe Aufgabe (Config-Kopie nach %LOCALAPPDATA%\nvim, .gitconfig,
config-up2parts, npmrc). Ausserdem bootstrap/neovim-dict-win.ps1 als
PowerShell-Pendant zu bootstrap/neovim-dict.sh: laedt die deutschen
Rechtschreib-Woerterbuecher nach %LOCALAPPDATA%\nvim-data\site\spell.
neovim-windows-setup.md aktualisiert: verweist jetzt durchgehend auf
die .ps1-Skripte statt .cmd/Git-Bash, Python-Installationsschritt
entfernt (Provider ist deaktiviert), Stolperstein-Liste bereinigt.
| -rw-r--r-- | bootstrap/neovim-dict-win.ps1 | 64 | ||||
| -rw-r--r-- | install-win.cmd | 64 | ||||
| -rw-r--r-- | install-win.ps1 | 93 | ||||
| -rw-r--r-- | neovim-windows-setup.md | 20 |
4 files changed, 170 insertions, 71 deletions
diff --git a/bootstrap/neovim-dict-win.ps1 b/bootstrap/neovim-dict-win.ps1 new file mode 100644 index 0000000..6c0c710 --- /dev/null +++ b/bootstrap/neovim-dict-win.ps1 | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | #Requires -Version 5.1 | ||
| 2 | <# | ||
| 3 | Windows-natives Pendant zu bootstrap/neovim-dict.sh. | ||
| 4 | Laedt die deutschen Rechtschreib-Woerterbuecher fuer Neovim herunter. | ||
| 5 | bootstrap/neovim-dict.sh bleibt unveraendert. | ||
| 6 | |||
| 7 | Aufruf: | ||
| 8 | .\bootstrap\neovim-dict-win.ps1 | ||
| 9 | |||
| 10 | Falls die Ausfuehrung durch die Execution Policy blockiert wird: | ||
| 11 | powershell -ExecutionPolicy Bypass -File .\bootstrap\neovim-dict-win.ps1 | ||
| 12 | #> | ||
| 13 | |||
| 14 | $ErrorActionPreference = "Stop" | ||
| 15 | |||
| 16 | function Write-Ok($msg) { | ||
| 17 | Write-Host "OK $msg" -ForegroundColor Green | ||
| 18 | } | ||
| 19 | |||
| 20 | function Write-Step($msg) { | ||
| 21 | Write-Host "==> $msg" -ForegroundColor Cyan | ||
| 22 | } | ||
| 23 | |||
| 24 | function Write-SkipMsg($msg) { | ||
| 25 | Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray | ||
| 26 | } | ||
| 27 | |||
| 28 | # Nativer Windows-Datenpfad von Neovim (kein XDG_DATA_HOME gesetzt): | ||
| 29 | # $env:LOCALAPPDATA\nvim-data\site\spell | ||
| 30 | $SpellDir = Join-Path $env:LOCALAPPDATA "nvim-data\site\spell" | ||
| 31 | |||
| 32 | $Urls = @( | ||
| 33 | "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl", | ||
| 34 | "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug" | ||
| 35 | ) | ||
| 36 | |||
| 37 | function Get-SpellFile([string]$Url) { | ||
| 38 | $fileName = Split-Path -Leaf $Url | ||
| 39 | $dest = Join-Path $SpellDir $fileName | ||
| 40 | |||
| 41 | if (Test-Path $dest) { | ||
| 42 | Write-SkipMsg $fileName | ||
| 43 | return | ||
| 44 | } | ||
| 45 | |||
| 46 | Write-Step "Lade $fileName herunter" | ||
| 47 | Invoke-WebRequest -Uri $Url -OutFile $dest | ||
| 48 | Write-Ok $fileName | ||
| 49 | } | ||
| 50 | |||
| 51 | function Main { | ||
| 52 | if (-not (Test-Path $SpellDir)) { | ||
| 53 | New-Item -ItemType Directory -Path $SpellDir -Force | Out-Null | ||
| 54 | } | ||
| 55 | |||
| 56 | foreach ($url in $Urls) { | ||
| 57 | Get-SpellFile $url | ||
| 58 | } | ||
| 59 | |||
| 60 | Write-Host "" | ||
| 61 | Write-Host "Woerterbuecher fuer Neovim installiert!" -ForegroundColor Green | ||
| 62 | } | ||
| 63 | |||
| 64 | Main | ||
diff --git a/install-win.cmd b/install-win.cmd deleted file mode 100644 index 007516d..0000000 --- a/install-win.cmd +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | @echo off | ||
| 2 | setlocal enabledelayedexpansion | ||
| 3 | |||
| 4 | rem Windows-natives Pendant zu install.sh. | ||
| 5 | rem Kopiert (statt zu verlinken) die relevanten Konfigurationen an ihre | ||
| 6 | rem nativen Windows-Zielorte. install.sh bleibt unveraendert; dieses | ||
| 7 | rem Skript ist bewusst eigenstaendig, da FreeBSD/macOS und Windows zu | ||
| 8 | rem unterschiedlich sind fuer eine gemeinsame Installationsroutine. | ||
| 9 | rem | ||
| 10 | rem Hinweis: Nach Aenderungen an nvim/ oder git/ dieses Skript erneut | ||
| 11 | rem ausfuehren, um die Kopien zu aktualisieren (keine Symlinks). | ||
| 12 | |||
| 13 | set "SCRIPT_DIR=%~dp0" | ||
| 14 | |||
| 15 | set "NVIM_SRC=%SCRIPT_DIR%nvim" | ||
| 16 | set "NVIM_DST=%LOCALAPPDATA%\nvim" | ||
| 17 | |||
| 18 | set "GIT_CONFIG_SRC=%SCRIPT_DIR%git\config" | ||
| 19 | set "GIT_CONFIG_DST=%USERPROFILE%\.gitconfig" | ||
| 20 | |||
| 21 | set "GIT_UP2PARTS_SRC=%SCRIPT_DIR%git\config-up2parts" | ||
| 22 | set "GIT_XDG_DIR=%USERPROFILE%\.config\git" | ||
| 23 | set "GIT_UP2PARTS_DST=%GIT_XDG_DIR%\config-up2parts" | ||
| 24 | |||
| 25 | set "NPMRC_SRC=%SCRIPT_DIR%npm\npmrc" | ||
| 26 | set "NPMRC_DST=%USERPROFILE%\.npmrc" | ||
| 27 | |||
| 28 | echo === nvim === | ||
| 29 | robocopy "%NVIM_SRC%" "%NVIM_DST%" /MIR /NFL /NDL /NJH /NJS >nul | ||
| 30 | if %ERRORLEVEL% GEQ 8 ( | ||
| 31 | echo Fehler: nvim-Konfiguration konnte nicht nach "%NVIM_DST%" kopiert werden. | ||
| 32 | exit /b 1 | ||
| 33 | ) | ||
| 34 | echo OK: %NVIM_DST% | ||
| 35 | |||
| 36 | echo === git === | ||
| 37 | copy /Y "%GIT_CONFIG_SRC%" "%GIT_CONFIG_DST%" >nul | ||
| 38 | if errorlevel 1 ( | ||
| 39 | echo Fehler: git-Konfiguration konnte nicht nach "%GIT_CONFIG_DST%" kopiert werden. | ||
| 40 | exit /b 1 | ||
| 41 | ) | ||
| 42 | echo OK: %GIT_CONFIG_DST% | ||
| 43 | |||
| 44 | if not exist "%GIT_XDG_DIR%" mkdir "%GIT_XDG_DIR%" | ||
| 45 | copy /Y "%GIT_UP2PARTS_SRC%" "%GIT_UP2PARTS_DST%" >nul | ||
| 46 | if errorlevel 1 ( | ||
| 47 | echo Fehler: config-up2parts konnte nicht nach "%GIT_UP2PARTS_DST%" kopiert werden. | ||
| 48 | exit /b 1 | ||
| 49 | ) | ||
| 50 | echo OK: %GIT_UP2PARTS_DST% ^(wird per includeIf aus .gitconfig eingebunden^) | ||
| 51 | |||
| 52 | echo === npm === | ||
| 53 | if exist "%NPMRC_DST%" ( | ||
| 54 | echo Uebersprungen: %NPMRC_DST% existiert bereits. | ||
| 55 | ) else ( | ||
| 56 | copy /Y "%NPMRC_SRC%" "%NPMRC_DST%" >nul | ||
| 57 | echo OK: %NPMRC_DST% | ||
| 58 | ) | ||
| 59 | |||
| 60 | echo. | ||
| 61 | echo Fertig. Dateien wurden KOPIERT, nicht verlinkt. | ||
| 62 | echo Nach Aenderungen im Repo dieses Skript erneut ausfuehren. | ||
| 63 | |||
| 64 | endlocal | ||
diff --git a/install-win.ps1 b/install-win.ps1 new file mode 100644 index 0000000..41b3b51 --- /dev/null +++ b/install-win.ps1 | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | #Requires -Version 5.1 | ||
| 2 | <# | ||
| 3 | Windows-natives Pendant zu install.sh (ersetzt install-win.cmd). | ||
| 4 | install.sh bleibt unveraendert - kopiert (statt zu verlinken) die | ||
| 5 | relevanten Konfigurationen an ihre nativen Windows-Zielorte. Keine | ||
| 6 | Admin-Rechte noetig (keine Symlinks). | ||
| 7 | |||
| 8 | Aufruf: | ||
| 9 | .\install-win.ps1 | ||
| 10 | |||
| 11 | Falls die Ausfuehrung durch die Execution Policy blockiert wird: | ||
| 12 | powershell -ExecutionPolicy Bypass -File .\install-win.ps1 | ||
| 13 | |||
| 14 | Hinweis: Es wird KOPIERT, nicht verlinkt. Nach Aenderungen im Repo | ||
| 15 | dieses Skript erneut ausfuehren, um die Kopien zu aktualisieren. | ||
| 16 | #> | ||
| 17 | |||
| 18 | $ErrorActionPreference = "Stop" | ||
| 19 | |||
| 20 | function Write-Ok($msg) { | ||
| 21 | Write-Host "OK $msg" -ForegroundColor Green | ||
| 22 | } | ||
| 23 | |||
| 24 | function Write-Step($msg) { | ||
| 25 | Write-Host "==> $msg" -ForegroundColor Cyan | ||
| 26 | } | ||
| 27 | |||
| 28 | function Write-SkipMsg($msg) { | ||
| 29 | Write-Host "- $msg" -ForegroundColor DarkGray | ||
| 30 | } | ||
| 31 | |||
| 32 | $RepoRoot = $PSScriptRoot | ||
| 33 | |||
| 34 | $NvimSrc = Join-Path $RepoRoot "nvim" | ||
| 35 | $NvimDst = Join-Path $env:LOCALAPPDATA "nvim" | ||
| 36 | |||
| 37 | $GitConfigSrc = Join-Path $RepoRoot "git\config" | ||
| 38 | $GitConfigDst = Join-Path $env:USERPROFILE ".gitconfig" | ||
| 39 | |||
| 40 | $GitUp2partsSrc = Join-Path $RepoRoot "git\config-up2parts" | ||
| 41 | $GitXdgDir = Join-Path $env:USERPROFILE ".config\git" | ||
| 42 | $GitUp2partsDst = Join-Path $GitXdgDir "config-up2parts" | ||
| 43 | |||
| 44 | $NpmrcSrc = Join-Path $RepoRoot "npm\npmrc" | ||
| 45 | $NpmrcDst = Join-Path $env:USERPROFILE ".npmrc" | ||
| 46 | |||
| 47 | function Copy-NvimConfig { | ||
| 48 | Write-Step "nvim -> $NvimDst" | ||
| 49 | |||
| 50 | if (Test-Path $NvimDst) { | ||
| 51 | Remove-Item -Recurse -Force $NvimDst | ||
| 52 | } | ||
| 53 | |||
| 54 | Copy-Item -Recurse -Force $NvimSrc $NvimDst | ||
| 55 | Write-Ok $NvimDst | ||
| 56 | } | ||
| 57 | |||
| 58 | function Copy-GitConfig { | ||
| 59 | Write-Step "git\config -> $GitConfigDst" | ||
| 60 | Copy-Item -Force $GitConfigSrc $GitConfigDst | ||
| 61 | Write-Ok $GitConfigDst | ||
| 62 | |||
| 63 | if (-not (Test-Path $GitXdgDir)) { | ||
| 64 | New-Item -ItemType Directory -Path $GitXdgDir -Force | Out-Null | ||
| 65 | } | ||
| 66 | |||
| 67 | Write-Step "git\config-up2parts -> $GitUp2partsDst" | ||
| 68 | Copy-Item -Force $GitUp2partsSrc $GitUp2partsDst | ||
| 69 | Write-Ok "$GitUp2partsDst (wird per includeIf aus .gitconfig eingebunden)" | ||
| 70 | } | ||
| 71 | |||
| 72 | function Copy-Npmrc { | ||
| 73 | if (Test-Path $NpmrcDst) { | ||
| 74 | Write-SkipMsg "$NpmrcDst existiert bereits, uebersprungen" | ||
| 75 | return | ||
| 76 | } | ||
| 77 | |||
| 78 | Write-Step "npm\npmrc -> $NpmrcDst" | ||
| 79 | Copy-Item -Force $NpmrcSrc $NpmrcDst | ||
| 80 | Write-Ok $NpmrcDst | ||
| 81 | } | ||
| 82 | |||
| 83 | function Main { | ||
| 84 | Copy-NvimConfig | ||
| 85 | Copy-GitConfig | ||
| 86 | Copy-Npmrc | ||
| 87 | |||
| 88 | Write-Host "" | ||
| 89 | Write-Host "Fertig. Dateien wurden KOPIERT, nicht verlinkt." -ForegroundColor Green | ||
| 90 | Write-Host "Nach Aenderungen im Repo dieses Skript erneut ausfuehren." | ||
| 91 | } | ||
| 92 | |||
| 93 | Main | ||
diff --git a/neovim-windows-setup.md b/neovim-windows-setup.md index 555c273..bc27f4a 100644 --- a/neovim-windows-setup.md +++ b/neovim-windows-setup.md | |||
| @@ -2,27 +2,34 @@ | |||
| 2 | 2 | ||
| 3 | Checkliste für die Übernahme der bestehenden `nvim/`-Config aus dem Dotfiles-Repo auf ein natives Windows-System (kein WSL). Repo selbst bleibt unverändert. | 3 | Checkliste für die Übernahme der bestehenden `nvim/`-Config aus dem Dotfiles-Repo auf ein natives Windows-System (kein WSL). Repo selbst bleibt unverändert. |
| 4 | 4 | ||
| 5 | Alle Windows-Skripte in diesem Repo sind reines PowerShell (kein Git Bash, kein WSL). Falls die Ausführung durch die Execution Policy blockiert wird, entweder pro Aufruf `powershell -ExecutionPolicy Bypass -File .\skript.ps1` verwenden, oder einmalig `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. | ||
| 6 | |||
| 5 | ## 1. Grundwerkzeuge installieren | 7 | ## 1. Grundwerkzeuge installieren |
| 6 | 8 | ||
| 7 | ```powershell | 9 | ```powershell |
| 8 | winget install Neovim.Neovim | 10 | winget install Neovim.Neovim |
| 9 | winget install Git.Git | 11 | winget install Git.Git |
| 10 | winget install OpenJS.NodeJS.LTS | 12 | winget install OpenJS.NodeJS.LTS |
| 11 | winget install Python.Python.3.12 | ||
| 12 | ``` | 13 | ``` |
| 13 | 14 | ||
| 14 | Git for Windows bringt Git Bash mit – eine POSIX-Shell, mit der `install.sh` und die `bootstrap/*.sh`-Skripte direkt lauffähig sind (kein Portieren nach PowerShell nötig). | 15 | (Kein Python nötig – der Python-Provider ist in `options.lua` deaktiviert, siehe Abschnitt 4.) |
| 15 | 16 | ||
| 16 | ## 2. Konfiguration einrichten (Windows-nativer Weg) | 17 | ## 2. Konfiguration einrichten (Windows-nativer Weg) |
| 17 | 18 | ||
| 18 | Statt `install.sh` samt XDG-Umgebungsvariablen zu verbiegen: `install-win.cmd` im Repo-Root ausführen. Es kopiert (keine Symlinks, keine Admin-Rechte nötig): | 19 | `install-win.ps1` im Repo-Root ausführen: |
| 20 | |||
| 21 | ```powershell | ||
| 22 | .\install-win.ps1 | ||
| 23 | ``` | ||
| 24 | |||
| 25 | Es kopiert (keine Symlinks, keine Admin-Rechte nötig): | ||
| 19 | 26 | ||
| 20 | - `nvim/` → `%LOCALAPPDATA%\nvim` | 27 | - `nvim/` → `%LOCALAPPDATA%\nvim` |
| 21 | - `git/config` → `%USERPROFILE%\.gitconfig` | 28 | - `git/config` → `%USERPROFILE%\.gitconfig` |
| 22 | - `git/config-up2parts` → `%USERPROFILE%\.config\git\config-up2parts` (Pfad ist im `includeIf` von `git/config` hartkodiert) | 29 | - `git/config-up2parts` → `%USERPROFILE%\.config\git\config-up2parts` (Pfad ist im `includeIf` von `git/config` hartkodiert) |
| 23 | - `npm/npmrc` → `%USERPROFILE%\.npmrc` (nur falls dort noch keine Datei existiert) | 30 | - `npm/npmrc` → `%USERPROFILE%\.npmrc` (nur falls dort noch keine Datei existiert) |
| 24 | 31 | ||
| 25 | Nach Änderungen im Repo `install-win.cmd` erneut ausführen, um die Kopien zu aktualisieren. | 32 | Nach Änderungen im Repo `install-win.ps1` erneut ausführen, um die Kopien zu aktualisieren. |
| 26 | 33 | ||
| 27 | ## 3. Externe Abhängigkeiten | 34 | ## 3. Externe Abhängigkeiten |
| 28 | 35 | ||
| @@ -41,9 +48,8 @@ setx PATH "%PATH%;%USERPROFILE%\dotfiles\windows\bin" | |||
| 41 | 48 | ||
| 42 | ## 4. Bekannte Stolpersteine | 49 | ## 4. Bekannte Stolpersteine |
| 43 | 50 | ||
| 44 | - **`g.python3_host_prog`** in `nvim/lua/config/options.lua` ist hart auf einen Unix-Pfad (`$HOME/.local/venv/nvim/bin/python`) gesetzt. Unter Windows existiert weder dieses `HOME`-Layout noch `bin/python` (dort `Scripts\python.exe`). Aktuell nutzt kein installiertes Plugin die Python-Provider-API – daher unkritisch, kann ignoriert werden, solange `:python3`-Funktionen nicht gebraucht werden. (Erwägenswert: `g.loaded_python3_provider = 0` setzen, dann verschwindet das Problem ganz – separat besprochen, noch nicht umgesetzt.) | 51 | - **Rechtschreibprüfung (Deutsch)**: `bootstrap/neovim-dict-win.ps1` ausführen – lädt `de.utf-8.spl`/`.sug` nach `%LOCALAPPDATA%\nvim-data\site\spell` (nativer Windows-Datenpfad von Neovim). |
| 45 | - **`scripts/sonarqube.sh`** (`:SonarIssues`): reines POSIX-Shellskript. Läuft nur, wenn ein `sh` im PATH liegt (z. B. `sh.exe` aus Git for Windows im PATH verfügbar machen). | 52 | - **`scripts/sonarqube.sh`** (`:SonarIssues`): reines POSIX-Shellskript, kein Windows-Pendant vorhanden. Läuft nur, wenn ein `sh` im PATH liegt (z. B. `sh.exe` aus Git for Windows im PATH verfügbar machen); ansonsten `:SonarIssues` auf Windows nicht nutzen. |
| 46 | - **`bootstrap/neovim-dict.sh`** (deutsche Rechtschreibprüfung): unter Git Bash direkt ausführbar. Lädt die Dateien nach `~/.local/share/nvim/site/spell`; unter nativem Windows-Neovim stattdessen manuell nach `%LOCALAPPDATA%\nvim-data\site\spell` legen. | ||
| 47 | - **Clipboard** (`unnamedplus`): funktioniert nativ unter Windows-Neovim ohne Zusatztool – anders als unter WSL, wo `win32yank` nötig wäre. | 53 | - **Clipboard** (`unnamedplus`): funktioniert nativ unter Windows-Neovim ohne Zusatztool – anders als unter WSL, wo `win32yank` nötig wäre. |
| 48 | - **`opt.guifont`**: wirkt nur bei GUI-Frontends wie Neovide. Im Windows Terminal muss die Schriftart dort separat eingestellt werden. | 54 | - **`opt.guifont`**: wirkt nur bei GUI-Frontends wie Neovide. Im Windows Terminal muss die Schriftart dort separat eingestellt werden. |
| 49 | 55 | ||
