aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstrap/neovim-dict-win.ps164
-rw-r--r--install-win.cmd64
-rw-r--r--install-win.ps193
-rw-r--r--neovim-windows-setup.md20
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
16function Write-Ok($msg) {
17 Write-Host "OK $msg" -ForegroundColor Green
18}
19
20function Write-Step($msg) {
21 Write-Host "==> $msg" -ForegroundColor Cyan
22}
23
24function 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
37function 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
51function 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
64Main
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
2setlocal enabledelayedexpansion
3
4rem Windows-natives Pendant zu install.sh.
5rem Kopiert (statt zu verlinken) die relevanten Konfigurationen an ihre
6rem nativen Windows-Zielorte. install.sh bleibt unveraendert; dieses
7rem Skript ist bewusst eigenstaendig, da FreeBSD/macOS und Windows zu
8rem unterschiedlich sind fuer eine gemeinsame Installationsroutine.
9rem
10rem Hinweis: Nach Aenderungen an nvim/ oder git/ dieses Skript erneut
11rem ausfuehren, um die Kopien zu aktualisieren (keine Symlinks).
12
13set "SCRIPT_DIR=%~dp0"
14
15set "NVIM_SRC=%SCRIPT_DIR%nvim"
16set "NVIM_DST=%LOCALAPPDATA%\nvim"
17
18set "GIT_CONFIG_SRC=%SCRIPT_DIR%git\config"
19set "GIT_CONFIG_DST=%USERPROFILE%\.gitconfig"
20
21set "GIT_UP2PARTS_SRC=%SCRIPT_DIR%git\config-up2parts"
22set "GIT_XDG_DIR=%USERPROFILE%\.config\git"
23set "GIT_UP2PARTS_DST=%GIT_XDG_DIR%\config-up2parts"
24
25set "NPMRC_SRC=%SCRIPT_DIR%npm\npmrc"
26set "NPMRC_DST=%USERPROFILE%\.npmrc"
27
28echo === nvim ===
29robocopy "%NVIM_SRC%" "%NVIM_DST%" /MIR /NFL /NDL /NJH /NJS >nul
30if %ERRORLEVEL% GEQ 8 (
31 echo Fehler: nvim-Konfiguration konnte nicht nach "%NVIM_DST%" kopiert werden.
32 exit /b 1
33)
34echo OK: %NVIM_DST%
35
36echo === git ===
37copy /Y "%GIT_CONFIG_SRC%" "%GIT_CONFIG_DST%" >nul
38if errorlevel 1 (
39 echo Fehler: git-Konfiguration konnte nicht nach "%GIT_CONFIG_DST%" kopiert werden.
40 exit /b 1
41)
42echo OK: %GIT_CONFIG_DST%
43
44if not exist "%GIT_XDG_DIR%" mkdir "%GIT_XDG_DIR%"
45copy /Y "%GIT_UP2PARTS_SRC%" "%GIT_UP2PARTS_DST%" >nul
46if errorlevel 1 (
47 echo Fehler: config-up2parts konnte nicht nach "%GIT_UP2PARTS_DST%" kopiert werden.
48 exit /b 1
49)
50echo OK: %GIT_UP2PARTS_DST% ^(wird per includeIf aus .gitconfig eingebunden^)
51
52echo === npm ===
53if 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
60echo.
61echo Fertig. Dateien wurden KOPIERT, nicht verlinkt.
62echo Nach Aenderungen im Repo dieses Skript erneut ausfuehren.
63
64endlocal
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
20function Write-Ok($msg) {
21 Write-Host "OK $msg" -ForegroundColor Green
22}
23
24function Write-Step($msg) {
25 Write-Host "==> $msg" -ForegroundColor Cyan
26}
27
28function 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
47function 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
58function 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
72function 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
83function 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
93Main
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
3Checkliste für die Übernahme der bestehenden `nvim/`-Config aus dem Dotfiles-Repo auf ein natives Windows-System (kein WSL). Repo selbst bleibt unverändert. 3Checkliste 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
5Alle 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
8winget install Neovim.Neovim 10winget install Neovim.Neovim
9winget install Git.Git 11winget install Git.Git
10winget install OpenJS.NodeJS.LTS 12winget install OpenJS.NodeJS.LTS
11winget install Python.Python.3.12
12``` 13```
13 14
14Git 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
18Statt `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
25Es 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
25Nach Änderungen im Repo `install-win.cmd` erneut ausführen, um die Kopien zu aktualisieren. 32Nach Ä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