diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-01-07 15:51:54 +0100 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-01-07 15:51:54 +0100 |
| commit | 0a15586ae252646f7ae88882cf6e74b145788c0b (patch) | |
| tree | 9d41e25dd4616f80c164000f8517a70a77c4febe /bootstrap-nvim-python.sh | |
| parent | 161874a65d34df05eb08fa3f63aa54d1bfa3a602 (diff) | |
| download | dotfiles-0a15586ae252646f7ae88882cf6e74b145788c0b.tar.gz dotfiles-0a15586ae252646f7ae88882cf6e74b145788c0b.tar.bz2 dotfiles-0a15586ae252646f7ae88882cf6e74b145788c0b.zip | |
neovim: saubere python Installation für Mac und freeBSD
Diffstat (limited to 'bootstrap-nvim-python.sh')
| -rwxr-xr-x | bootstrap-nvim-python.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bootstrap-nvim-python.sh b/bootstrap-nvim-python.sh new file mode 100755 index 0000000..30e4b06 --- /dev/null +++ b/bootstrap-nvim-python.sh | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | set -eu | ||
| 3 | |||
| 4 | VENV="$HOME/.local/venv/nvim" | ||
| 5 | PYTHON="${PYTHON:-python3}" | ||
| 6 | |||
| 7 | # Python vorhanden? | ||
| 8 | if ! command -v "$PYTHON" >/dev/null 2>&1; then | ||
| 9 | echo "ERROR: python3 not found" | ||
| 10 | exit 1 | ||
| 11 | fi | ||
| 12 | |||
| 13 | # venv anlegen (falls nicht vorhanden) | ||
| 14 | if [ ! -x "$VENV/bin/python" ]; then | ||
| 15 | echo "Creating Neovim Python venv at $VENV" | ||
| 16 | "$PYTHON" -m venv "$VENV" | ||
| 17 | fi | ||
| 18 | |||
| 19 | # pip sicherstellen | ||
| 20 | "$VENV/bin/python" -m ensurepip --upgrade >/dev/null 2>&1 || true | ||
| 21 | |||
| 22 | # pynvim installieren / aktualisieren | ||
| 23 | "$VENV/bin/python" -m pip install --upgrade pip pynvim | ||
| 24 | |||
| 25 | echo "Neovim Python provider ready:" | ||
| 26 | "$VENV/bin/python" -c 'import pynvim; print("pynvim:", pynvim.__version__)' | ||
