aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2026-07-08 22:32:27 +0200
committerThomas Schmucker <ts@its1.de>2026-07-08 22:32:27 +0200
commit062bf79b5239a705690745259734d289b12c434b (patch)
treeefefce425058f33c1e3b50670cdf9e4e1fe0637c /scripts
parent0fd678fac892c40d21ab7c1c1c645f6633ab1cd7 (diff)
downloaddotfiles-062bf79b5239a705690745259734d289b12c434b.tar.gz
dotfiles-062bf79b5239a705690745259734d289b12c434b.tar.bz2
dotfiles-062bf79b5239a705690745259734d289b12c434b.zip
bootstrap: Verschiebe Skripte in ein eigenes Verzeichnis
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bootstrap-nvim-dict.sh33
-rwxr-xr-xscripts/bootstrap-nvim.sh189
2 files changed, 222 insertions, 0 deletions
diff --git a/scripts/bootstrap-nvim-dict.sh b/scripts/bootstrap-nvim-dict.sh
new file mode 100755
index 0000000..fa29728
--- /dev/null
+++ b/scripts/bootstrap-nvim-dict.sh
@@ -0,0 +1,33 @@
1#!/bin/sh
2set -eu
3
4SPELL_DIR="$HOME/.local/share/nvim/site/spell"
5mkdir -p "$SPELL_DIR"
6
7cd "$SPELL_DIR"
8
9download() {
10 url="$1"
11 file=$(basename "$url")
12
13 if [ -f "$file" ]; then
14 echo "Skipping $file (already exists)"
15 return
16 fi
17
18 echo "Downloading $file..."
19 if command -v wget >/dev/null 2>&1; then
20 wget -q --show-progress "$url"
21 elif command -v curl >/dev/null 2>&1; then
22 curl -fLO "$url"
23 else
24 echo "ERROR: neither wget nor curl found"
25 exit 1
26 fi
27}
28
29# Deutsche Wörterbücher
30download "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl"
31download "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug"
32
33echo "Deutsche Wörterbücher für Neovim installiert!"
diff --git a/scripts/bootstrap-nvim.sh b/scripts/bootstrap-nvim.sh
new file mode 100755
index 0000000..5c9c173
--- /dev/null
+++ b/scripts/bootstrap-nvim.sh
@@ -0,0 +1,189 @@
1#!/bin/sh
2
3set -eu
4
5OS="$(uname -s)"
6
7have() {
8 command -v "$1" >/dev/null 2>&1
9}
10
11check_prerequisites() {
12 case "$OS" in
13 Darwin)
14 if ! have brew; then
15 echo "Homebrew ist nicht installiert."
16 exit 1
17 fi
18 ;;
19 FreeBSD)
20 if ! have doas; then
21 echo "doas ist nicht installiert."
22 exit 1
23 fi
24 ;;
25 *)
26 echo "Nicht unterstütztes Betriebssystem: $OS"
27 exit 1
28 ;;
29 esac
30}
31
32setup_homebrew_env() {
33 case "$OS" in
34 Darwin)
35 export HOMEBREW_NO_AUTO_UPDATE=1
36 export HOMEBREW_NO_INSTALL_CLEANUP=1
37 ;;
38 esac
39}
40
41install_pkg() {
42 binary="$1"
43 package="$2"
44
45 if have "$binary"; then
46 printf "✓ %-32s vorhanden\n" "$binary"
47 return
48 fi
49
50 printf "→ Installiere %s\n" "$package"
51
52 case "$OS" in
53 Darwin)
54 brew install "$package"
55 ;;
56 FreeBSD)
57 doas pkg install -y "$package"
58 ;;
59 esac
60}
61
62install_npm() {
63 binary="$1"
64 package="$2"
65
66 if have "$binary"; then
67 printf "✓ %-32s vorhanden\n" "$binary"
68 return
69 fi
70
71 if ! have npm; then
72 echo "npm wurde nicht gefunden."
73 exit 1
74 fi
75
76 printf "→ Installiere npm-Paket %s\n" "$package"
77 npm install -g "$package"
78}
79
80install_pip() {
81 python="$1"
82 package="$2"
83
84 if "$python" -c "import $package" >/dev/null 2>&1; then
85 printf "✓ %-32s vorhanden\n" "$package"
86 return
87 fi
88
89 printf "→ Installiere Python-Paket %s\n" "$package"
90 env \
91 -u C_INCLUDE_PATH \
92 -u CPLUS_INCLUDE_PATH \
93 -u LIBRARY_PATH \
94 "$python" -m pip install --no-cache-dir "$package"
95}
96
97setup_python_provider() {
98 VENV="$HOME/.local/venv/nvim"
99 PYTHON="${PYTHON:-python3}"
100
101 if ! have "$PYTHON"; then
102 echo "Python wurde nicht gefunden."
103 exit 1
104 fi
105
106 if [ ! -x "$VENV/bin/python" ]; then
107 printf "→ Erzeuge Python-Venv %s\n" "$VENV"
108
109 mkdir -p "$(dirname "$VENV")"
110 "$PYTHON" -m venv "$VENV"
111 fi
112
113 install_pip "$VENV/bin/python" pynvim
114}
115
116# === Voraussetzungen ===
117
118check_prerequisites
119setup_homebrew_env
120
121install_pkg curl curl
122install_pkg git git
123install_pkg node node
124install_pkg python3 python
125
126# === Provider ===
127
128install_npm neovim-node-host neovim
129setup_python_provider
130
131# === Formatter ===
132
133install_pkg gawk gawk
134install_pkg jq jq
135install_npm prettier prettier
136install_pkg ruff ruff
137install_pkg shfmt shfmt
138install_pkg stylua stylua
139install_pkg yamlfmt yamlfmt
140
141case "$OS" in
142Darwin)
143 install_pkg clang-format clang-format
144 ;;
145FreeBSD)
146 install_pkg xmllint libxml2
147 ;;
148esac
149
150# === Tools ===
151
152install_pkg rg ripgrep
153
154case "$OS" in
155Darwin)
156 install_pkg gmake make
157 install_pkg fd fd
158 install_pkg tree-sitter tree-sitter
159 ;;
160FreeBSD)
161 install_pkg gmake gmake
162 install_pkg fd fd-find
163 install_pkg tree-sitter tree-sitter-cli
164 ;;
165esac
166
167# === Language Server ===
168
169install_npm basedpyright-langserver basedpyright
170install_npm bash-language-server bash-language-server
171
172case "$OS" in
173Darwin)
174 install_pkg shellcheck shellcheck
175 ;;
176FreeBSD)
177 install_pkg shellcheck hs-ShellCheck
178 ;;
179esac
180
181install_pkg clangd llvm
182install_npm vscode-html-language-server vscode-langservers-extracted
183install_npm vscode-json-language-server vscode-langservers-extracted
184install_pkg lua-language-server lua-language-server
185install_npm prisma-language-server @prisma/language-server
186install_npm vtsls @vtsls/language-server
187
188echo
189echo "Bootstrap abgeschlossen."