From 6e5882a2fd02d30206ab9ca8aa5847b8ea09196c Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Wed, 12 Aug 2026 09:19:03 +0200 Subject: Normalize line endings --- .gitignore | 8 +- X11/xinitrc | 14 +- abook/abookrc | 38 +-- bootstrap-win/git.ps1 | 150 ++++++------ bootstrap-win/neovim-dict.ps1 | 116 ++++----- bootstrap/git.sh | 156 ++++++------ bootstrap/neovim-dict.sh | 88 +++---- bootstrap/neovim.sh | 342 +++++++++++++-------------- bootstrap/zsh.sh | 266 ++++++++++----------- gdb/gdbinit | 10 +- git/config-up2parts | 10 +- install-win.ps1 | 226 +++++++++--------- install.sh | 224 +++++++++--------- mpd/mpd.conf | 36 +-- ncmpcpp/config | 8 +- neovim-windows-setup.md | 232 +++++++++--------- newsboat/config | 92 ++++---- nexrc/nexrc | 44 ++-- nvim/ftplugin/gitolite.lua | 8 +- nvim/ftplugin/html.lua | 16 +- nvim/ftplugin/lua.lua | 12 +- nvim/ftplugin/markdown.lua | 6 +- nvim/ftplugin/sh.lua | 8 +- nvim/ftplugin/taskedit.lua | 2 +- nvim/ftplugin/taskwarrior.lua | 14 +- nvim/ftplugin/typescript.lua | 12 +- nvim/init.lua | 18 +- nvim/lua/config/autocmds.lua | 86 +++---- nvim/lua/config/colorscheme.lua | 34 +-- nvim/lua/config/lazy.lua | 64 ++--- nvim/lua/config/statusline.lua | 364 ++++++++++++++-------------- nvim/lua/config/treesitter.lua | 56 ++--- nvim/lua/plugins/completion.lua | 92 ++++---- nvim/lua/plugins/editing.lua | 64 ++--- nvim/lua/plugins/format.lua | 92 ++++---- nvim/lua/plugins/git.lua | 32 +-- nvim/lua/plugins/lsp.lua | 248 +++++++++---------- nvim/lua/plugins/telescope.lua | 42 ++-- nvim/lua/plugins/treesitter.lua | 44 ++-- nvim/stylua.toml | 26 +- readme.md | 156 ++++++------ taskwarrior/taskrc | 92 ++++---- tmux/tmux.conf | 64 ++--- vit/config.ini | 512 ++++++++++++++++++++-------------------- zsh/zprofile | 130 +++++----- zsh/zshenv | 26 +- zsh/zshrc | 252 ++++++++++---------- 47 files changed, 2316 insertions(+), 2316 deletions(-) diff --git a/.gitignore b/.gitignore index 64ce36c..81047dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -newsboat/urls -nvim/lazy-lock.json -ncmpcpp/error.log - +newsboat/urls +nvim/lazy-lock.json +ncmpcpp/error.log + diff --git a/X11/xinitrc b/X11/xinitrc index df199eb..befe2fe 100644 --- a/X11/xinitrc +++ b/X11/xinitrc @@ -1,7 +1,7 @@ -#!/bin/sh - -export LANG=de_DE.UTF-8 -export LC_ALL=de_DE.UTF-8 - -# Start Xfce -exec /usr/local/etc/xdg/xfce4/xinitrc +#!/bin/sh + +export LANG=de_DE.UTF-8 +export LC_ALL=de_DE.UTF-8 + +# Start Xfce +exec /usr/local/etc/xdg/xfce4/xinitrc diff --git a/abook/abookrc b/abook/abookrc index 5ce4cb3..4c5bcff 100644 --- a/abook/abookrc +++ b/abook/abookrc @@ -1,19 +1,19 @@ -# vim: filetype=dosini - -set use_mouse=true -set show_all_emails=true -set sort_field=nick -set address_style=eu -set use_ascii_only=false -set add_email_prevent_duplicates=false -set index_format="{name:32} │ {email:40} │ {phone:-20} │ {workphone:-20|mobile}" - -set use_colors=true -set color_header_fg=black -set color_header_bg=white -set color_footer_fg=black -set color_footer_bg=white -set color_list_header_fg=white -set color_list_header_bg=blue -set color_list_even_fg=grey -set color_list_odd_fg=yellow +# vim: filetype=dosini + +set use_mouse=true +set show_all_emails=true +set sort_field=nick +set address_style=eu +set use_ascii_only=false +set add_email_prevent_duplicates=false +set index_format="{name:32} │ {email:40} │ {phone:-20} │ {workphone:-20|mobile}" + +set use_colors=true +set color_header_fg=black +set color_header_bg=white +set color_footer_fg=black +set color_footer_bg=white +set color_list_header_fg=white +set color_list_header_bg=blue +set color_list_even_fg=grey +set color_list_odd_fg=yellow diff --git a/bootstrap-win/git.ps1 b/bootstrap-win/git.ps1 index 6accba4..8d63338 100644 --- a/bootstrap-win/git.ps1 +++ b/bootstrap-win/git.ps1 @@ -1,75 +1,75 @@ -#Requires -Version 5.1 -<# - Installiert Git und delta (Pager fuer git/config) per winget. - - Aufruf (keine Admin-Rechte noetig): - .\bootstrap-win\git.ps1 -#> - -$ErrorActionPreference = "Stop" -$script:Failures = @() - -function Write-Ok($msg) { - Write-Host "OK $msg" -ForegroundColor Green -} - -function Write-Step($msg) { - Write-Host "==> $msg" -ForegroundColor Cyan -} - -function Write-Skip($msg) { - Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray -} - -function Write-Warn($msg) { - Write-Host "! $msg" -ForegroundColor Yellow - $script:Failures += $msg -} - -function Test-CommandExists([string]$Name) { - return [bool](Get-Command $Name -ErrorAction SilentlyContinue) -} - -function Install-WingetPackage([string]$Binary, [string]$Id) { - if (Test-CommandExists $Binary) { - Write-Skip $Binary - return - } - - Write-Step "winget install $Id" - $output = winget install --id $Id -e --source winget --accept-package-agreements --accept-source-agreements --silent 2>&1 - - if ($LASTEXITCODE -ne 0) { - $lastLine = ($output | Select-Object -Last 3) -join " / " - Write-Warn "winget install $Id fehlgeschlagen (Binary '$Binary' nicht gefunden): $lastLine -- Pruefen mit: winget search $Id" - return - } - - Write-Ok $Id -} - -function Test-Prerequisites { - if (-not (Test-CommandExists "winget")) { - Write-Host "Fehler: winget wurde nicht gefunden. 'App Installer' aus dem Microsoft Store installieren." -ForegroundColor Red - exit 1 - } -} - -function Main { - Test-Prerequisites - - Install-WingetPackage -Binary "git" -Id "Git.Git" - Install-WingetPackage -Binary "delta" -Id "dandavison.delta" - - Write-Host "" - if ($script:Failures.Count -eq 0) { - Write-Host "Git-Bootstrap abgeschlossen." -ForegroundColor Green - } else { - Write-Host "Git-Bootstrap abgeschlossen, mit $($script:Failures.Count) Warnung(en):" -ForegroundColor Yellow - foreach ($f in $script:Failures) { - Write-Host " - $f" -ForegroundColor Yellow - } - } -} - -Main +#Requires -Version 5.1 +<# + Installiert Git und delta (Pager fuer git/config) per winget. + + Aufruf (keine Admin-Rechte noetig): + .\bootstrap-win\git.ps1 +#> + +$ErrorActionPreference = "Stop" +$script:Failures = @() + +function Write-Ok($msg) { + Write-Host "OK $msg" -ForegroundColor Green +} + +function Write-Step($msg) { + Write-Host "==> $msg" -ForegroundColor Cyan +} + +function Write-Skip($msg) { + Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray +} + +function Write-Warn($msg) { + Write-Host "! $msg" -ForegroundColor Yellow + $script:Failures += $msg +} + +function Test-CommandExists([string]$Name) { + return [bool](Get-Command $Name -ErrorAction SilentlyContinue) +} + +function Install-WingetPackage([string]$Binary, [string]$Id) { + if (Test-CommandExists $Binary) { + Write-Skip $Binary + return + } + + Write-Step "winget install $Id" + $output = winget install --id $Id -e --source winget --accept-package-agreements --accept-source-agreements --silent 2>&1 + + if ($LASTEXITCODE -ne 0) { + $lastLine = ($output | Select-Object -Last 3) -join " / " + Write-Warn "winget install $Id fehlgeschlagen (Binary '$Binary' nicht gefunden): $lastLine -- Pruefen mit: winget search $Id" + return + } + + Write-Ok $Id +} + +function Test-Prerequisites { + if (-not (Test-CommandExists "winget")) { + Write-Host "Fehler: winget wurde nicht gefunden. 'App Installer' aus dem Microsoft Store installieren." -ForegroundColor Red + exit 1 + } +} + +function Main { + Test-Prerequisites + + Install-WingetPackage -Binary "git" -Id "Git.Git" + Install-WingetPackage -Binary "delta" -Id "dandavison.delta" + + Write-Host "" + if ($script:Failures.Count -eq 0) { + Write-Host "Git-Bootstrap abgeschlossen." -ForegroundColor Green + } else { + Write-Host "Git-Bootstrap abgeschlossen, mit $($script:Failures.Count) Warnung(en):" -ForegroundColor Yellow + foreach ($f in $script:Failures) { + Write-Host " - $f" -ForegroundColor Yellow + } + } +} + +Main diff --git a/bootstrap-win/neovim-dict.ps1 b/bootstrap-win/neovim-dict.ps1 index 5aeb117..0068a5e 100644 --- a/bootstrap-win/neovim-dict.ps1 +++ b/bootstrap-win/neovim-dict.ps1 @@ -1,58 +1,58 @@ -#Requires -Version 5.1 -<# - Windows-natives Pendant zu bootstrap/neovim-dict.sh. - Laedt die deutschen Rechtschreib-Woerterbuecher fuer Neovim herunter. - - Aufruf: - .\bootstrap-win\neovim-dict.ps1 -#> - -$ErrorActionPreference = "Stop" - -function Write-Ok($msg) { - Write-Host "OK $msg" -ForegroundColor Green -} - -function Write-Step($msg) { - Write-Host "==> $msg" -ForegroundColor Cyan -} - -function Write-SkipMsg($msg) { - Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray -} - -$SpellDir = Join-Path $env:LOCALAPPDATA "nvim-data\site\spell" - -$Urls = @( - "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl", - "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug" -) - -function Get-SpellFile([string]$Url) { - $fileName = Split-Path -Leaf $Url - $dest = Join-Path $SpellDir $fileName - - if (Test-Path $dest) { - Write-SkipMsg $fileName - return - } - - Write-Step "Lade $fileName herunter" - Invoke-WebRequest -Uri $Url -OutFile $dest - Write-Ok $fileName -} - -function Main { - if (-not (Test-Path $SpellDir)) { - New-Item -ItemType Directory -Path $SpellDir -Force | Out-Null - } - - foreach ($url in $Urls) { - Get-SpellFile $url - } - - Write-Host "" - Write-Host "Woerterbuecher fuer Neovim installiert!" -ForegroundColor Green -} - -Main +#Requires -Version 5.1 +<# + Windows-natives Pendant zu bootstrap/neovim-dict.sh. + Laedt die deutschen Rechtschreib-Woerterbuecher fuer Neovim herunter. + + Aufruf: + .\bootstrap-win\neovim-dict.ps1 +#> + +$ErrorActionPreference = "Stop" + +function Write-Ok($msg) { + Write-Host "OK $msg" -ForegroundColor Green +} + +function Write-Step($msg) { + Write-Host "==> $msg" -ForegroundColor Cyan +} + +function Write-SkipMsg($msg) { + Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray +} + +$SpellDir = Join-Path $env:LOCALAPPDATA "nvim-data\site\spell" + +$Urls = @( + "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl", + "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug" +) + +function Get-SpellFile([string]$Url) { + $fileName = Split-Path -Leaf $Url + $dest = Join-Path $SpellDir $fileName + + if (Test-Path $dest) { + Write-SkipMsg $fileName + return + } + + Write-Step "Lade $fileName herunter" + Invoke-WebRequest -Uri $Url -OutFile $dest + Write-Ok $fileName +} + +function Main { + if (-not (Test-Path $SpellDir)) { + New-Item -ItemType Directory -Path $SpellDir -Force | Out-Null + } + + foreach ($url in $Urls) { + Get-SpellFile $url + } + + Write-Host "" + Write-Host "Woerterbuecher fuer Neovim installiert!" -ForegroundColor Green +} + +Main diff --git a/bootstrap/git.sh b/bootstrap/git.sh index b4f285f..e782cad 100755 --- a/bootstrap/git.sh +++ b/bootstrap/git.sh @@ -1,78 +1,78 @@ -#!/bin/sh - -set -eu - -OS="$(uname -s)" - -die() { - printf 'Fehler: %s\n' "$*" >&2 - exit 1 -} - -have() { - command -v "$1" >/dev/null 2>&1 -} - -check_prerequisites() { - case "$OS" in - Darwin) - if ! have brew; then - die "Homebrew ist nicht installiert." - fi - ;; - FreeBSD) - if ! have doas; then - die "doas ist nicht installiert." - fi - ;; - *) - die "Nicht unterstütztes Betriebssystem: $OS" - ;; - esac -} - -setup_homebrew_env() { - case "$OS" in - Darwin) - export HOMEBREW_NO_AUTO_UPDATE=1 - export HOMEBREW_NO_INSTALL_CLEANUP=1 - ;; - esac -} - -install_pkg() { - binary="$1" - package="$2" - - if have "$binary"; then - printf "✓ %-32s vorhanden\n" "$binary" - return - fi - - printf "→ Installiere %s\n" "$package" - - case "$OS" in - Darwin) - brew install "$package" - ;; - FreeBSD) - doas pkg install -y "$package" - ;; - esac -} - -install_prerequisites() { - install_pkg git git - install_pkg delta git-delta -} - -main() { - check_prerequisites - setup_homebrew_env - - install_prerequisites - - printf "\nGit-Bootstrap abgeschlossen.\n" -} - -main "$@" +#!/bin/sh + +set -eu + +OS="$(uname -s)" + +die() { + printf 'Fehler: %s\n' "$*" >&2 + exit 1 +} + +have() { + command -v "$1" >/dev/null 2>&1 +} + +check_prerequisites() { + case "$OS" in + Darwin) + if ! have brew; then + die "Homebrew ist nicht installiert." + fi + ;; + FreeBSD) + if ! have doas; then + die "doas ist nicht installiert." + fi + ;; + *) + die "Nicht unterstütztes Betriebssystem: $OS" + ;; + esac +} + +setup_homebrew_env() { + case "$OS" in + Darwin) + export HOMEBREW_NO_AUTO_UPDATE=1 + export HOMEBREW_NO_INSTALL_CLEANUP=1 + ;; + esac +} + +install_pkg() { + binary="$1" + package="$2" + + if have "$binary"; then + printf "✓ %-32s vorhanden\n" "$binary" + return + fi + + printf "→ Installiere %s\n" "$package" + + case "$OS" in + Darwin) + brew install "$package" + ;; + FreeBSD) + doas pkg install -y "$package" + ;; + esac +} + +install_prerequisites() { + install_pkg git git + install_pkg delta git-delta +} + +main() { + check_prerequisites + setup_homebrew_env + + install_prerequisites + + printf "\nGit-Bootstrap abgeschlossen.\n" +} + +main "$@" diff --git a/bootstrap/neovim-dict.sh b/bootstrap/neovim-dict.sh index 77a7db8..ee51db7 100755 --- a/bootstrap/neovim-dict.sh +++ b/bootstrap/neovim-dict.sh @@ -1,44 +1,44 @@ -#!/bin/sh -set -eu - -SPELL_DIR="$HOME/.local/share/nvim/site/spell" -mkdir -p "$SPELL_DIR" - -cd "$SPELL_DIR" - -die() { - printf 'Fehler: %s\n' "$*" >&2 - exit 1 -} - -have() { - command -v "$1" >/dev/null 2>&1 -} - -download() { - url="$1" - file=$(basename "$url") - - if [ -f "$file" ]; then - printf "✓ %-32s vorhanden\n" "$file" - return - fi - - printf "→ Lade %s herunter\n" "$file" - if have wget; then - wget -q --show-progress "$url" - elif have curl; then - curl -fLO "$url" - else - die "weder wget noch curl gefunden" - fi -} - -main() { - download "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl" - download "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug" - - printf "\nWörterbücher für Neovim installiert!\n" -} - -main "$@" +#!/bin/sh +set -eu + +SPELL_DIR="$HOME/.local/share/nvim/site/spell" +mkdir -p "$SPELL_DIR" + +cd "$SPELL_DIR" + +die() { + printf 'Fehler: %s\n' "$*" >&2 + exit 1 +} + +have() { + command -v "$1" >/dev/null 2>&1 +} + +download() { + url="$1" + file=$(basename "$url") + + if [ -f "$file" ]; then + printf "✓ %-32s vorhanden\n" "$file" + return + fi + + printf "→ Lade %s herunter\n" "$file" + if have wget; then + wget -q --show-progress "$url" + elif have curl; then + curl -fLO "$url" + else + die "weder wget noch curl gefunden" + fi +} + +main() { + download "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl" + download "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug" + + printf "\nWörterbücher für Neovim installiert!\n" +} + +main "$@" diff --git a/bootstrap/neovim.sh b/bootstrap/neovim.sh index 158de80..475853a 100755 --- a/bootstrap/neovim.sh +++ b/bootstrap/neovim.sh @@ -1,171 +1,171 @@ -#!/bin/sh - -set -eu - -OS="$(uname -s)" - -die() { - printf 'Fehler: %s\n' "$*" >&2 - exit 1 -} - -have() { - command -v "$1" >/dev/null 2>&1 -} - -check_prerequisites() { - case "$OS" in - Darwin) - if ! have brew; then - die "Homebrew ist nicht installiert." - fi - ;; - FreeBSD) - if ! have doas; then - die "doas ist nicht installiert." - fi - ;; - *) - die "Nicht unterstütztes Betriebssystem: $OS" - ;; - esac -} - -setup_homebrew_env() { - case "$OS" in - Darwin) - export HOMEBREW_NO_AUTO_UPDATE=1 - export HOMEBREW_NO_INSTALL_CLEANUP=1 - ;; - esac -} - -install_pkg() { - binary="$1" - package="$2" - - if have "$binary"; then - printf "✓ %-32s vorhanden\n" "$binary" - return - fi - - printf "→ Installiere %s\n" "$package" - - case "$OS" in - Darwin) - brew install "$package" - ;; - FreeBSD) - doas pkg install -y "$package" - ;; - esac -} - -install_npm() { - binary="$1" - package="$2" - - if have "$binary"; then - printf "✓ %-32s vorhanden\n" "$binary" - return - fi - - if ! have npm; then - die "npm wurde nicht gefunden." - fi - - printf "→ Installiere npm-Paket %s\n" "$package" - npm install -g "$package" -} - -install_prerequisites() { - install_pkg curl curl - install_pkg git git - install_pkg node node -} - -install_formatters() { - install_pkg gawk gawk - install_pkg jq jq - install_npm prettier prettier - install_pkg ruff ruff - install_pkg shfmt shfmt - install_pkg stylua stylua - install_pkg yamlfmt yamlfmt - - case "$OS" in - Darwin) - install_pkg clang-format clang-format - ;; - FreeBSD) - install_pkg xmllint libxml2 - ;; - esac -} - -install_tools() { - install_pkg rg ripgrep - - case "$OS" in - Darwin) - # Ein Clipboard-Tool ist als `pbcopy` bereits als Systemtool unter Macos - # vorinstalliert. - install_pkg gmake make - install_pkg fd fd - install_pkg tree-sitter tree-sitter - ;; - FreeBSD) - install_pkg xclip xclip - install_pkg gmake gmake - install_pkg fd fd-find - install_pkg tree-sitter tree-sitter-cli - ;; - esac -} - -install_lsp() { - install_npm basedpyright-langserver basedpyright - install_npm bash-language-server bash-language-server - - case "$OS" in - Darwin) - install_pkg shellcheck shellcheck - ;; - FreeBSD) - install_pkg shellcheck hs-ShellCheck - ;; - esac - - install_pkg clangd llvm - install_npm vscode-html-language-server vscode-langservers-extracted - install_npm vscode-json-language-server vscode-langservers-extracted - install_pkg lua-language-server lua-language-server - install_npm prisma-language-server @prisma/language-server - install_npm vtsls @vtsls/language-server -} - -install_analysis() { - # sonar-scanner wird direkt von nvim/lua/config/usercmds.lua (:SonarScan) - # und nvim/scripts/sonarqube.sh (:SonarIssues) genutzt. Nur beruflich - # unter macOS im Einsatz, deshalb kein FreeBSD-Zweig. - case "$OS" in - Darwin) - install_pkg sonar-scanner sonar-scanner - ;; - esac -} - -main() { - check_prerequisites - setup_homebrew_env - - install_prerequisites - install_formatters - install_tools - install_lsp - install_analysis - - printf "\nNeovim-Bootstrap abgeschlossen.\n" -} - -main "$@" +#!/bin/sh + +set -eu + +OS="$(uname -s)" + +die() { + printf 'Fehler: %s\n' "$*" >&2 + exit 1 +} + +have() { + command -v "$1" >/dev/null 2>&1 +} + +check_prerequisites() { + case "$OS" in + Darwin) + if ! have brew; then + die "Homebrew ist nicht installiert." + fi + ;; + FreeBSD) + if ! have doas; then + die "doas ist nicht installiert." + fi + ;; + *) + die "Nicht unterstütztes Betriebssystem: $OS" + ;; + esac +} + +setup_homebrew_env() { + case "$OS" in + Darwin) + export HOMEBREW_NO_AUTO_UPDATE=1 + export HOMEBREW_NO_INSTALL_CLEANUP=1 + ;; + esac +} + +install_pkg() { + binary="$1" + package="$2" + + if have "$binary"; then + printf "✓ %-32s vorhanden\n" "$binary" + return + fi + + printf "→ Installiere %s\n" "$package" + + case "$OS" in + Darwin) + brew install "$package" + ;; + FreeBSD) + doas pkg install -y "$package" + ;; + esac +} + +install_npm() { + binary="$1" + package="$2" + + if have "$binary"; then + printf "✓ %-32s vorhanden\n" "$binary" + return + fi + + if ! have npm; then + die "npm wurde nicht gefunden." + fi + + printf "→ Installiere npm-Paket %s\n" "$package" + npm install -g "$package" +} + +install_prerequisites() { + install_pkg curl curl + install_pkg git git + install_pkg node node +} + +install_formatters() { + install_pkg gawk gawk + install_pkg jq jq + install_npm prettier prettier + install_pkg ruff ruff + install_pkg shfmt shfmt + install_pkg stylua stylua + install_pkg yamlfmt yamlfmt + + case "$OS" in + Darwin) + install_pkg clang-format clang-format + ;; + FreeBSD) + install_pkg xmllint libxml2 + ;; + esac +} + +install_tools() { + install_pkg rg ripgrep + + case "$OS" in + Darwin) + # Ein Clipboard-Tool ist als `pbcopy` bereits als Systemtool unter Macos + # vorinstalliert. + install_pkg gmake make + install_pkg fd fd + install_pkg tree-sitter tree-sitter + ;; + FreeBSD) + install_pkg xclip xclip + install_pkg gmake gmake + install_pkg fd fd-find + install_pkg tree-sitter tree-sitter-cli + ;; + esac +} + +install_lsp() { + install_npm basedpyright-langserver basedpyright + install_npm bash-language-server bash-language-server + + case "$OS" in + Darwin) + install_pkg shellcheck shellcheck + ;; + FreeBSD) + install_pkg shellcheck hs-ShellCheck + ;; + esac + + install_pkg clangd llvm + install_npm vscode-html-language-server vscode-langservers-extracted + install_npm vscode-json-language-server vscode-langservers-extracted + install_pkg lua-language-server lua-language-server + install_npm prisma-language-server @prisma/language-server + install_npm vtsls @vtsls/language-server +} + +install_analysis() { + # sonar-scanner wird direkt von nvim/lua/config/usercmds.lua (:SonarScan) + # und nvim/scripts/sonarqube.sh (:SonarIssues) genutzt. Nur beruflich + # unter macOS im Einsatz, deshalb kein FreeBSD-Zweig. + case "$OS" in + Darwin) + install_pkg sonar-scanner sonar-scanner + ;; + esac +} + +main() { + check_prerequisites + setup_homebrew_env + + install_prerequisites + install_formatters + install_tools + install_lsp + install_analysis + + printf "\nNeovim-Bootstrap abgeschlossen.\n" +} + +main "$@" diff --git a/bootstrap/zsh.sh b/bootstrap/zsh.sh index 0be7ff3..8cea3b6 100755 --- a/bootstrap/zsh.sh +++ b/bootstrap/zsh.sh @@ -1,133 +1,133 @@ -#!/bin/sh - -set -eu - -OS="$(uname -s)" - -die() { - printf 'Fehler: %s\n' "$*" >&2 - exit 1 -} - -have() { - command -v "$1" >/dev/null 2>&1 -} - -check_prerequisites() { - case "$OS" in - Darwin) - if ! have brew; then - die "Homebrew ist nicht installiert." - fi - ;; - FreeBSD) - if ! have doas; then - die "doas ist nicht installiert." - fi - ;; - *) - die "Nicht unterstütztes Betriebssystem: $OS" - ;; - esac -} - -setup_homebrew_env() { - case "$OS" in - Darwin) - export HOMEBREW_NO_AUTO_UPDATE=1 - export HOMEBREW_NO_INSTALL_CLEANUP=1 - ;; - esac -} - -install_pkg() { - binary="$1" - package="$2" - - if have "$binary"; then - printf "✓ %-32s vorhanden\n" "$binary" - return - fi - - printf "→ Installiere %s\n" "$package" - - case "$OS" in - Darwin) - brew install "$package" - ;; - FreeBSD) - doas pkg install -y "$package" - ;; - esac -} - -install_prerequisites() { - install_pkg zsh zsh -} - -install_plugin() { - # zsh-syntax-highlighting/zsh-autosuggestions haben kein eigenes Binary, - # deshalb Pruefung anhand des von zsh/zshrc gesourceten Pfads. - file="$1" - package="$2" - - if [ -e "$file" ]; then - printf "✓ %-32s vorhanden\n" "$package" - return - fi - - printf "→ Installiere %s\n" "$package" - - case "$OS" in - Darwin) - brew install "$package" - ;; - FreeBSD) - doas pkg install -y "$package" - ;; - esac -} - -install_plugins() { - case "$OS" in - Darwin) - install_plugin "/opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" zsh-syntax-highlighting - install_plugin "/opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh" zsh-autosuggestions - ;; - FreeBSD) - install_plugin "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" zsh-syntax-highlighting - install_plugin "/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" zsh-autosuggestions - ;; - esac -} - -install_tools() { - install_pkg pwgen pwgen - install_pkg mc mc -} - -set_default_shell() { - zsh_path="$(command -v zsh)" || die "zsh wurde nicht gefunden." - - if [ "${SHELL:-}" = "$zsh_path" ]; then - printf "✓ %-32s bereits Login-Shell\n" "zsh" - return - fi - - printf "→ Setze zsh als Login-Shell (chsh)\n" - chsh -s "$zsh_path" -} - -main() { - check_prerequisites - setup_homebrew_env - - install_prerequisites - install_plugins - install_tools - set_default_shell - - printf "\nzsh-Bootstrap abgeschlossen.\n" -} - -main "$@" +#!/bin/sh + +set -eu + +OS="$(uname -s)" + +die() { + printf 'Fehler: %s\n' "$*" >&2 + exit 1 +} + +have() { + command -v "$1" >/dev/null 2>&1 +} + +check_prerequisites() { + case "$OS" in + Darwin) + if ! have brew; then + die "Homebrew ist nicht installiert." + fi + ;; + FreeBSD) + if ! have doas; then + die "doas ist nicht installiert." + fi + ;; + *) + die "Nicht unterstütztes Betriebssystem: $OS" + ;; + esac +} + +setup_homebrew_env() { + case "$OS" in + Darwin) + export HOMEBREW_NO_AUTO_UPDATE=1 + export HOMEBREW_NO_INSTALL_CLEANUP=1 + ;; + esac +} + +install_pkg() { + binary="$1" + package="$2" + + if have "$binary"; then + printf "✓ %-32s vorhanden\n" "$binary" + return + fi + + printf "→ Installiere %s\n" "$package" + + case "$OS" in + Darwin) + brew install "$package" + ;; + FreeBSD) + doas pkg install -y "$package" + ;; + esac +} + +install_prerequisites() { + install_pkg zsh zsh +} + +install_plugin() { + # zsh-syntax-highlighting/zsh-autosuggestions haben kein eigenes Binary, + # deshalb Pruefung anhand des von zsh/zshrc gesourceten Pfads. + file="$1" + package="$2" + + if [ -e "$file" ]; then + printf "✓ %-32s vorhanden\n" "$package" + return + fi + + printf "→ Installiere %s\n" "$package" + + case "$OS" in + Darwin) + brew install "$package" + ;; + FreeBSD) + doas pkg install -y "$package" + ;; + esac +} + +install_plugins() { + case "$OS" in + Darwin) + install_plugin "/opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" zsh-syntax-highlighting + install_plugin "/opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh" zsh-autosuggestions + ;; + FreeBSD) + install_plugin "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" zsh-syntax-highlighting + install_plugin "/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" zsh-autosuggestions + ;; + esac +} + +install_tools() { + install_pkg pwgen pwgen + install_pkg mc mc +} + +set_default_shell() { + zsh_path="$(command -v zsh)" || die "zsh wurde nicht gefunden." + + if [ "${SHELL:-}" = "$zsh_path" ]; then + printf "✓ %-32s bereits Login-Shell\n" "zsh" + return + fi + + printf "→ Setze zsh als Login-Shell (chsh)\n" + chsh -s "$zsh_path" +} + +main() { + check_prerequisites + setup_homebrew_env + + install_prerequisites + install_plugins + install_tools + set_default_shell + + printf "\nzsh-Bootstrap abgeschlossen.\n" +} + +main "$@" diff --git a/gdb/gdbinit b/gdb/gdbinit index fdccb32..c53ce34 100644 --- a/gdb/gdbinit +++ b/gdb/gdbinit @@ -1,5 +1,5 @@ -set pagination off -set history save on -set history expansion on -set disassembly-flavor intel -set tui tab-width 4 +set pagination off +set history save on +set history expansion on +set disassembly-flavor intel +set tui tab-width 4 diff --git a/git/config-up2parts b/git/config-up2parts index 4a3e0a0..f1fef8b 100644 --- a/git/config-up2parts +++ b/git/config-up2parts @@ -1,5 +1,5 @@ -; vim: filetype=gitconfig - -[user] - email = thomas.schmucker@up2parts.com - +; vim: filetype=gitconfig + +[user] + email = thomas.schmucker@up2parts.com + diff --git a/install-win.ps1 b/install-win.ps1 index aa77243..bc73e61 100644 --- a/install-win.ps1 +++ b/install-win.ps1 @@ -1,113 +1,113 @@ -#Requires -Version 5.1 -<# - Windows-natives Pendant zu install.sh - kopiert (statt zu verlinken) die - relevanten Konfigurationen an ihre nativen Windows-Zielorte. Keine - Admin-Rechte noetig (keine Symlinks). - - Aufruf: - .\install-win.ps1 -#> - -$ErrorActionPreference = "Stop" - -function Write-Ok($msg) { - Write-Host "OK $msg" -ForegroundColor Green -} - -function Write-Step($msg) { - Write-Host "==> $msg" -ForegroundColor Cyan -} - -function Write-SkipMsg($msg) { - Write-Host "- $msg" -ForegroundColor DarkGray -} - -$RepoRoot = $PSScriptRoot - -$NvimSrc = Join-Path $RepoRoot "nvim" -$NvimDst = Join-Path $env:LOCALAPPDATA "nvim" - -$GitConfigSrc = Join-Path $RepoRoot "git\config" -$GitConfigDst = Join-Path $env:USERPROFILE ".gitconfig" - -$GitUp2partsSrc = Join-Path $RepoRoot "git\config-up2parts" -$GitXdgDir = Join-Path $env:USERPROFILE ".config\git" -$GitUp2partsDst = Join-Path $GitXdgDir "config-up2parts" - -$NpmrcSrc = Join-Path $RepoRoot "npm\npmrc" -$NpmrcDst = Join-Path $env:USERPROFILE ".npmrc" - -function Copy-NvimConfig { - Write-Step "nvim -> $NvimDst" - - if (Test-Path $NvimDst) { - Remove-Item -Recurse -Force $NvimDst - } - - Copy-Item -Recurse -Force $NvimSrc $NvimDst - Write-Ok $NvimDst -} - -function Copy-GitConfig { - Write-Step "git\config -> $GitConfigDst" - Copy-Item -Force $GitConfigSrc $GitConfigDst - Write-Ok $GitConfigDst - - if (-not (Test-Path $GitXdgDir)) { - New-Item -ItemType Directory -Path $GitXdgDir -Force | Out-Null - } - - Write-Step "git\config-up2parts -> $GitUp2partsDst" - Copy-Item -Force $GitUp2partsSrc $GitUp2partsDst - Write-Ok "$GitUp2partsDst (wird per includeIf aus .gitconfig eingebunden)" -} - -function Copy-Npmrc { - if (Test-Path $NpmrcDst) { - Write-SkipMsg "$NpmrcDst existiert bereits, uebersprungen" - return - } - - # HOME ist unter Windows i.d.R. nicht gesetzt, ${HOME} in npm/npmrc wuerde - # nicht expandieren - Zeile daher auskommentieren statt zweite npmrc-Datei - # zu pflegen. - Write-Step "npm\npmrc -> $NpmrcDst (prefix-Zeile auskommentiert)" - $lines = Get-Content -Path $NpmrcSrc | ForEach-Object { - if ($_ -match "^\s*prefix\s*=") { - "; $_ (unter Windows auskommentiert)" - } else { - $_ - } - } - Set-Content -Path $NpmrcDst -Value $lines - Write-Ok $NpmrcDst -} - -function Add-BinToUserPath { - $binDir = Join-Path $RepoRoot "windows\bin" - $userPath = [Environment]::GetEnvironmentVariable("PATH", "User") - $entries = $userPath -split ";" - - if ($entries -contains $binDir) { - Write-SkipMsg "$binDir bereits im User-PATH" - return - } - - Write-Step "$binDir zum User-PATH hinzufuegen (enthaelt gmake.cmd)" - [Environment]::SetEnvironmentVariable("PATH", "$userPath;$binDir", "User") - Write-Ok "$binDir (wirkt erst in neuen Terminal-Sitzungen)" -} - -function Main { - Copy-NvimConfig - Copy-GitConfig - Copy-Npmrc - Add-BinToUserPath - - Write-Host "" - Write-Host "Fertig. Dateien wurden KOPIERT, nicht verlinkt." -ForegroundColor Green - Write-Host "Nach Aenderungen im Repo dieses Skript erneut ausfuehren." - Write-Host "Neues Terminal oeffnen, damit PATH-Aenderungen wirksam werden." -ForegroundColor Yellow -} - -Main +#Requires -Version 5.1 +<# + Windows-natives Pendant zu install.sh - kopiert (statt zu verlinken) die + relevanten Konfigurationen an ihre nativen Windows-Zielorte. Keine + Admin-Rechte noetig (keine Symlinks). + + Aufruf: + .\install-win.ps1 +#> + +$ErrorActionPreference = "Stop" + +function Write-Ok($msg) { + Write-Host "OK $msg" -ForegroundColor Green +} + +function Write-Step($msg) { + Write-Host "==> $msg" -ForegroundColor Cyan +} + +function Write-SkipMsg($msg) { + Write-Host "- $msg" -ForegroundColor DarkGray +} + +$RepoRoot = $PSScriptRoot + +$NvimSrc = Join-Path $RepoRoot "nvim" +$NvimDst = Join-Path $env:LOCALAPPDATA "nvim" + +$GitConfigSrc = Join-Path $RepoRoot "git\config" +$GitConfigDst = Join-Path $env:USERPROFILE ".gitconfig" + +$GitUp2partsSrc = Join-Path $RepoRoot "git\config-up2parts" +$GitXdgDir = Join-Path $env:USERPROFILE ".config\git" +$GitUp2partsDst = Join-Path $GitXdgDir "config-up2parts" + +$NpmrcSrc = Join-Path $RepoRoot "npm\npmrc" +$NpmrcDst = Join-Path $env:USERPROFILE ".npmrc" + +function Copy-NvimConfig { + Write-Step "nvim -> $NvimDst" + + if (Test-Path $NvimDst) { + Remove-Item -Recurse -Force $NvimDst + } + + Copy-Item -Recurse -Force $NvimSrc $NvimDst + Write-Ok $NvimDst +} + +function Copy-GitConfig { + Write-Step "git\config -> $GitConfigDst" + Copy-Item -Force $GitConfigSrc $GitConfigDst + Write-Ok $GitConfigDst + + if (-not (Test-Path $GitXdgDir)) { + New-Item -ItemType Directory -Path $GitXdgDir -Force | Out-Null + } + + Write-Step "git\config-up2parts -> $GitUp2partsDst" + Copy-Item -Force $GitUp2partsSrc $GitUp2partsDst + Write-Ok "$GitUp2partsDst (wird per includeIf aus .gitconfig eingebunden)" +} + +function Copy-Npmrc { + if (Test-Path $NpmrcDst) { + Write-SkipMsg "$NpmrcDst existiert bereits, uebersprungen" + return + } + + # HOME ist unter Windows i.d.R. nicht gesetzt, ${HOME} in npm/npmrc wuerde + # nicht expandieren - Zeile daher auskommentieren statt zweite npmrc-Datei + # zu pflegen. + Write-Step "npm\npmrc -> $NpmrcDst (prefix-Zeile auskommentiert)" + $lines = Get-Content -Path $NpmrcSrc | ForEach-Object { + if ($_ -match "^\s*prefix\s*=") { + "; $_ (unter Windows auskommentiert)" + } else { + $_ + } + } + Set-Content -Path $NpmrcDst -Value $lines + Write-Ok $NpmrcDst +} + +function Add-BinToUserPath { + $binDir = Join-Path $RepoRoot "windows\bin" + $userPath = [Environment]::GetEnvironmentVariable("PATH", "User") + $entries = $userPath -split ";" + + if ($entries -contains $binDir) { + Write-SkipMsg "$binDir bereits im User-PATH" + return + } + + Write-Step "$binDir zum User-PATH hinzufuegen (enthaelt gmake.cmd)" + [Environment]::SetEnvironmentVariable("PATH", "$userPath;$binDir", "User") + Write-Ok "$binDir (wirkt erst in neuen Terminal-Sitzungen)" +} + +function Main { + Copy-NvimConfig + Copy-GitConfig + Copy-Npmrc + Add-BinToUserPath + + Write-Host "" + Write-Host "Fertig. Dateien wurden KOPIERT, nicht verlinkt." -ForegroundColor Green + Write-Host "Nach Aenderungen im Repo dieses Skript erneut ausfuehren." + Write-Host "Neues Terminal oeffnen, damit PATH-Aenderungen wirksam werden." -ForegroundColor Yellow +} + +Main diff --git a/install.sh b/install.sh index 8b15fc4..68e57d0 100755 --- a/install.sh +++ b/install.sh @@ -1,112 +1,112 @@ -#!/bin/sh - -set -eu - -SCRIPT_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) - -CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}" -mkdir -p "$CONFIG" - -link() { - src="$1" - dst="$2" - - if [ -e "$dst" ] || [ -L "$dst" ]; then - rm -rf -- "$dst" - fi - - ln -sf -- "$src" "$dst" -} - -copy_if_missing() { - src="$1" - dst="$2" - - if [ ! -e "$dst" ] && [ ! -L "$dst" ]; then - cp -a -- "$src" "$dst" - fi -} - -link_abook() { - mkdir -p "$HOME/.abook" - link "$SCRIPT_DIR/abook/abookrc" "$HOME/.abook/abookrc" -} - -link_gdb() { - link "$SCRIPT_DIR/gdb" "$CONFIG/gdb" -} - -link_gitconfig() { - link "$SCRIPT_DIR/git" "$CONFIG/git" -} - -link_mpd() { - link "$SCRIPT_DIR/mpd" "$CONFIG/mpd" -} - -link_ncmpcpp() { - link "$SCRIPT_DIR/ncmpcpp" "$CONFIG/ncmpcpp" -} - -link_neovim() { - link "$SCRIPT_DIR/nvim" "$CONFIG/nvim" -} - -link_newsboat() { - mkdir -p "$CONFIG/newsboat" - link "$SCRIPT_DIR/newsboat/config" "$CONFIG/newsboat/config" -} - -copy_npmrc() { - copy_if_missing "$SCRIPT_DIR/npm/npmrc" "$HOME/.npmrc" -} - -link_nexrc() { - link "$SCRIPT_DIR/nexrc/nexrc" "$HOME/.nexrc" -} - -link_taskwarrior() { - link "$SCRIPT_DIR/taskwarrior" "$CONFIG/task" -} - -link_tmux() { - link "$SCRIPT_DIR/tmux" "$CONFIG/tmux" -} - -link_vit() { - link "$SCRIPT_DIR/vit" "$CONFIG/vit" -} - -link_wyrdrc() { - link "$SCRIPT_DIR/wyrd/wyrdrc" "$HOME/.wyrdrc" -} - -link_xinitrc() { - link "$SCRIPT_DIR/X11/xinitrc" "$HOME/.xinitrc" -} - -link_zsh() { - link "$SCRIPT_DIR/zsh/zshrc" "$HOME/.zshrc" - link "$SCRIPT_DIR/zsh/zshenv" "$HOME/.zshenv" - link "$SCRIPT_DIR/zsh/zprofile" "$HOME/.zprofile" -} - -main() { - link_abook - link_gdb - link_gitconfig - link_mpd - link_ncmpcpp - link_neovim - link_newsboat - copy_npmrc - link_nexrc - link_taskwarrior - link_tmux - link_vit - link_wyrdrc - link_xinitrc - link_zsh -} - -main "$@" +#!/bin/sh + +set -eu + +SCRIPT_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) + +CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}" +mkdir -p "$CONFIG" + +link() { + src="$1" + dst="$2" + + if [ -e "$dst" ] || [ -L "$dst" ]; then + rm -rf -- "$dst" + fi + + ln -sf -- "$src" "$dst" +} + +copy_if_missing() { + src="$1" + dst="$2" + + if [ ! -e "$dst" ] && [ ! -L "$dst" ]; then + cp -a -- "$src" "$dst" + fi +} + +link_abook() { + mkdir -p "$HOME/.abook" + link "$SCRIPT_DIR/abook/abookrc" "$HOME/.abook/abookrc" +} + +link_gdb() { + link "$SCRIPT_DIR/gdb" "$CONFIG/gdb" +} + +link_gitconfig() { + link "$SCRIPT_DIR/git" "$CONFIG/git" +} + +link_mpd() { + link "$SCRIPT_DIR/mpd" "$CONFIG/mpd" +} + +link_ncmpcpp() { + link "$SCRIPT_DIR/ncmpcpp" "$CONFIG/ncmpcpp" +} + +link_neovim() { + link "$SCRIPT_DIR/nvim" "$CONFIG/nvim" +} + +link_newsboat() { + mkdir -p "$CONFIG/newsboat" + link "$SCRIPT_DIR/newsboat/config" "$CONFIG/newsboat/config" +} + +copy_npmrc() { + copy_if_missing "$SCRIPT_DIR/npm/npmrc" "$HOME/.npmrc" +} + +link_nexrc() { + link "$SCRIPT_DIR/nexrc/nexrc" "$HOME/.nexrc" +} + +link_taskwarrior() { + link "$SCRIPT_DIR/taskwarrior" "$CONFIG/task" +} + +link_tmux() { + link "$SCRIPT_DIR/tmux" "$CONFIG/tmux" +} + +link_vit() { + link "$SCRIPT_DIR/vit" "$CONFIG/vit" +} + +link_wyrdrc() { + link "$SCRIPT_DIR/wyrd/wyrdrc" "$HOME/.wyrdrc" +} + +link_xinitrc() { + link "$SCRIPT_DIR/X11/xinitrc" "$HOME/.xinitrc" +} + +link_zsh() { + link "$SCRIPT_DIR/zsh/zshrc" "$HOME/.zshrc" + link "$SCRIPT_DIR/zsh/zshenv" "$HOME/.zshenv" + link "$SCRIPT_DIR/zsh/zprofile" "$HOME/.zprofile" +} + +main() { + link_abook + link_gdb + link_gitconfig + link_mpd + link_ncmpcpp + link_neovim + link_newsboat + copy_npmrc + link_nexrc + link_taskwarrior + link_tmux + link_vit + link_wyrdrc + link_xinitrc + link_zsh +} + +main "$@" diff --git a/mpd/mpd.conf b/mpd/mpd.conf index 729156c..6cb95d9 100644 --- a/mpd/mpd.conf +++ b/mpd/mpd.conf @@ -1,18 +1,18 @@ -music_directory "~/Music" -playlist_directory "~/Music/Playlists" -bind_to_address "~/.mpd/socket" -restore_paused "yes" - -audio_output { - type "oss" - name "OSS Output" - device "/dev/dsp" - mixer_type "hardware" - mixer_device "/dev/mixer" - mixer_control "PCM" -} - -filesystem_charset "UTF-8" -metadata_to_use "artist,album,title,track,name,genre,date" - -auto_update "yes" +music_directory "~/Music" +playlist_directory "~/Music/Playlists" +bind_to_address "~/.mpd/socket" +restore_paused "yes" + +audio_output { + type "oss" + name "OSS Output" + device "/dev/dsp" + mixer_type "hardware" + mixer_device "/dev/mixer" + mixer_control "PCM" +} + +filesystem_charset "UTF-8" +metadata_to_use "artist,album,title,track,name,genre,date" + +auto_update "yes" diff --git a/ncmpcpp/config b/ncmpcpp/config index dfe37b1..95ae7bb 100644 --- a/ncmpcpp/config +++ b/ncmpcpp/config @@ -1,4 +1,4 @@ -# vim: filetype=dosini - -mpd_host = "~/.mpd/socket" -mpd_port = "0" +# vim: filetype=dosini + +mpd_host = "~/.mpd/socket" +mpd_port = "0" diff --git a/neovim-windows-setup.md b/neovim-windows-setup.md index c2a4df6..a064a9c 100644 --- a/neovim-windows-setup.md +++ b/neovim-windows-setup.md @@ -1,116 +1,116 @@ -# Neovim-Setup unter Windows (nativ) - -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. - -Alle Windows-Skripte in diesem Repo sind reines PowerShell (kein Git Bash, kein WSL) – mit einer Ausnahme: `windows\bin\gmake.cmd` ist ein trivialer Ein-Zeiler-Wrapper, für den sich eine `.ps1`-Datei nicht lohnt. - -## 0. Von Hand zu erledigen (nicht durch Skripte abgedeckt) - -- **`winget` selbst muss vorhanden sein** ("App Installer" aus dem Microsoft Store) – `bootstrap-win/neovim.ps1` prüft das und bricht mit klarer Meldung ab, kann `winget` aber nicht selbst nachinstallieren. -- **Nach jedem Skript-Lauf ein neues Terminal öffnen**, bevor `nvim` das erste Mal gestartet wird. PATH-Änderungen (durch winget/npm-Installer oder `install-win.ps1`) landen in der Registry, aber die aktuell offene Shell bekommt das nicht automatisch mit. -- **PATH-Registrierung stichprobenartig prüfen** – manche winget-Pakete tragen sich nicht automatisch in den PATH ein (im Praxistest z. B. `LLVM.LLVM`: bereits installiert, aber `clangd` nicht im PATH, vermutlich weil der `--silent`-Installer die PATH-Registrierung überspringt). Nach einem neuen Terminal kurz `Get-Command clangd, jq, make` aufrufen; fehlt eins, dessen Installationsordner (bei LLVM z. B. `C:\Program Files\LLVM\bin`) manuell zum User-PATH hinzufügen (gleiches Muster wie `Add-BinToUserPath` in `install-win.ps1`). -- **yamlfmt, gawk, xmllint (libxml2) manuell installieren, falls benötigt** – im Praxistest bestätigt, dass es dafür keine winget-Pakete gibt ("Es wurde kein Paket gefunden, das den Eingabekriterien entspricht"), deshalb absichtlich nicht in `bootstrap-win/neovim.ps1` enthalten. Betrifft nur die Formatierung von awk-, xml/xsd- und yaml-Dateien (`conform.nvim` fällt sonst auf LSP-Formatierung zurück). Bekannte Alternativen: yamlfmt via `go install github.com/google/yamlfmt/cmd/yamlfmt@latest` (falls Go installiert) oder Binary von den GitHub-Releases; für gawk/xmllint keine verifizierte Windows-native Quelle gefunden, ggf. `winget search gawk` / `winget search libxml2` selbst prüfen. -- **Reihenfolge**: `install-win.ps1`, `bootstrap-win/git.ps1`, `bootstrap-win/neovim.ps1` und `bootstrap-win/neovim-dict.ps1` sind unabhängig voneinander. Empfehlenswert: erst Neovim/Node (Abschnitt 1) installieren, dann alle Bootstrap-Skripte laufen lassen, dann neues Terminal öffnen, dann `nvim` starten (lädt beim ersten Start automatisch alle Lua-Plugins via `lazy.nvim` – Internetverbindung nötig). -- **Neovim immer aus einer "Developer PowerShell for VS" starten** (Startmenü-Eintrag, den Visual Studio/die Build Tools mitbringen), nicht aus normalem Windows Terminal/PowerShell. `cl.exe` (MSVC) braucht die `INCLUDE`/`LIB`-Umgebungsvariablen aus `vcvarsall.bat`, die nur in dieser Developer-Shell gesetzt sind – siehe Abschnitt 4. - -## 1. Grundwerkzeuge installieren - -Execution Policy einmalig setzen, sonst starten die `.ps1`-Skripte in diesem Repo gar nicht (Alternative pro Aufruf: `powershell -ExecutionPolicy Bypass -File .\skript.ps1`): - -```powershell -Set-ExecutionPolicy -Scope CurrentUser RemoteSigned -winget install Neovim.Neovim -winget install OpenJS.NodeJS.LTS -``` - -Git und `delta` (Pager, von `git/config` vorausgesetzt: `pager = delta`, `diffFilter = delta --color-only`) installiert `bootstrap-win/git.ps1`: - -```powershell -.\bootstrap-win\git.ps1 -``` - -(Kein Python nötig – der Python-Provider ist in `options.lua` deaktiviert. Auch kein separater C-Compiler nötig – MSVC ist auf den Zielsystemen bereits vorhanden, siehe Abschnitt 3 bzw. 4.) - -## 2. Konfiguration einrichten (Windows-nativer Weg) - -`install-win.ps1` im Repo-Root ausführen: - -```powershell -.\install-win.ps1 -``` - -Es kopiert (keine Symlinks, keine Admin-Rechte nötig): - -- `nvim/` → `%LOCALAPPDATA%\nvim` -- `git/config` → `%USERPROFILE%\.gitconfig` -- `git/config-up2parts` → `%USERPROFILE%\.config\git\config-up2parts` (Pfad ist im `includeIf` von `git/config` hartkodiert) -- `npm/npmrc` → `%USERPROFILE%\.npmrc` (nur falls dort noch keine Datei existiert) – die Zeile `prefix=${HOME}/.local` wird dabei auskommentiert: `HOME` ist unter Windows i. d. R. nicht gesetzt, npm nutzt dort ohnehin schon von Haus aus `%APPDATA%\npm` als Präfix - -Nach Änderungen im Repo `install-win.ps1` erneut ausführen, um die Kopien zu aktualisieren. - -## 3. Externe Abhängigkeiten - -`bootstrap/neovim.sh` bricht unter Windows sofort ab (`Nicht unterstütztes Betriebssystem`). Stattdessen `bootstrap-win/neovim.ps1` ausführen (reines PowerShell, kein Git Bash/WSL nötig): - -```powershell -.\bootstrap-win\neovim.ps1 -``` - -Installiert per `winget`/`npm`: Git, Node, Formatter (jq, prettier, ruff, shfmt, stylua), Tools (ripgrep, fd, tree-sitter-cli, make über `ezwinports.make`) und LSP-Server (basedpyright, bash-language-server, clangd, shellcheck, vscode-langservers-extracted, lua-language-server, prisma, vtsls). Im Praxistest (24.07.2026) erfolgreich; yamlfmt/gawk/xmllint bewusst nicht enthalten (siehe Abschnitt 0). Einzelne Pakete, die trotzdem fehlschlagen, werden als Warnung gemeldet statt das Skript abzubrechen, inklusive der letzten Zeilen der winget-Fehlermeldung. - -Kein C-Compiler-Paket enthalten: MSVC ist auf den Zielsystemen bereits vorhanden, `nvim-treesitter` nutzt `cl.exe`. Dafür muss Neovim aber aus einer "Developer PowerShell for VS" gestartet werden (siehe Abschnitt 4). - -`windows\bin` (enthält `gmake.cmd`, Wrapper für `opt.makeprg = "gmake"`) danach einmalig zum PATH hinzufügen (PowerShell, User-Scope – nicht `setx PATH "%PATH%;..."` verwenden, das würde den kompletten Prozess-PATH inkl. System-Anteil dauerhaft in den User-PATH kopieren): - -```powershell -$userPath = [Environment]::GetEnvironmentVariable("PATH", "User") -[Environment]::SetEnvironmentVariable("PATH", "$userPath;$env:USERPROFILE\dotfiles\windows\bin", "User") -``` - -## 4. Bekannte Stolpersteine - -- **C-Compiler für `nvim-treesitter` (MSVC)**: `cl.exe` findet `nvim-treesitter` automatisch, aber nur wenn `INCLUDE`/`LIB` gesetzt sind – das passiert ausschließlich in einer "Developer PowerShell for VS" bzw. "x64 Native Tools Command Prompt", nicht in einer normalen PowerShell/Windows Terminal-Sitzung. Ohne das schlägt die Parser-Kompilierung mit einer Meldung wie "cannot find `
`.h" fehl, obwohl `cl.exe` selbst gefunden wird. Neovim also immer aus dieser Developer-Shell heraus starten. -- **clangd bei MSVC-Projekten (z. B. mit `compile_commands.json` aus einem `msbuild`-Rebuild)**: gleicher Grund wie oben. Eine generierte `compile_commands.json` enthält nur die projektspezifischen `/I`-Pfade (vcpkg, NuGet-SDKs), nicht die MSVC-STL-/Windows-SDK-Header – die bezieht `clang-cl` (wie `cl.exe`) über `INCLUDE`/`LIB`. Ohne Developer-Shell meldet clangd ``/`` etc. als nicht gefunden, obwohl die Projekt-Header aufgelöst werden. - -## 5. Verifizieren - -``` -nvim -:checkhealth -``` - -`:checkhealth` zeigt fehlende Provider/Tools direkt an – guter letzter Schritt nach der Installation. - -## 6. Aktualisieren - -Pendant zu `brew update && brew upgrade` (macOS) bzw. `pkg update && pkg upgrade` (FreeBSD): - -```powershell -winget source update # Paketquellen aktualisieren -winget upgrade --all # alle winget-Pakete aktualisieren -``` - -Vorschau, was aktualisiert würde, ohne etwas zu ändern: - -```powershell -winget list --upgrade-available -``` - -Einzelnes Paket gezielt aktualisieren (IDs siehe `bootstrap-win/neovim.ps1`): - -```powershell -winget upgrade LLVM.LLVM -``` - -Zwei Besonderheiten gegenüber brew/pkg: - -- Manche Pakete melden nicht immer zuverlässig eine neue Version (z. B. ältere/portable Pakete). `winget upgrade --all --include-unknown` bezieht auch diese mit ein, installiert dabei aber unter Umständen unnötig neu. -- Ein Paket dauerhaft von `--all` ausnehmen: `winget pin add ` (Pendant zu `brew pin`). - -Die npm-Pakete (`prettier`, `basedpyright`, `bash-language-server`, `vtsls`, `@prisma/language-server`, `vscode-langservers-extracted`) laufen außerhalb von winget und werden separat aktualisiert: - -```powershell -npm update -g -``` - -`bootstrap-win/neovim.ps1` erneut auszuführen aktualisiert nichts – `Install-WingetPackage`/`Install-NpmPackage` überspringen ein Paket, sobald das Binary gefunden wird (siehe `Write-Skip`). Für Updates immer die Befehle oben verwenden. +# Neovim-Setup unter Windows (nativ) + +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. + +Alle Windows-Skripte in diesem Repo sind reines PowerShell (kein Git Bash, kein WSL) – mit einer Ausnahme: `windows\bin\gmake.cmd` ist ein trivialer Ein-Zeiler-Wrapper, für den sich eine `.ps1`-Datei nicht lohnt. + +## 0. Von Hand zu erledigen (nicht durch Skripte abgedeckt) + +- **`winget` selbst muss vorhanden sein** ("App Installer" aus dem Microsoft Store) – `bootstrap-win/neovim.ps1` prüft das und bricht mit klarer Meldung ab, kann `winget` aber nicht selbst nachinstallieren. +- **Nach jedem Skript-Lauf ein neues Terminal öffnen**, bevor `nvim` das erste Mal gestartet wird. PATH-Änderungen (durch winget/npm-Installer oder `install-win.ps1`) landen in der Registry, aber die aktuell offene Shell bekommt das nicht automatisch mit. +- **PATH-Registrierung stichprobenartig prüfen** – manche winget-Pakete tragen sich nicht automatisch in den PATH ein (im Praxistest z. B. `LLVM.LLVM`: bereits installiert, aber `clangd` nicht im PATH, vermutlich weil der `--silent`-Installer die PATH-Registrierung überspringt). Nach einem neuen Terminal kurz `Get-Command clangd, jq, make` aufrufen; fehlt eins, dessen Installationsordner (bei LLVM z. B. `C:\Program Files\LLVM\bin`) manuell zum User-PATH hinzufügen (gleiches Muster wie `Add-BinToUserPath` in `install-win.ps1`). +- **yamlfmt, gawk, xmllint (libxml2) manuell installieren, falls benötigt** – im Praxistest bestätigt, dass es dafür keine winget-Pakete gibt ("Es wurde kein Paket gefunden, das den Eingabekriterien entspricht"), deshalb absichtlich nicht in `bootstrap-win/neovim.ps1` enthalten. Betrifft nur die Formatierung von awk-, xml/xsd- und yaml-Dateien (`conform.nvim` fällt sonst auf LSP-Formatierung zurück). Bekannte Alternativen: yamlfmt via `go install github.com/google/yamlfmt/cmd/yamlfmt@latest` (falls Go installiert) oder Binary von den GitHub-Releases; für gawk/xmllint keine verifizierte Windows-native Quelle gefunden, ggf. `winget search gawk` / `winget search libxml2` selbst prüfen. +- **Reihenfolge**: `install-win.ps1`, `bootstrap-win/git.ps1`, `bootstrap-win/neovim.ps1` und `bootstrap-win/neovim-dict.ps1` sind unabhängig voneinander. Empfehlenswert: erst Neovim/Node (Abschnitt 1) installieren, dann alle Bootstrap-Skripte laufen lassen, dann neues Terminal öffnen, dann `nvim` starten (lädt beim ersten Start automatisch alle Lua-Plugins via `lazy.nvim` – Internetverbindung nötig). +- **Neovim immer aus einer "Developer PowerShell for VS" starten** (Startmenü-Eintrag, den Visual Studio/die Build Tools mitbringen), nicht aus normalem Windows Terminal/PowerShell. `cl.exe` (MSVC) braucht die `INCLUDE`/`LIB`-Umgebungsvariablen aus `vcvarsall.bat`, die nur in dieser Developer-Shell gesetzt sind – siehe Abschnitt 4. + +## 1. Grundwerkzeuge installieren + +Execution Policy einmalig setzen, sonst starten die `.ps1`-Skripte in diesem Repo gar nicht (Alternative pro Aufruf: `powershell -ExecutionPolicy Bypass -File .\skript.ps1`): + +```powershell +Set-ExecutionPolicy -Scope CurrentUser RemoteSigned +winget install Neovim.Neovim +winget install OpenJS.NodeJS.LTS +``` + +Git und `delta` (Pager, von `git/config` vorausgesetzt: `pager = delta`, `diffFilter = delta --color-only`) installiert `bootstrap-win/git.ps1`: + +```powershell +.\bootstrap-win\git.ps1 +``` + +(Kein Python nötig – der Python-Provider ist in `options.lua` deaktiviert. Auch kein separater C-Compiler nötig – MSVC ist auf den Zielsystemen bereits vorhanden, siehe Abschnitt 3 bzw. 4.) + +## 2. Konfiguration einrichten (Windows-nativer Weg) + +`install-win.ps1` im Repo-Root ausführen: + +```powershell +.\install-win.ps1 +``` + +Es kopiert (keine Symlinks, keine Admin-Rechte nötig): + +- `nvim/` → `%LOCALAPPDATA%\nvim` +- `git/config` → `%USERPROFILE%\.gitconfig` +- `git/config-up2parts` → `%USERPROFILE%\.config\git\config-up2parts` (Pfad ist im `includeIf` von `git/config` hartkodiert) +- `npm/npmrc` → `%USERPROFILE%\.npmrc` (nur falls dort noch keine Datei existiert) – die Zeile `prefix=${HOME}/.local` wird dabei auskommentiert: `HOME` ist unter Windows i. d. R. nicht gesetzt, npm nutzt dort ohnehin schon von Haus aus `%APPDATA%\npm` als Präfix + +Nach Änderungen im Repo `install-win.ps1` erneut ausführen, um die Kopien zu aktualisieren. + +## 3. Externe Abhängigkeiten + +`bootstrap/neovim.sh` bricht unter Windows sofort ab (`Nicht unterstütztes Betriebssystem`). Stattdessen `bootstrap-win/neovim.ps1` ausführen (reines PowerShell, kein Git Bash/WSL nötig): + +```powershell +.\bootstrap-win\neovim.ps1 +``` + +Installiert per `winget`/`npm`: Git, Node, Formatter (jq, prettier, ruff, shfmt, stylua), Tools (ripgrep, fd, tree-sitter-cli, make über `ezwinports.make`) und LSP-Server (basedpyright, bash-language-server, clangd, shellcheck, vscode-langservers-extracted, lua-language-server, prisma, vtsls). Im Praxistest (24.07.2026) erfolgreich; yamlfmt/gawk/xmllint bewusst nicht enthalten (siehe Abschnitt 0). Einzelne Pakete, die trotzdem fehlschlagen, werden als Warnung gemeldet statt das Skript abzubrechen, inklusive der letzten Zeilen der winget-Fehlermeldung. + +Kein C-Compiler-Paket enthalten: MSVC ist auf den Zielsystemen bereits vorhanden, `nvim-treesitter` nutzt `cl.exe`. Dafür muss Neovim aber aus einer "Developer PowerShell for VS" gestartet werden (siehe Abschnitt 4). + +`windows\bin` (enthält `gmake.cmd`, Wrapper für `opt.makeprg = "gmake"`) danach einmalig zum PATH hinzufügen (PowerShell, User-Scope – nicht `setx PATH "%PATH%;..."` verwenden, das würde den kompletten Prozess-PATH inkl. System-Anteil dauerhaft in den User-PATH kopieren): + +```powershell +$userPath = [Environment]::GetEnvironmentVariable("PATH", "User") +[Environment]::SetEnvironmentVariable("PATH", "$userPath;$env:USERPROFILE\dotfiles\windows\bin", "User") +``` + +## 4. Bekannte Stolpersteine + +- **C-Compiler für `nvim-treesitter` (MSVC)**: `cl.exe` findet `nvim-treesitter` automatisch, aber nur wenn `INCLUDE`/`LIB` gesetzt sind – das passiert ausschließlich in einer "Developer PowerShell for VS" bzw. "x64 Native Tools Command Prompt", nicht in einer normalen PowerShell/Windows Terminal-Sitzung. Ohne das schlägt die Parser-Kompilierung mit einer Meldung wie "cannot find `
`.h" fehl, obwohl `cl.exe` selbst gefunden wird. Neovim also immer aus dieser Developer-Shell heraus starten. +- **clangd bei MSVC-Projekten (z. B. mit `compile_commands.json` aus einem `msbuild`-Rebuild)**: gleicher Grund wie oben. Eine generierte `compile_commands.json` enthält nur die projektspezifischen `/I`-Pfade (vcpkg, NuGet-SDKs), nicht die MSVC-STL-/Windows-SDK-Header – die bezieht `clang-cl` (wie `cl.exe`) über `INCLUDE`/`LIB`. Ohne Developer-Shell meldet clangd ``/`` etc. als nicht gefunden, obwohl die Projekt-Header aufgelöst werden. + +## 5. Verifizieren + +``` +nvim +:checkhealth +``` + +`:checkhealth` zeigt fehlende Provider/Tools direkt an – guter letzter Schritt nach der Installation. + +## 6. Aktualisieren + +Pendant zu `brew update && brew upgrade` (macOS) bzw. `pkg update && pkg upgrade` (FreeBSD): + +```powershell +winget source update # Paketquellen aktualisieren +winget upgrade --all # alle winget-Pakete aktualisieren +``` + +Vorschau, was aktualisiert würde, ohne etwas zu ändern: + +```powershell +winget list --upgrade-available +``` + +Einzelnes Paket gezielt aktualisieren (IDs siehe `bootstrap-win/neovim.ps1`): + +```powershell +winget upgrade LLVM.LLVM +``` + +Zwei Besonderheiten gegenüber brew/pkg: + +- Manche Pakete melden nicht immer zuverlässig eine neue Version (z. B. ältere/portable Pakete). `winget upgrade --all --include-unknown` bezieht auch diese mit ein, installiert dabei aber unter Umständen unnötig neu. +- Ein Paket dauerhaft von `--all` ausnehmen: `winget pin add ` (Pendant zu `brew pin`). + +Die npm-Pakete (`prettier`, `basedpyright`, `bash-language-server`, `vtsls`, `@prisma/language-server`, `vscode-langservers-extracted`) laufen außerhalb von winget und werden separat aktualisiert: + +```powershell +npm update -g +``` + +`bootstrap-win/neovim.ps1` erneut auszuführen aktualisiert nichts – `Install-WingetPackage`/`Install-NpmPackage` überspringen ein Paket, sobald das Binary gefunden wird (siehe `Write-Skip`). Für Updates immer die Befehle oben verwenden. diff --git a/newsboat/config b/newsboat/config index 0d39ad5..dc69cc5 100644 --- a/newsboat/config +++ b/newsboat/config @@ -1,46 +1,46 @@ -# vim: filetype=conf - -auto-reload yes -reload-time 10 -browser "firefox --new-tab %u" -confirm-mark-all-feeds-read no -confirm-mark-feed-read no -goto-first-unread no -goto-next-feed no -keep-articles-days 180 -max-items 500 -cleanup-on-quit yes - -download-path "~/Downloads/!Podcasts" -download-filename-format "F-%t.%e" - -bind-key j down feedlist -bind-key k up feedlist -bind-key j next articlelist -bind-key k prev articlelist -bind-key J next-feed articlelist -bind-key K prev-feed articlelist -bind-key j down article -bind-key k up article - -macro o set browser "mpv %u" ; open-in-browser ; set browser "firefox --new-tab %u" - -color background default default -color listnormal color255 default -color listfocus color238 color255 standout -color listnormal_unread color47 default -color listfocus_unread color238 color47 standout -color info color141 color236 - -# highlights -highlight all "---.*---" yellow -highlight feedlist ".*(0/0))" color237 default default -highlight article "(^Feed:|^Title:|^Date:|^Link:|^Author:)" cyan default bold -highlight article "https?://[^ ]+" yellow default -highlight article "\\[[0-9][0-9]*\\]" magenta default bold -highlight article "\\[image\\ [0-9]+\\]" green default bold -highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold -highlight article ":.*\\(link\\)$" cyan default -highlight article ":.*\\(image\\)$" blue default -highlight article ":.*\\(embedded flash\\)$" magenta default - +# vim: filetype=conf + +auto-reload yes +reload-time 10 +browser "firefox --new-tab %u" +confirm-mark-all-feeds-read no +confirm-mark-feed-read no +goto-first-unread no +goto-next-feed no +keep-articles-days 180 +max-items 500 +cleanup-on-quit yes + +download-path "~/Downloads/!Podcasts" +download-filename-format "F-%t.%e" + +bind-key j down feedlist +bind-key k up feedlist +bind-key j next articlelist +bind-key k prev articlelist +bind-key J next-feed articlelist +bind-key K prev-feed articlelist +bind-key j down article +bind-key k up article + +macro o set browser "mpv %u" ; open-in-browser ; set browser "firefox --new-tab %u" + +color background default default +color listnormal color255 default +color listfocus color238 color255 standout +color listnormal_unread color47 default +color listfocus_unread color238 color47 standout +color info color141 color236 + +# highlights +highlight all "---.*---" yellow +highlight feedlist ".*(0/0))" color237 default default +highlight article "(^Feed:|^Title:|^Date:|^Link:|^Author:)" cyan default bold +highlight article "https?://[^ ]+" yellow default +highlight article "\\[[0-9][0-9]*\\]" magenta default bold +highlight article "\\[image\\ [0-9]+\\]" green default bold +highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold +highlight article ":.*\\(link\\)$" cyan default +highlight article ":.*\\(image\\)$" blue default +highlight article ":.*\\(embedded flash\\)$" magenta default + diff --git a/nexrc/nexrc b/nexrc/nexrc index 648ee6a..442c5fc 100644 --- a/nexrc/nexrc +++ b/nexrc/nexrc @@ -1,22 +1,22 @@ -set number - -set autoindent -set tabstop=4 -set shiftwidth=4 - -set extend -set magic -set searchincr -set iclower - -set showmatch - -set fileencoding=utf-8 -set inputencoding=utf-8 - -set ruler -set windowname - -set noerrorbells -set noflash - +set number + +set autoindent +set tabstop=4 +set shiftwidth=4 + +set extend +set magic +set searchincr +set iclower + +set showmatch + +set fileencoding=utf-8 +set inputencoding=utf-8 + +set ruler +set windowname + +set noerrorbells +set noflash + diff --git a/nvim/ftplugin/gitolite.lua b/nvim/ftplugin/gitolite.lua index c5d1305..acbde0f 100644 --- a/nvim/ftplugin/gitolite.lua +++ b/nvim/ftplugin/gitolite.lua @@ -1,4 +1,4 @@ -local opt = vim.opt_local - -opt.expandtab = true -opt.shiftwidth = 4 +local opt = vim.opt_local + +opt.expandtab = true +opt.shiftwidth = 4 diff --git a/nvim/ftplugin/html.lua b/nvim/ftplugin/html.lua index 009e21d..98580db 100644 --- a/nvim/ftplugin/html.lua +++ b/nvim/ftplugin/html.lua @@ -1,8 +1,8 @@ -local opt = vim.opt_local - -opt.tabstop = 2 -opt.softtabstop = 2 -opt.shiftwidth = 2 -opt.expandtab = true -opt.autoindent = true -opt.foldenable = true +local opt = vim.opt_local + +opt.tabstop = 2 +opt.softtabstop = 2 +opt.shiftwidth = 2 +opt.expandtab = true +opt.autoindent = true +opt.foldenable = true diff --git a/nvim/ftplugin/lua.lua b/nvim/ftplugin/lua.lua index 096143b..087e84c 100644 --- a/nvim/ftplugin/lua.lua +++ b/nvim/ftplugin/lua.lua @@ -1,6 +1,6 @@ -local opt = vim.opt_local - -opt.expandtab = true -opt.shiftwidth = 2 -opt.softtabstop = 2 -opt.tabstop = 2 +local opt = vim.opt_local + +opt.expandtab = true +opt.shiftwidth = 2 +opt.softtabstop = 2 +opt.tabstop = 2 diff --git a/nvim/ftplugin/markdown.lua b/nvim/ftplugin/markdown.lua index 5f07330..dca68dd 100644 --- a/nvim/ftplugin/markdown.lua +++ b/nvim/ftplugin/markdown.lua @@ -1,3 +1,3 @@ -local opt = vim.opt_local - -opt.wrap = true +local opt = vim.opt_local + +opt.wrap = true diff --git a/nvim/ftplugin/sh.lua b/nvim/ftplugin/sh.lua index cda52f1..4bde5f7 100644 --- a/nvim/ftplugin/sh.lua +++ b/nvim/ftplugin/sh.lua @@ -1,4 +1,4 @@ -local opt = vim.opt_local - -opt.expandtab = true -opt.shiftwidth = 2 +local opt = vim.opt_local + +opt.expandtab = true +opt.shiftwidth = 2 diff --git a/nvim/ftplugin/taskedit.lua b/nvim/ftplugin/taskedit.lua index a905acb..ebc56aa 100644 --- a/nvim/ftplugin/taskedit.lua +++ b/nvim/ftplugin/taskedit.lua @@ -1 +1 @@ -vim.cmd.runtime("ftplugin/taskwarrior.lua") +vim.cmd.runtime("ftplugin/taskwarrior.lua") diff --git a/nvim/ftplugin/taskwarrior.lua b/nvim/ftplugin/taskwarrior.lua index a3c4537..64f8ed7 100644 --- a/nvim/ftplugin/taskwarrior.lua +++ b/nvim/ftplugin/taskwarrior.lua @@ -1,7 +1,7 @@ -local opt = vim.opt_local - -opt.autoindent = false -opt.cindent = false -opt.indentexpr = "" -opt.indentkeys = "" -opt.smartindent = false +local opt = vim.opt_local + +opt.autoindent = false +opt.cindent = false +opt.indentexpr = "" +opt.indentkeys = "" +opt.smartindent = false diff --git a/nvim/ftplugin/typescript.lua b/nvim/ftplugin/typescript.lua index 096143b..087e84c 100644 --- a/nvim/ftplugin/typescript.lua +++ b/nvim/ftplugin/typescript.lua @@ -1,6 +1,6 @@ -local opt = vim.opt_local - -opt.expandtab = true -opt.shiftwidth = 2 -opt.softtabstop = 2 -opt.tabstop = 2 +local opt = vim.opt_local + +opt.expandtab = true +opt.shiftwidth = 2 +opt.softtabstop = 2 +opt.tabstop = 2 diff --git a/nvim/init.lua b/nvim/init.lua index e56561e..bda12b3 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,9 +1,9 @@ -require("config.options") - -local keymaps = require("config.keymaps") -keymaps.global() - -require("config.autocmds") -require("config.usercmds") -require("config.lazy") -require("config.colorscheme") +require("config.options") + +local keymaps = require("config.keymaps") +keymaps.global() + +require("config.autocmds") +require("config.usercmds") +require("config.lazy") +require("config.colorscheme") diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua index 53bf7a9..58adafb 100644 --- a/nvim/lua/config/autocmds.lua +++ b/nvim/lua/config/autocmds.lua @@ -1,43 +1,43 @@ --- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/doc/nvim-treesitter.txt -local treesitter_languages = require("config.treesitter").languages - -local function enable_treesitter_features() - if not pcall(vim.treesitter.start) then return end - - vim.wo.foldmethod = "expr" - vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" - vim.bo.indentexpr = "v:lua.require('nvim-treesitter').indentexpr()" -end - -vim.api.nvim_create_autocmd("FileType", { - pattern = treesitter_languages, - callback = enable_treesitter_features, -}) - --- https://github.com/nvim-tree/nvim-tree.lua/wiki/Auto-Close -vim.api.nvim_create_autocmd("QuitPre", { - callback = function() - local invalid_win = {} - local wins = vim.api.nvim_list_wins() - - for _, w in ipairs(wins) do - local bufname = vim.api.nvim_buf_get_name(vim.api.nvim_win_get_buf(w)) - if bufname:match("NvimTree_") ~= nil then table.insert(invalid_win, w) end - end - - if #invalid_win == #wins - 1 then - -- Should quit, so we close all invalid windows. - for _, w in ipairs(invalid_win) do - vim.api.nvim_win_close(w, true) - end - end - end, -}) - -vim.api.nvim_create_autocmd("LspAttach", { - callback = function(event) - local client = vim.lsp.get_client_by_id(event.data.client_id) - local keymaps = require("config.keymaps") - keymaps.lsp(event.buf, client) - end, -}) +-- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/doc/nvim-treesitter.txt +local treesitter_languages = require("config.treesitter").languages + +local function enable_treesitter_features() + if not pcall(vim.treesitter.start) then return end + + vim.wo.foldmethod = "expr" + vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" + vim.bo.indentexpr = "v:lua.require('nvim-treesitter').indentexpr()" +end + +vim.api.nvim_create_autocmd("FileType", { + pattern = treesitter_languages, + callback = enable_treesitter_features, +}) + +-- https://github.com/nvim-tree/nvim-tree.lua/wiki/Auto-Close +vim.api.nvim_create_autocmd("QuitPre", { + callback = function() + local invalid_win = {} + local wins = vim.api.nvim_list_wins() + + for _, w in ipairs(wins) do + local bufname = vim.api.nvim_buf_get_name(vim.api.nvim_win_get_buf(w)) + if bufname:match("NvimTree_") ~= nil then table.insert(invalid_win, w) end + end + + if #invalid_win == #wins - 1 then + -- Should quit, so we close all invalid windows. + for _, w in ipairs(invalid_win) do + vim.api.nvim_win_close(w, true) + end + end + end, +}) + +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(event) + local client = vim.lsp.get_client_by_id(event.data.client_id) + local keymaps = require("config.keymaps") + keymaps.lsp(event.buf, client) + end, +}) diff --git a/nvim/lua/config/colorscheme.lua b/nvim/lua/config/colorscheme.lua index 8d944c3..dfc8d24 100644 --- a/nvim/lua/config/colorscheme.lua +++ b/nvim/lua/config/colorscheme.lua @@ -1,17 +1,17 @@ --- Fix: Farbschema für Rechtschreibfehler -vim.api.nvim_set_hl(0, "SpellBad", { fg = "#ffffff", bg = "#5f0000" }) -vim.api.nvim_set_hl(0, "SpellCap", { fg = "#000000", bg = "#ffaf00" }) -vim.api.nvim_set_hl(0, "SpellRare", { fg = "#000000", bg = "#5fd7ff" }) -vim.api.nvim_set_hl(0, "SpellLocal", { fg = "#000000", bg = "#5fff87" }) -vim.api.nvim_set_hl(0, "CursorLine", { bg = "#252526" }) - --- Statusline Farben -vim.api.nvim_set_hl(0, "StatuslineModeNormal", { fg = "#1e222a", bg = "#61afef", bold = true }) -vim.api.nvim_set_hl(0, "StatuslineModeInsert", { fg = "#1e222a", bg = "#98c379", bold = true }) -vim.api.nvim_set_hl(0, "StatuslineModeVisual", { fg = "#1e222a", bg = "#c678dd", bold = true }) -vim.api.nvim_set_hl(0, "StatuslineModeReplace", { fg = "#1e222a", bg = "#e86671", bold = true }) -vim.api.nvim_set_hl(0, "StatuslineModeCommand", { fg = "#1e222a", bg = "#e5c07b", bold = true }) - --- NVim-Tree -vim.api.nvim_set_hl(0, "NvimTreeOpenedFile", { bold = true }) -vim.api.nvim_set_hl(0, "NvimTreeCursorLine", { bg = "#2A2D2E" }) +-- Fix: Farbschema für Rechtschreibfehler +vim.api.nvim_set_hl(0, "SpellBad", { fg = "#ffffff", bg = "#5f0000" }) +vim.api.nvim_set_hl(0, "SpellCap", { fg = "#000000", bg = "#ffaf00" }) +vim.api.nvim_set_hl(0, "SpellRare", { fg = "#000000", bg = "#5fd7ff" }) +vim.api.nvim_set_hl(0, "SpellLocal", { fg = "#000000", bg = "#5fff87" }) +vim.api.nvim_set_hl(0, "CursorLine", { bg = "#252526" }) + +-- Statusline Farben +vim.api.nvim_set_hl(0, "StatuslineModeNormal", { fg = "#1e222a", bg = "#61afef", bold = true }) +vim.api.nvim_set_hl(0, "StatuslineModeInsert", { fg = "#1e222a", bg = "#98c379", bold = true }) +vim.api.nvim_set_hl(0, "StatuslineModeVisual", { fg = "#1e222a", bg = "#c678dd", bold = true }) +vim.api.nvim_set_hl(0, "StatuslineModeReplace", { fg = "#1e222a", bg = "#e86671", bold = true }) +vim.api.nvim_set_hl(0, "StatuslineModeCommand", { fg = "#1e222a", bg = "#e5c07b", bold = true }) + +-- NVim-Tree +vim.api.nvim_set_hl(0, "NvimTreeOpenedFile", { bold = true }) +vim.api.nvim_set_hl(0, "NvimTreeCursorLine", { bg = "#2A2D2E" }) diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index 76f59cb..972e777 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -1,32 +1,32 @@ --- https://lazy.folke.io/installation - -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.uv.fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - spec = { - { import = "plugins" }, - }, - checker = { - enabled = true, - notify = false, - frequency = 86400, -- Sekunden (1 Tag) - log = true, - }, - rocks = { - enabled = false, - }, -}) +-- https://lazy.folke.io/installation + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.uv.fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = { + { import = "plugins" }, + }, + checker = { + enabled = true, + notify = false, + frequency = 86400, -- Sekunden (1 Tag) + log = true, + }, + rocks = { + enabled = false, + }, +}) diff --git a/nvim/lua/config/statusline.lua b/nvim/lua/config/statusline.lua index 8a9c75a..3a6f1c7 100644 --- a/nvim/lua/config/statusline.lua +++ b/nvim/lua/config/statusline.lua @@ -1,182 +1,182 @@ -local M = {} - -local modes = { - n = { "NORMAL", "StatuslineModeNormal" }, - i = { "INSERT", "StatuslineModeInsert" }, - v = { "VISUAL", "StatuslineModeVisual" }, - V = { "V-LINE", "StatuslineModeVisual" }, - [""] = { "V-BLOCK", "StatuslineModeVisual" }, - R = { "REPLACE", "StatuslineModeReplace" }, - c = { "COMMAND", "StatuslineModeCommand" }, -} - -local function mode() - local m = vim.fn.mode() - local entry = modes[m] or { m, "StatusLine" } - return string.format("%%#%s# %s %%#StatusLine#", entry[2], entry[1]) -end - ----------------------------------------------------------------------- --- Git branch (buffer-lokal, gecached, kein redraw-spam) ----------------------------------------------------------------------- - --- /dev/null gibt es unter Windows nicht (cmd.exe versteht das nicht als --- Pfad und meldet "Das System kann den angegebenen Pfad nicht finden"). -local devnull = vim.fn.has("win32") == 1 and "NUL" or "/dev/null" - -local function update_git_branch(bufnr) - bufnr = bufnr or 0 - - -- nur in echten Dateien - if vim.bo[bufnr].buftype ~= "" then - vim.b[bufnr].git_branch = "" - return - end - - -- kein Git → nichts tun - if vim.fn.executable("git") ~= 1 then - vim.b[bufnr].git_branch = "" - return - end - - local branch = vim.fn.systemlist("git rev-parse --abbrev-ref HEAD 2>" .. devnull)[1] - if branch then - -- unter Windows bleibt an systemlist()-Zeilen mitunter ein - -- trailing \r haengen (^M in der Statuszeile sichtbar) - branch = branch:gsub("\r$", "") - end - - if branch and branch ~= "" then - vim.b[bufnr].git_branch = "  " .. branch .. " " - else - vim.b[bufnr].git_branch = "" - end -end - ----------------------------------------------------------------------- --- Autocmd: Git nur bei Bedarf aktualisieren ----------------------------------------------------------------------- - -vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained" }, { - callback = function(args) - update_git_branch(args.buf) - end, -}) - ----------------------------------------------------------------------- --- Statusline-Sektionen (reine Darstellung, keine IO) ----------------------------------------------------------------------- - --- Git-Branch (buffer-lokal, gecached, kein redraw-spam) - -local function git() - return vim.b.git_branch or "" -end - --- Git-Diff (buffer-lokal, kein redraw-spam) - -local function git_diff() - local gsd = vim.b.gitsigns_status_dict - if not gsd then return "" end - - local parts = {} - if gsd.added and gsd.added > 0 then table.insert(parts, "+" .. gsd.added) end - if gsd.changed and gsd.changed > 0 then table.insert(parts, "~" .. gsd.changed) end - if gsd.removed and gsd.removed > 0 then table.insert(parts, "-" .. gsd.removed) end - - if #parts > 0 then return " " .. table.concat(parts, " ") .. " " end - - return "" -end - ----------------------------------------------------------------------- --- Dateiname mit Modifikationsstatus ----------------------------------------------------------------------- - -local function filename() - local name = vim.fn.expand("%:.") - if name == "" then name = "[No Name]" end - - if vim.bo.modified then name = name .. " [+]" end - - return " " .. name .. " " -end - ------------------------------------------------------------------------- --- Treesitter-Aktivität (buffer-lokal, kein redraw-spam) ------------------------------------------------------------------------- - -local function treesitter() - local ok = vim.treesitter.highlighter.active[vim.api.nvim_get_current_buf()] - if ok then return " 🌳 " end - return "" -end - ------------------------------------------------------------------------- --- Diagnostik-Counts (buffer-lokal, kein redraw-spam) ------------------------------------------------------------------------- - -local function diagnostics() - local counts = { - error = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR }), - warn = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN }), - info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO }), - hint = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT }), - } - - local parts = {} - - if counts.error > 0 then table.insert(parts, "  " .. counts.error) end - if counts.warn > 0 then table.insert(parts, "  " .. counts.warn) end - if counts.info > 0 then table.insert(parts, "  " .. counts.info) end - if counts.hint > 0 then table.insert(parts, "  " .. counts.hint) end - - if #parts > 0 then return " " .. table.concat(parts, " ") .. " " end - - return "" -end - ------------------------------------------------------------------------- --- Filetype & Encoding (buffer-lokal, kein redraw-spam) ------------------------------------------------------------------------- - -local function fileinfo() - local ft = vim.bo.filetype ~= "" and vim.bo.filetype or "none" - local enc = vim.bo.fileencoding ~= "" and vim.bo.fileencoding or vim.o.encoding - return string.format(" %s %s ", ft, enc) -end - ------------------------------------------------------------------------- --- Cursor-Position (kein redraw-spam) ------------------------------------------------------------------------- - -local function position() - return string.format(" %d:%d ", vim.fn.line("."), vim.fn.col(".")) -end - ----------------------------------------------------------------------- --- Öffentliche Statusline-Funktion ----------------------------------------------------------------------- - -function M.statusline() - return table.concat({ - -- LEFT: Mode & Context - mode(), - "%#PmenuSel#", - git(), - git_diff(), - "%#StatusLine#", - filename(), - - "%=", - - -- RIGHT: Feedback & Meta - diagnostics(), - treesitter(), - fileinfo(), - " %p%% ", - position(), - }) -end - -return M +local M = {} + +local modes = { + n = { "NORMAL", "StatuslineModeNormal" }, + i = { "INSERT", "StatuslineModeInsert" }, + v = { "VISUAL", "StatuslineModeVisual" }, + V = { "V-LINE", "StatuslineModeVisual" }, + [""] = { "V-BLOCK", "StatuslineModeVisual" }, + R = { "REPLACE", "StatuslineModeReplace" }, + c = { "COMMAND", "StatuslineModeCommand" }, +} + +local function mode() + local m = vim.fn.mode() + local entry = modes[m] or { m, "StatusLine" } + return string.format("%%#%s# %s %%#StatusLine#", entry[2], entry[1]) +end + +---------------------------------------------------------------------- +-- Git branch (buffer-lokal, gecached, kein redraw-spam) +---------------------------------------------------------------------- + +-- /dev/null gibt es unter Windows nicht (cmd.exe versteht das nicht als +-- Pfad und meldet "Das System kann den angegebenen Pfad nicht finden"). +local devnull = vim.fn.has("win32") == 1 and "NUL" or "/dev/null" + +local function update_git_branch(bufnr) + bufnr = bufnr or 0 + + -- nur in echten Dateien + if vim.bo[bufnr].buftype ~= "" then + vim.b[bufnr].git_branch = "" + return + end + + -- kein Git → nichts tun + if vim.fn.executable("git") ~= 1 then + vim.b[bufnr].git_branch = "" + return + end + + local branch = vim.fn.systemlist("git rev-parse --abbrev-ref HEAD 2>" .. devnull)[1] + if branch then + -- unter Windows bleibt an systemlist()-Zeilen mitunter ein + -- trailing \r haengen (^M in der Statuszeile sichtbar) + branch = branch:gsub("\r$", "") + end + + if branch and branch ~= "" then + vim.b[bufnr].git_branch = "  " .. branch .. " " + else + vim.b[bufnr].git_branch = "" + end +end + +---------------------------------------------------------------------- +-- Autocmd: Git nur bei Bedarf aktualisieren +---------------------------------------------------------------------- + +vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained" }, { + callback = function(args) + update_git_branch(args.buf) + end, +}) + +---------------------------------------------------------------------- +-- Statusline-Sektionen (reine Darstellung, keine IO) +---------------------------------------------------------------------- + +-- Git-Branch (buffer-lokal, gecached, kein redraw-spam) + +local function git() + return vim.b.git_branch or "" +end + +-- Git-Diff (buffer-lokal, kein redraw-spam) + +local function git_diff() + local gsd = vim.b.gitsigns_status_dict + if not gsd then return "" end + + local parts = {} + if gsd.added and gsd.added > 0 then table.insert(parts, "+" .. gsd.added) end + if gsd.changed and gsd.changed > 0 then table.insert(parts, "~" .. gsd.changed) end + if gsd.removed and gsd.removed > 0 then table.insert(parts, "-" .. gsd.removed) end + + if #parts > 0 then return " " .. table.concat(parts, " ") .. " " end + + return "" +end + +---------------------------------------------------------------------- +-- Dateiname mit Modifikationsstatus +---------------------------------------------------------------------- + +local function filename() + local name = vim.fn.expand("%:.") + if name == "" then name = "[No Name]" end + + if vim.bo.modified then name = name .. " [+]" end + + return " " .. name .. " " +end + +------------------------------------------------------------------------ +-- Treesitter-Aktivität (buffer-lokal, kein redraw-spam) +------------------------------------------------------------------------ + +local function treesitter() + local ok = vim.treesitter.highlighter.active[vim.api.nvim_get_current_buf()] + if ok then return " 🌳 " end + return "" +end + +------------------------------------------------------------------------ +-- Diagnostik-Counts (buffer-lokal, kein redraw-spam) +------------------------------------------------------------------------ + +local function diagnostics() + local counts = { + error = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR }), + warn = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN }), + info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO }), + hint = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT }), + } + + local parts = {} + + if counts.error > 0 then table.insert(parts, "  " .. counts.error) end + if counts.warn > 0 then table.insert(parts, "  " .. counts.warn) end + if counts.info > 0 then table.insert(parts, "  " .. counts.info) end + if counts.hint > 0 then table.insert(parts, "  " .. counts.hint) end + + if #parts > 0 then return " " .. table.concat(parts, " ") .. " " end + + return "" +end + +------------------------------------------------------------------------ +-- Filetype & Encoding (buffer-lokal, kein redraw-spam) +------------------------------------------------------------------------ + +local function fileinfo() + local ft = vim.bo.filetype ~= "" and vim.bo.filetype or "none" + local enc = vim.bo.fileencoding ~= "" and vim.bo.fileencoding or vim.o.encoding + return string.format(" %s %s ", ft, enc) +end + +------------------------------------------------------------------------ +-- Cursor-Position (kein redraw-spam) +------------------------------------------------------------------------ + +local function position() + return string.format(" %d:%d ", vim.fn.line("."), vim.fn.col(".")) +end + +---------------------------------------------------------------------- +-- Öffentliche Statusline-Funktion +---------------------------------------------------------------------- + +function M.statusline() + return table.concat({ + -- LEFT: Mode & Context + mode(), + "%#PmenuSel#", + git(), + git_diff(), + "%#StatusLine#", + filename(), + + "%=", + + -- RIGHT: Feedback & Meta + diagnostics(), + treesitter(), + fileinfo(), + " %p%% ", + position(), + }) +end + +return M diff --git a/nvim/lua/config/treesitter.lua b/nvim/lua/config/treesitter.lua index 1eee267..d900e41 100644 --- a/nvim/lua/config/treesitter.lua +++ b/nvim/lua/config/treesitter.lua @@ -1,28 +1,28 @@ -local M = {} - --- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/SUPPORTED_LANGUAGES.md -M.languages = { - "bash", - "c", - "cpp", - "html", - "javascript", - "jq", - "json", - "lua", - "make", - "markdown", - "markdown_inline", - "po", - "powershell", - "prisma", - "python", - "typescript", - "vim", - "vimdoc", - "xml", - "yaml", - "zsh", -} - -return M +local M = {} + +-- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/SUPPORTED_LANGUAGES.md +M.languages = { + "bash", + "c", + "cpp", + "html", + "javascript", + "jq", + "json", + "lua", + "make", + "markdown", + "markdown_inline", + "po", + "powershell", + "prisma", + "python", + "typescript", + "vim", + "vimdoc", + "xml", + "yaml", + "zsh", +} + +return M diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua index 4912815..6e20d73 100644 --- a/nvim/lua/plugins/completion.lua +++ b/nvim/lua/plugins/completion.lua @@ -1,46 +1,46 @@ -return { - { - "saghen/blink.cmp", - dependencies = { "rafamadriz/friendly-snippets" }, - version = "1.*", - - opts = { - keymap = { preset = "default" }, - - appearance = { - use_nvim_cmp_as_default = true, - nerd_font_variant = "mono", - }, - - completion = { - documentation = { - auto_show = false, - window = { - border = "rounded", - }, - }, - - menu = { - border = "rounded", - }, - }, - - signature = { - enabled = true, - window = { - border = "rounded", - }, - }, - - sources = { - default = { "lsp", "path", "snippets", "buffer" }, - }, - - fuzzy = { - implementation = "prefer_rust_with_warning", - }, - }, - - opts_extend = { "sources.default" }, - }, -} +return { + { + "saghen/blink.cmp", + dependencies = { "rafamadriz/friendly-snippets" }, + version = "1.*", + + opts = { + keymap = { preset = "default" }, + + appearance = { + use_nvim_cmp_as_default = true, + nerd_font_variant = "mono", + }, + + completion = { + documentation = { + auto_show = false, + window = { + border = "rounded", + }, + }, + + menu = { + border = "rounded", + }, + }, + + signature = { + enabled = true, + window = { + border = "rounded", + }, + }, + + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + }, + + fuzzy = { + implementation = "prefer_rust_with_warning", + }, + }, + + opts_extend = { "sources.default" }, + }, +} diff --git a/nvim/lua/plugins/editing.lua b/nvim/lua/plugins/editing.lua index b9f9283..38e651c 100644 --- a/nvim/lua/plugins/editing.lua +++ b/nvim/lua/plugins/editing.lua @@ -1,32 +1,32 @@ -return { - { - "tpope/vim-repeat", - event = "VeryLazy", - }, - - { - "tpope/vim-surround", -- alternative: "kylechui/nvim-surround" - event = "VeryLazy", - }, - - { - "romainl/vim-cool", - event = "VeryLazy", - }, - - { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = true, - }, - - { - "windwp/nvim-ts-autotag", - event = "InsertEnter", - }, - - { - "preservim/vim-markdown", - ft = "markdown", - }, -} +return { + { + "tpope/vim-repeat", + event = "VeryLazy", + }, + + { + "tpope/vim-surround", -- alternative: "kylechui/nvim-surround" + event = "VeryLazy", + }, + + { + "romainl/vim-cool", + event = "VeryLazy", + }, + + { + "windwp/nvim-autopairs", + event = "InsertEnter", + config = true, + }, + + { + "windwp/nvim-ts-autotag", + event = "InsertEnter", + }, + + { + "preservim/vim-markdown", + ft = "markdown", + }, +} diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index 8ca7f1b..102326c 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua @@ -1,46 +1,46 @@ --- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters - -local clang = {} -local gawk = { "gawk" } -- brew install gawk, pkg install gawk -local jq = { "jq" } -- brew install jq, pkg install jq -local prettier = { "prettier" } -- npm install -g prettier -local ruff = { "ruff_format" } -- brew install ruff, pkg install ruff -local shfmt = { "shfmt" } -- brew install shfmt, pkg install shfmt -local stylua = { "stylua" } -- brew install stylua, pkg install stylua -local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2) -local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt - -return { - "stevearc/conform.nvim", - event = { "BufReadPre", "BufNewFile" }, - keys = { - { - "cf", - function() - require("conform").format({ async = true }) - end, - desc = "Format file", - }, - }, - opts = { - formatters_by_ft = { - awk = gawk, - bash = shfmt, - c = clang, - cpp = clang, - html = prettier, - javascript = prettier, - json = jq, - lua = stylua, - python = ruff, - sh = shfmt, - typescript = prettier, - xml = xmllint, - xsd = xmllint, - yaml = yamlfmt, - }, - default_format_opts = { - lsp_format = "fallback", - }, - }, -} +-- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters + +local clang = {} +local gawk = { "gawk" } -- brew install gawk, pkg install gawk +local jq = { "jq" } -- brew install jq, pkg install jq +local prettier = { "prettier" } -- npm install -g prettier +local ruff = { "ruff_format" } -- brew install ruff, pkg install ruff +local shfmt = { "shfmt" } -- brew install shfmt, pkg install shfmt +local stylua = { "stylua" } -- brew install stylua, pkg install stylua +local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2) +local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt + +return { + "stevearc/conform.nvim", + event = { "BufReadPre", "BufNewFile" }, + keys = { + { + "cf", + function() + require("conform").format({ async = true }) + end, + desc = "Format file", + }, + }, + opts = { + formatters_by_ft = { + awk = gawk, + bash = shfmt, + c = clang, + cpp = clang, + html = prettier, + javascript = prettier, + json = jq, + lua = stylua, + python = ruff, + sh = shfmt, + typescript = prettier, + xml = xmllint, + xsd = xmllint, + yaml = yamlfmt, + }, + default_format_opts = { + lsp_format = "fallback", + }, + }, +} diff --git a/nvim/lua/plugins/git.lua b/nvim/lua/plugins/git.lua index ed7bafe..37d5ee3 100644 --- a/nvim/lua/plugins/git.lua +++ b/nvim/lua/plugins/git.lua @@ -1,16 +1,16 @@ -return { - { - "lewis6991/gitsigns.nvim", - event = { "BufReadPre", "BufNewFile" }, - opts = { - current_line_blame = true, - current_line_blame_opts = { - delay = 250, - }, - }, - config = function(_, opts) - require("gitsigns").setup(opts) - require("config.keymaps").gitsigns() - end, - }, -} +return { + { + "lewis6991/gitsigns.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = { + current_line_blame = true, + current_line_blame_opts = { + delay = 250, + }, + }, + config = function(_, opts) + require("gitsigns").setup(opts) + require("config.keymaps").gitsigns() + end, + }, +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index b301b68..812ed24 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -1,124 +1,124 @@ -return { - { - "neovim/nvim-lspconfig", - dependencies = { "saghen/blink.cmp" }, - lazy = false, - config = function() - local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities()) - - vim.lsp.config.lua_ls = { - capabilities = capabilities, - settings = { - Lua = { - runtime = { - version = "LuaJIT", - }, - diagnostics = { - globals = { "vim" }, - }, - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME .. "/lua", - vim.fn.stdpath("config") .. "/lua", - }, - }, - telemetry = { - enable = false, - }, - }, - }, - } - - vim.lsp.config.bashls = { - capabilities = capabilities, - filetypes = { "sh", "bash" }, - } - - vim.lsp.config.clangd = { - capabilities = capabilities, - cmd = { - "clangd", - "--background-index", - "--clang-tidy", - "--completion-style=detailed", - "--header-insertion=iwyu", - "--header-insertion-decorators", - "--pch-storage=memory", - "--all-scopes-completion", - "--inlay-hints", - "--function-arg-placeholders", - "--fallback-style=llvm", - }, - } - - vim.lsp.config.prismals = { - capabilities = capabilities, - } - - vim.lsp.config.jsonls = { - capabilities = capabilities, - } - - vim.lsp.config.html = { - capabilities = capabilities, - } - - vim.lsp.config.vtsls = { - capabilities = capabilities, - settings = { - typescript = { - updateImportsOnFileMove = { enabled = "always" }, - suggest = { - completeFunctionCalls = true, - }, - inlayHints = { - enumMemberValues = { enabled = true }, - functionLikeReturnTypes = { enabled = true }, - parameterNames = { enabled = "all" }, - parameterTypes = { enabled = true }, - propertyDeclarationTypes = { enabled = true }, - variableTypes = { enabled = false }, - }, - }, - javascript = { - suggest = { - completeFunctionCalls = true, - }, - inlayHints = { - parameterNames = { enabled = "all" }, - }, - }, - }, - } - - vim.lsp.config.basedpyright = { - capabilities = capabilities, - settings = { - basedpyright = { - analysis = { - diagnosticMode = "openFilesOnly", - inlayHints = { - callArgumentNames = true, - }, - typeCheckingMode = "basic", -- oder "strict" für strenger - autoSearchPaths = true, - useLibraryCodeForTypes = true, - }, - }, - }, - } - - vim.lsp.enable({ - "basedpyright", -- npm install -g basedpyright, brew install basedpyright - "bashls", -- npm install -g bash-language-server, pkg install hs-ShellCheck - "clangd", -- pkg install llvm - "html", -- npm install -g vscode-langservers-extracted - "jsonls", -- npm install -g vscode-langservers-extracted - "lua_ls", -- pkg install lua-language-server, brew install lua-language-server - "prismals", -- npm install -g @prisma/language-server - "vtsls", -- npm install -g @vtsls/language-server - }) - end, - }, -} +return { + { + "neovim/nvim-lspconfig", + dependencies = { "saghen/blink.cmp" }, + lazy = false, + config = function() + local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities()) + + vim.lsp.config.lua_ls = { + capabilities = capabilities, + settings = { + Lua = { + runtime = { + version = "LuaJIT", + }, + diagnostics = { + globals = { "vim" }, + }, + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME .. "/lua", + vim.fn.stdpath("config") .. "/lua", + }, + }, + telemetry = { + enable = false, + }, + }, + }, + } + + vim.lsp.config.bashls = { + capabilities = capabilities, + filetypes = { "sh", "bash" }, + } + + vim.lsp.config.clangd = { + capabilities = capabilities, + cmd = { + "clangd", + "--background-index", + "--clang-tidy", + "--completion-style=detailed", + "--header-insertion=iwyu", + "--header-insertion-decorators", + "--pch-storage=memory", + "--all-scopes-completion", + "--inlay-hints", + "--function-arg-placeholders", + "--fallback-style=llvm", + }, + } + + vim.lsp.config.prismals = { + capabilities = capabilities, + } + + vim.lsp.config.jsonls = { + capabilities = capabilities, + } + + vim.lsp.config.html = { + capabilities = capabilities, + } + + vim.lsp.config.vtsls = { + capabilities = capabilities, + settings = { + typescript = { + updateImportsOnFileMove = { enabled = "always" }, + suggest = { + completeFunctionCalls = true, + }, + inlayHints = { + enumMemberValues = { enabled = true }, + functionLikeReturnTypes = { enabled = true }, + parameterNames = { enabled = "all" }, + parameterTypes = { enabled = true }, + propertyDeclarationTypes = { enabled = true }, + variableTypes = { enabled = false }, + }, + }, + javascript = { + suggest = { + completeFunctionCalls = true, + }, + inlayHints = { + parameterNames = { enabled = "all" }, + }, + }, + }, + } + + vim.lsp.config.basedpyright = { + capabilities = capabilities, + settings = { + basedpyright = { + analysis = { + diagnosticMode = "openFilesOnly", + inlayHints = { + callArgumentNames = true, + }, + typeCheckingMode = "basic", -- oder "strict" für strenger + autoSearchPaths = true, + useLibraryCodeForTypes = true, + }, + }, + }, + } + + vim.lsp.enable({ + "basedpyright", -- npm install -g basedpyright, brew install basedpyright + "bashls", -- npm install -g bash-language-server, pkg install hs-ShellCheck + "clangd", -- pkg install llvm + "html", -- npm install -g vscode-langservers-extracted + "jsonls", -- npm install -g vscode-langservers-extracted + "lua_ls", -- pkg install lua-language-server, brew install lua-language-server + "prismals", -- npm install -g @prisma/language-server + "vtsls", -- npm install -g @vtsls/language-server + }) + end, + }, +} diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index d7fd279..d4e3fd3 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -1,21 +1,21 @@ -return { - { - "nvim-telescope/telescope.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - }, - lazy = true, - opts = { - defaults = { - path_display = { "smart", "truncate" }, - }, - }, - keys = { - { "ff", "Telescope find_files", desc = "Find files" }, - { "fg", "Telescope live_grep", desc = "Live grep" }, - { "fb", "Telescope buffers", desc = "Buffers" }, - { "fh", "Telescope help_tags", desc = "Help tags" }, - { "dd", "Telescope diagnostics", desc = "Diagnostics" }, - }, - }, -} +return { + { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + lazy = true, + opts = { + defaults = { + path_display = { "smart", "truncate" }, + }, + }, + keys = { + { "ff", "Telescope find_files", desc = "Find files" }, + { "fg", "Telescope live_grep", desc = "Live grep" }, + { "fb", "Telescope buffers", desc = "Buffers" }, + { "fh", "Telescope help_tags", desc = "Help tags" }, + { "dd", "Telescope diagnostics", desc = "Diagnostics" }, + }, + }, +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index faa850a..954e05f 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -1,22 +1,22 @@ --- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/README.md - --- Stelle sicher, dass die TreeSitter-CLI installiert ist: --- MacOS: `brew install tree-sitter-cli` --- FreeBSD: `doas pkg install tree-sitter-cli` - -return { - { - "nvim-treesitter/nvim-treesitter", - branch = "main", - build = ":TSUpdate", - lazy = false, - opts = {}, - config = function(_, opts) - local treesitter = require("nvim-treesitter") - local langs = require("config.treesitter").languages - - treesitter.setup(opts) - treesitter.install(langs) - end, - }, -} +-- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/README.md + +-- Stelle sicher, dass die TreeSitter-CLI installiert ist: +-- MacOS: `brew install tree-sitter-cli` +-- FreeBSD: `doas pkg install tree-sitter-cli` + +return { + { + "nvim-treesitter/nvim-treesitter", + branch = "main", + build = ":TSUpdate", + lazy = false, + opts = {}, + config = function(_, opts) + local treesitter = require("nvim-treesitter") + local langs = require("config.treesitter").languages + + treesitter.setup(opts) + treesitter.install(langs) + end, + }, +} diff --git a/nvim/stylua.toml b/nvim/stylua.toml index 28b83c7..133302c 100644 --- a/nvim/stylua.toml +++ b/nvim/stylua.toml @@ -1,13 +1,13 @@ -syntax = "All" -column_width = 120 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferDouble" -call_parentheses = "Always" -collapse_simple_statement = "ConditionalOnly" -space_after_function_names = "Never" -block_newline_gaps = "Never" - -[sort_requires] -enabled = false +syntax = "All" +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "Always" +collapse_simple_statement = "ConditionalOnly" +space_after_function_names = "Never" +block_newline_gaps = "Never" + +[sort_requires] +enabled = false diff --git a/readme.md b/readme.md index abeacb7..8f1a2bc 100644 --- a/readme.md +++ b/readme.md @@ -1,78 +1,78 @@ -# Dotfiles - -My personal dotfiles for macOS, FreeBSD and Windows (Beta). - -## Setup - -### macOS / FreeBSD - -Create the symbolic links: - -```sh -./install.sh -``` - -Bootstrap the Neovim environment: - -```sh -./bootstrap/neovim.sh -./bootstrap/neovim-dict.sh -``` - -Bootstrap the zsh environment: - -```sh -./bootstrap/zsh.sh -``` - -Bootstrap the git environment: - -```sh -./bootstrap/git.sh -``` - -### Windows - -Native PowerShell, no WSL/Git Bash required: - -```powershell -.\install-win.ps1 -.\bootstrap-win\git.ps1 -.\bootstrap-win\neovim.ps1 -.\bootstrap-win\neovim-dict.ps1 -``` - -See [neovim-windows-setup.md](neovim-windows-setup.md) for prerequisites (execution policy, MSVC Developer PowerShell for `nvim-treesitter`, ...) and known caveats. - -## Included configuration - -- [abook] -- [gdb] -- [git] -- [mpd] & [ncmpcpp] -- [newsboat] -- [nvi] -- [npm] -- [neovim] -- [tmux] -- [vit] & [taskwarrior] -- [wyrd] & [remind] -- [X11] -- [zsh] - -[abook]: https://abook.sourceforge.io/ -[gdb]: https://sourceware.org/gdb/ -[git]: https://git-scm.com/ -[mpd]: https://www.musicpd.org/ -[ncmpcpp]: https://github.com/ncmpcpp/ncmpcpp -[newsboat]: https://newsboat.org/ -[nvi]: https://sites.google.com/a/bostic.com/keithbostic/the-berkeley-vi-editor-home-page -[npm]: https://www.npmjs.com/ -[neovim]: https://neovim.io/ -[taskwarrior]: https://taskwarrior.org/ -[tmux]: https://github.com/tmux/tmux/wiki -[vit]: https://github.com/vit-project/vit -[wyrd]: https://wyrd-calendar.gitlab.io/wyrd/ -[remind]: https://dianne.skoll.ca/projects/remind/ -[X11]: https://www.x.org/ -[zsh]: https://www.zsh.org/ +# Dotfiles + +My personal dotfiles for macOS, FreeBSD and Windows (Beta). + +## Setup + +### macOS / FreeBSD + +Create the symbolic links: + +```sh +./install.sh +``` + +Bootstrap the Neovim environment: + +```sh +./bootstrap/neovim.sh +./bootstrap/neovim-dict.sh +``` + +Bootstrap the zsh environment: + +```sh +./bootstrap/zsh.sh +``` + +Bootstrap the git environment: + +```sh +./bootstrap/git.sh +``` + +### Windows + +Native PowerShell, no WSL/Git Bash required: + +```powershell +.\install-win.ps1 +.\bootstrap-win\git.ps1 +.\bootstrap-win\neovim.ps1 +.\bootstrap-win\neovim-dict.ps1 +``` + +See [neovim-windows-setup.md](neovim-windows-setup.md) for prerequisites (execution policy, MSVC Developer PowerShell for `nvim-treesitter`, ...) and known caveats. + +## Included configuration + +- [abook] +- [gdb] +- [git] +- [mpd] & [ncmpcpp] +- [newsboat] +- [nvi] +- [npm] +- [neovim] +- [tmux] +- [vit] & [taskwarrior] +- [wyrd] & [remind] +- [X11] +- [zsh] + +[abook]: https://abook.sourceforge.io/ +[gdb]: https://sourceware.org/gdb/ +[git]: https://git-scm.com/ +[mpd]: https://www.musicpd.org/ +[ncmpcpp]: https://github.com/ncmpcpp/ncmpcpp +[newsboat]: https://newsboat.org/ +[nvi]: https://sites.google.com/a/bostic.com/keithbostic/the-berkeley-vi-editor-home-page +[npm]: https://www.npmjs.com/ +[neovim]: https://neovim.io/ +[taskwarrior]: https://taskwarrior.org/ +[tmux]: https://github.com/tmux/tmux/wiki +[vit]: https://github.com/vit-project/vit +[wyrd]: https://wyrd-calendar.gitlab.io/wyrd/ +[remind]: https://dianne.skoll.ca/projects/remind/ +[X11]: https://www.x.org/ +[zsh]: https://www.zsh.org/ diff --git a/taskwarrior/taskrc b/taskwarrior/taskrc index 3588c10..3a7d6d0 100644 --- a/taskwarrior/taskrc +++ b/taskwarrior/taskrc @@ -1,46 +1,46 @@ -# vim: filetype=dosini - -# [Created by task 2.6.2 4/16/2023 10:58:10] -# Taskwarrior program configuration file. -# For more documentation, see https://taskwarrior.org or try 'man task', 'man task-color', -# 'man task-sync' or 'man taskrc' - -# Here is an example of entries that use the default, override and blank values -# variable=foo -- By specifying a value, this overrides the default -# variable= -- By specifying no value, this means no default -# #variable=foo -- By commenting out the line, or deleting it, this uses the default - -# You can also refence environment variables: -# variable=$HOME/task -# variable=$VALUE - -# Use the command 'task show' to see all defaults and overrides - -# Files -data.location=~/.task -weekstart=Monday -color=1 - -# To use the default location of the XDG directories, -# move this configuration file from ~/.taskrc to ~/.config/task/taskrc and uncomment below - -#data.location=~/.local/share/task -#hooks.location=~/.config/task/hooks - -# Color theme (uncomment one to use) -#include light-16.theme -#include light-256.theme -#include dark-16.theme -#include dark-256.theme -#include dark-red-256.theme -#include dark-green-256.theme -#include dark-blue-256.theme -#include dark-violets-256.theme -#include dark-yellow-green.theme -#include dark-gray-256.theme -include dark-gray-blue-256.theme -#include solarized-dark-256.theme -#include solarized-light-256.theme -#include no-color.theme - -news.version=2.6.0 +# vim: filetype=dosini + +# [Created by task 2.6.2 4/16/2023 10:58:10] +# Taskwarrior program configuration file. +# For more documentation, see https://taskwarrior.org or try 'man task', 'man task-color', +# 'man task-sync' or 'man taskrc' + +# Here is an example of entries that use the default, override and blank values +# variable=foo -- By specifying a value, this overrides the default +# variable= -- By specifying no value, this means no default +# #variable=foo -- By commenting out the line, or deleting it, this uses the default + +# You can also refence environment variables: +# variable=$HOME/task +# variable=$VALUE + +# Use the command 'task show' to see all defaults and overrides + +# Files +data.location=~/.task +weekstart=Monday +color=1 + +# To use the default location of the XDG directories, +# move this configuration file from ~/.taskrc to ~/.config/task/taskrc and uncomment below + +#data.location=~/.local/share/task +#hooks.location=~/.config/task/hooks + +# Color theme (uncomment one to use) +#include light-16.theme +#include light-256.theme +#include dark-16.theme +#include dark-256.theme +#include dark-red-256.theme +#include dark-green-256.theme +#include dark-blue-256.theme +#include dark-violets-256.theme +#include dark-yellow-green.theme +#include dark-gray-256.theme +include dark-gray-blue-256.theme +#include solarized-dark-256.theme +#include solarized-light-256.theme +#include no-color.theme + +news.version=2.6.0 diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 8a9fa3b..fdb063b 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -1,32 +1,32 @@ -set -g mouse on -set -g default-terminal "tmux-256color" -set -g terminal-features ",xterm*:RGB" -set -g terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' -set -g status on -set -g status-left " #[fg=darkblue]#S#[fg=black] | " -set -g status-left-length 20 -set -g status-right "#[fg=black] | #[fg=darkblue]%H:%M " -set -g status-right-length 35 -set -g status-interval 30 -set -g base-index 1 -set -g pane-base-index 1 -set -g renumber-windows on -set -g history-limit 10000 -set -g escape-time 0 -set -g aggressive-resize on -set -g window-status-style fg=black,bg=green,bold -set -g window-status-current-style fg=white,bg=brightblue,bold -set -g mode-keys vi -set -g focus-events on - -bind h selectp -L -bind j selectp -D -bind k selectp -U -bind l selectp -R - -bind m set -g mouse \; display "mouse #{?mouse,ON,OFF}" -bind C-t set -g status -bind r source ~/.config/tmux/tmux.conf \; display-message "configuration reloaded" - -bind % splitw -h -c "#{pane_current_path}" -bind '"' splitw -c "#{pane_current_path}" +set -g mouse on +set -g default-terminal "tmux-256color" +set -g terminal-features ",xterm*:RGB" +set -g terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' +set -g status on +set -g status-left " #[fg=darkblue]#S#[fg=black] | " +set -g status-left-length 20 +set -g status-right "#[fg=black] | #[fg=darkblue]%H:%M " +set -g status-right-length 35 +set -g status-interval 30 +set -g base-index 1 +set -g pane-base-index 1 +set -g renumber-windows on +set -g history-limit 10000 +set -g escape-time 0 +set -g aggressive-resize on +set -g window-status-style fg=black,bg=green,bold +set -g window-status-current-style fg=white,bg=brightblue,bold +set -g mode-keys vi +set -g focus-events on + +bind h selectp -L +bind j selectp -D +bind k selectp -U +bind l selectp -R + +bind m set -g mouse \; display "mouse #{?mouse,ON,OFF}" +bind C-t set -g status +bind r source ~/.config/tmux/tmux.conf \; display-message "configuration reloaded" + +bind % splitw -h -c "#{pane_current_path}" +bind '"' splitw -c "#{pane_current_path}" diff --git a/vit/config.ini b/vit/config.ini index 70e7bee..62cfbb4 100644 --- a/vit/config.ini +++ b/vit/config.ini @@ -1,256 +1,256 @@ -# This is the user configuration file for VIT. - -# All configuration options are listed here, commented out, and showing their -# default value when not otherwise set. - -# The format is standard INI file format. Configuration sections are enclosed -# by brackets. Configuration values should be placed in their relevant section, -# using a 'name = value' format. Boolean values can be expressed by the -# following: -# True values: 1, yes, true (case insensitive) -# False values: All other values. - - -[taskwarrior] - -# Full path to the Taskwarrior configuration file. Tilde will be expanded to -# the user's home directory. -# NOTE: This setting is overridden by the TASKRC environment variable. -#taskrc = ~/.taskrc - - -[vit] - -# The keybinding map to use. This maps actions registered with VIT to be fired -# when the user presses the specific keys configured in the keybindings file. -# Possible keybindings are in the 'keybinding' directory, and the setting's -# value should be the filename minus the .ini extension. The default keybinding -# configuration is modeled heavily on the legacy VIT keybindings, and inspired -# by vi/vim. -#default_keybindings = vi - -# The theme to use. This allows control over the colors used in the -# application itself. Possible themes are in the 'theme' directory, and the -# setting's value should be the filename minus the .py extension. -# Note that the theme does not control any coloring related to tasks -- this -# is controlled via the color settings in the Taskwarrior configuration. -#theme = default - -# Boolean. If true, VIT will ask for confirmation before marking a task as done, -# deleting a task, or quitting VIT. Set to false to disable the prompts. -confirmation = False - - -# Boolean. If true, VIT will show the output of the task command and wait for -# enter. If false, VIT will not show output of the task command after -# modifications to a task are made. -wait = False - -# Boolean. If true, VIT will enable mouse support for actions such as selecting -# list items. -#mouse = False - -# Boolean. If true, hitting backspace against an empty prompt aborts the prompt. -#abort_backspace = False - -# Boolean. If true, VIT will focus on the newly added task. Note: the new task must be -#included in the active filter for this setting to have effect. -focus_on_add = True - -# Path to a directory to manage pid files for running instances of VIT. -# If no path is provided, no pid files will be managed. -# The special token $UID may be used, and will be substituted with the user ID -# of the user starting VIT. -# VIT can be run with the '--list-pids' argument, which will output a list of -# all pids in pid_dir; useful for sending signals to the running processes. -# If you use this feature, it's suggested to choose a directory that is -# automatically cleaned on boot, e.g.: -# /var/run/user/$UID/vit -# /tmp/vit_pids -#pid_dir = - -# Int. The number of flash repetitions focusing on the edit made -#flash_focus_repeat_times = 2 - -# Float. Waiting time for the blink focusing on the edit made -#flash_focus_pause_seconds = 0.1 - -[report] - -# The default Taskwarrior report to load when VIT first starts, if no report -# or filters are passed at the command line. -#default_report = next - -# The default Taskwarrior report to load when VIT first starts, if filters are -# passed at the command line with no report. -#default_filter_only_report = next - -# Boolean. If true, reports with the primary sort of project ascending will -# indent subprojects. If you use deeply nested subprojects, you'll probably -# like this setting. -#indent_subprojects = True - -# Boolean. If true, display report rows with alternating background colors. -#row_striping = True - - -[marker] - -# Boolean. Enables markers. Markers are configurable labels that appear on the -# left side of a report to indicate information about a task when the displayed -# report does not contain the related column. -# For example, let's suppose you have a 'notes' UDA configured. You'd like to -# see some indication that a task has a note, without displaying the full note -# column in reports. You could configure a marker for that custom UDA as -# follows: -# uda.notes.label = (N) -# Then, when a listed task has a note associated with it, you'll see the -# marker '(N)' displayed in the leftmost column of any report that displays the -# task in question. -#enabled = True - -# What columns to generate markers for. Can either be 'all' for all columns, or -# a comma separated list of columns to enable markers for. Possible columns -# are: -# depends,description,due,project,recur,scheduled,start,status,tags,until -#columns = all - -# The header label for the markers column when it is displayed. -#header_label = - -# Boolean. If true, an associated color value must be configured in the -# Taskwarrior configuration in order for the marker to be displayed. If false, -# and no Taskwarrior color configuration is present for the matching marker, -# then it is not displayed. -# For example, if this is set to True, then for the above-mentioned 'notes' -# marker to be displayed, a matching Taskwarrior color configuration for the -# 'notes' UDA must be present, e.g.: -# color.uda.notes=yellow -#require_color = True - -# Boolean. If true, subprojects of a project will also display the configured -# root project's marker, if the subproject itself does not have its own marker -# configured. -# For example, given the following projects: -# Foo -# Foo.Bar -# If this value is set to True, and the Foo project has a configured marker, -# then Foo.Bar would also display Foo's marker. -#include_subprojects = True - -# Below are listed all of the available markers, with their default label. -# To disable a specific marker, set its label to empty. Any section enclosed -# in brackets should be replaced by the appropriate identifier, eg. -# [project_name] with the actual name of a project. -#active.label = (A) -#blocked.label = (BD) -#blocking.label = (BG) -#completed.label = (C) -#deleted.label = (X) -#due.label = (D) -#due.today.label = (DT) -#keyword.label = (K) -#keyword.[keyword_name].label = -#overdue.label = (OD) -#project.label = (P) -#project.none.label = -#project.[project_name].label = -#recurring.label = (R) -#scheduled.label = (S) -#tag.label = (T) -#tag.none.label = -#tag.[tag_name].label = -#uda.label = -#uda.priority.label = (PR) -#uda.[uda_name].label = - - -[color] - -# Boolean. If true, use the colors in Taskwarrior's configuration to colorize -# reports. Note that VIT uses a fundamentally different paradigm for -# colorization, which combines tying coloring to associated report columns in -# combination with markers (see above). This setting works independently of -# Taskwarriors 'color' config setting. -#enabled = True - -# Boolean. If true, subprojects of a project will also display the configured -# root project's color, if the subproject itself does not have its own color -# configured. -# For example, given the following projects: -# Foo -# Foo.Bar -# If this value is set to True, and the Foo project has a configured color, -# then Foo.Bar would also display Foo's color. -#include_subprojects = True - -# For the Taskwarrior color configuration, there are three special values: -# color.project.none -# color.tag.none -# color.uda.[uda_name].none -# If any of these are configured for color, then the label below will be used -# in the related column to display the color configuration. -#none_label = [NONE] - - -[keybinding] - -# This section allows you to override the configured keybindings, associate -# additional keybindings with VIT actions, and set up macros triggered by a -# keybinding. - -# Meta keys are enclosed in angle brackets, variables are enclosed in curly -# brackets. Keybindings here can either be: -# - Associated with a single VIT action -# - A macro that describes a series of key presses to replay - -# For VIT actions, the form is: -# keys[,keys] = {ACTION_NAME} -# For example, to associate the keybinding 'zz' with the undo action: -# zz = {ACTION_TASK_UNDO} -# To only disable a keybinding, use the special noop action: -# w = {ACTION_NOOP} -# wa = {ACTION_TASK_WAIT} -# The above would disable the task wait action for the 'w' key, and instead -# assign it to the 'wa' keybinding. -# For capital letter keybindings, use the letter directly: -# D = {ACTION_TASK_DONE} - -# For a list of available actions, run 'vit --list-actions'. -# A great reference for many of the available meta keys, and understanding the -# default keybindings is the 'keybinding/vi.ini' file. - -# For macros, the form is: -# keys[,keys] = keypresses -# For example, to map the 'o' key to opening the OneNote script, passing it -# the currently focused task UUID: -# o = :!wr onenote {TASK_UUID} - -# The special '{TASK_[attribute]}' variable can be used in any macro, and it -# will be replaced with the value of the attribute for the currently -# highlighted task. Any attribute listed in 'task _columns' is supported, e.g. -# o = :!wr echo project is {TASK_PROJECT} - -# Multiple keybindings can be associated with the same action/macro, simply -# separate the keybindings with a comma: -# z,zz = {ACTION_TASK_UNDO} - -# 'Special' keys are indicated by enclosing them in brackets. VIT supports the -# following special keys on either side of the keybinding declaration, by -# internally translating them into the single character: -# -# -# -# -# -# -# Under the hood, VIT uses the Urwid mappings for keyboard input: -# http://urwid.org/manual/userinput.html -# -# Any modifier, navigation, or function keys can be described in the VIT -# keybinding configuration by wrapping them in angle brackets, matching the -# correct Urwid keyboard input structure: -# -# e = :!wr echo do something -# = :!wr echo you used a function key - +# This is the user configuration file for VIT. + +# All configuration options are listed here, commented out, and showing their +# default value when not otherwise set. + +# The format is standard INI file format. Configuration sections are enclosed +# by brackets. Configuration values should be placed in their relevant section, +# using a 'name = value' format. Boolean values can be expressed by the +# following: +# True values: 1, yes, true (case insensitive) +# False values: All other values. + + +[taskwarrior] + +# Full path to the Taskwarrior configuration file. Tilde will be expanded to +# the user's home directory. +# NOTE: This setting is overridden by the TASKRC environment variable. +#taskrc = ~/.taskrc + + +[vit] + +# The keybinding map to use. This maps actions registered with VIT to be fired +# when the user presses the specific keys configured in the keybindings file. +# Possible keybindings are in the 'keybinding' directory, and the setting's +# value should be the filename minus the .ini extension. The default keybinding +# configuration is modeled heavily on the legacy VIT keybindings, and inspired +# by vi/vim. +#default_keybindings = vi + +# The theme to use. This allows control over the colors used in the +# application itself. Possible themes are in the 'theme' directory, and the +# setting's value should be the filename minus the .py extension. +# Note that the theme does not control any coloring related to tasks -- this +# is controlled via the color settings in the Taskwarrior configuration. +#theme = default + +# Boolean. If true, VIT will ask for confirmation before marking a task as done, +# deleting a task, or quitting VIT. Set to false to disable the prompts. +confirmation = False + + +# Boolean. If true, VIT will show the output of the task command and wait for +# enter. If false, VIT will not show output of the task command after +# modifications to a task are made. +wait = False + +# Boolean. If true, VIT will enable mouse support for actions such as selecting +# list items. +#mouse = False + +# Boolean. If true, hitting backspace against an empty prompt aborts the prompt. +#abort_backspace = False + +# Boolean. If true, VIT will focus on the newly added task. Note: the new task must be +#included in the active filter for this setting to have effect. +focus_on_add = True + +# Path to a directory to manage pid files for running instances of VIT. +# If no path is provided, no pid files will be managed. +# The special token $UID may be used, and will be substituted with the user ID +# of the user starting VIT. +# VIT can be run with the '--list-pids' argument, which will output a list of +# all pids in pid_dir; useful for sending signals to the running processes. +# If you use this feature, it's suggested to choose a directory that is +# automatically cleaned on boot, e.g.: +# /var/run/user/$UID/vit +# /tmp/vit_pids +#pid_dir = + +# Int. The number of flash repetitions focusing on the edit made +#flash_focus_repeat_times = 2 + +# Float. Waiting time for the blink focusing on the edit made +#flash_focus_pause_seconds = 0.1 + +[report] + +# The default Taskwarrior report to load when VIT first starts, if no report +# or filters are passed at the command line. +#default_report = next + +# The default Taskwarrior report to load when VIT first starts, if filters are +# passed at the command line with no report. +#default_filter_only_report = next + +# Boolean. If true, reports with the primary sort of project ascending will +# indent subprojects. If you use deeply nested subprojects, you'll probably +# like this setting. +#indent_subprojects = True + +# Boolean. If true, display report rows with alternating background colors. +#row_striping = True + + +[marker] + +# Boolean. Enables markers. Markers are configurable labels that appear on the +# left side of a report to indicate information about a task when the displayed +# report does not contain the related column. +# For example, let's suppose you have a 'notes' UDA configured. You'd like to +# see some indication that a task has a note, without displaying the full note +# column in reports. You could configure a marker for that custom UDA as +# follows: +# uda.notes.label = (N) +# Then, when a listed task has a note associated with it, you'll see the +# marker '(N)' displayed in the leftmost column of any report that displays the +# task in question. +#enabled = True + +# What columns to generate markers for. Can either be 'all' for all columns, or +# a comma separated list of columns to enable markers for. Possible columns +# are: +# depends,description,due,project,recur,scheduled,start,status,tags,until +#columns = all + +# The header label for the markers column when it is displayed. +#header_label = + +# Boolean. If true, an associated color value must be configured in the +# Taskwarrior configuration in order for the marker to be displayed. If false, +# and no Taskwarrior color configuration is present for the matching marker, +# then it is not displayed. +# For example, if this is set to True, then for the above-mentioned 'notes' +# marker to be displayed, a matching Taskwarrior color configuration for the +# 'notes' UDA must be present, e.g.: +# color.uda.notes=yellow +#require_color = True + +# Boolean. If true, subprojects of a project will also display the configured +# root project's marker, if the subproject itself does not have its own marker +# configured. +# For example, given the following projects: +# Foo +# Foo.Bar +# If this value is set to True, and the Foo project has a configured marker, +# then Foo.Bar would also display Foo's marker. +#include_subprojects = True + +# Below are listed all of the available markers, with their default label. +# To disable a specific marker, set its label to empty. Any section enclosed +# in brackets should be replaced by the appropriate identifier, eg. +# [project_name] with the actual name of a project. +#active.label = (A) +#blocked.label = (BD) +#blocking.label = (BG) +#completed.label = (C) +#deleted.label = (X) +#due.label = (D) +#due.today.label = (DT) +#keyword.label = (K) +#keyword.[keyword_name].label = +#overdue.label = (OD) +#project.label = (P) +#project.none.label = +#project.[project_name].label = +#recurring.label = (R) +#scheduled.label = (S) +#tag.label = (T) +#tag.none.label = +#tag.[tag_name].label = +#uda.label = +#uda.priority.label = (PR) +#uda.[uda_name].label = + + +[color] + +# Boolean. If true, use the colors in Taskwarrior's configuration to colorize +# reports. Note that VIT uses a fundamentally different paradigm for +# colorization, which combines tying coloring to associated report columns in +# combination with markers (see above). This setting works independently of +# Taskwarriors 'color' config setting. +#enabled = True + +# Boolean. If true, subprojects of a project will also display the configured +# root project's color, if the subproject itself does not have its own color +# configured. +# For example, given the following projects: +# Foo +# Foo.Bar +# If this value is set to True, and the Foo project has a configured color, +# then Foo.Bar would also display Foo's color. +#include_subprojects = True + +# For the Taskwarrior color configuration, there are three special values: +# color.project.none +# color.tag.none +# color.uda.[uda_name].none +# If any of these are configured for color, then the label below will be used +# in the related column to display the color configuration. +#none_label = [NONE] + + +[keybinding] + +# This section allows you to override the configured keybindings, associate +# additional keybindings with VIT actions, and set up macros triggered by a +# keybinding. + +# Meta keys are enclosed in angle brackets, variables are enclosed in curly +# brackets. Keybindings here can either be: +# - Associated with a single VIT action +# - A macro that describes a series of key presses to replay + +# For VIT actions, the form is: +# keys[,keys] = {ACTION_NAME} +# For example, to associate the keybinding 'zz' with the undo action: +# zz = {ACTION_TASK_UNDO} +# To only disable a keybinding, use the special noop action: +# w = {ACTION_NOOP} +# wa = {ACTION_TASK_WAIT} +# The above would disable the task wait action for the 'w' key, and instead +# assign it to the 'wa' keybinding. +# For capital letter keybindings, use the letter directly: +# D = {ACTION_TASK_DONE} + +# For a list of available actions, run 'vit --list-actions'. +# A great reference for many of the available meta keys, and understanding the +# default keybindings is the 'keybinding/vi.ini' file. + +# For macros, the form is: +# keys[,keys] = keypresses +# For example, to map the 'o' key to opening the OneNote script, passing it +# the currently focused task UUID: +# o = :!wr onenote {TASK_UUID} + +# The special '{TASK_[attribute]}' variable can be used in any macro, and it +# will be replaced with the value of the attribute for the currently +# highlighted task. Any attribute listed in 'task _columns' is supported, e.g. +# o = :!wr echo project is {TASK_PROJECT} + +# Multiple keybindings can be associated with the same action/macro, simply +# separate the keybindings with a comma: +# z,zz = {ACTION_TASK_UNDO} + +# 'Special' keys are indicated by enclosing them in brackets. VIT supports the +# following special keys on either side of the keybinding declaration, by +# internally translating them into the single character: +# +# +# +# +# +# +# Under the hood, VIT uses the Urwid mappings for keyboard input: +# http://urwid.org/manual/userinput.html +# +# Any modifier, navigation, or function keys can be described in the VIT +# keybinding configuration by wrapping them in angle brackets, matching the +# correct Urwid keyboard input structure: +# +# e = :!wr echo do something +# = :!wr echo you used a function key + diff --git a/zsh/zprofile b/zsh/zprofile index 7fed3a7..3288e8d 100644 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -1,65 +1,65 @@ -# vim: filetype=zsh - -if [[ ! -d "${HISTFILE:h}" ]]; then - mkdir -p "${HISTFILE:h}" -fi - -add_path() { - if [[ -d "$1" ]]; then - path=("$1" $path) - fi -} - -set_include_lib_path() { - # Fix für include/lib Verzeichnisse - # Details: https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html - export C_INCLUDE_PATH="$1/include:$C_INCLUDE_PATH" - export CPLUS_INCLUDE_PATH="$1/include:$CPLUS_INCLUDE_PATH" - export LIBRARY_PATH="$1/lib:$LIBRARY_PATH" -} - -add_path "$HOME/.cargo/bin" -add_path "$HOME/.local/bin" - -case "$OSTYPE" in - darwin*) - add_path "/opt/homebrew/bin" - - set_include_lib_path "/opt/homebrew" - ;; - freebsd*) - texlive_prefix="$HOME/.local/texlive" - - if [[ -d "$texlive_prefix/bin/amd64-freebsd" ]]; then - add_path "$texlive_prefix/bin/amd64-freebsd" - - export MANPATH="${MANPATH:-$(manpath)}:$texlive_prefix/texmf-dist/man" - export INFOPATH="${INFOPATH:+$INFOPATH:}$texlive_prefix/texmf-dist/info" - fi - - set_include_lib_path "/usr/local" - ;; -esac - -# Fix Midnight Commander ESC Taste -# zusätzlich noch unter "F9 -> Optionen -> Konfiguration -> Escape Tastenmodus -> [x] Einzelner Tastendruck" aktivieren -export KEYBOARD_KEY_TIMEOUT_US=1000 - -# Tmuxp -# https://tmuxp.git-pull.com/configuration/environmental-variables.html -export TMUXP_CONFIGDIR="$XDG_CONFIG_HOME/tmuxp" - -# Vit (Taskwarrior UI) -# https://github.com/vit-project/vit/blob/2.x/CUSTOMIZE.md -export VIT_DIR="$XDG_CONFIG_HOME/vit" - -# Maildir für mu (mail-utils) -export MAILDIR="$HOME/Mail" - -# mpd starten -if [[ -x /usr/local/bin/musicpd ]] && ! pgrep "musicpd" > /dev/null; then - /usr/local/bin/musicpd -fi - -unfunction add_path -unfunction set_include_lib_path +# vim: filetype=zsh + +if [[ ! -d "${HISTFILE:h}" ]]; then + mkdir -p "${HISTFILE:h}" +fi + +add_path() { + if [[ -d "$1" ]]; then + path=("$1" $path) + fi +} + +set_include_lib_path() { + # Fix für include/lib Verzeichnisse + # Details: https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html + export C_INCLUDE_PATH="$1/include:$C_INCLUDE_PATH" + export CPLUS_INCLUDE_PATH="$1/include:$CPLUS_INCLUDE_PATH" + export LIBRARY_PATH="$1/lib:$LIBRARY_PATH" +} + +add_path "$HOME/.cargo/bin" +add_path "$HOME/.local/bin" + +case "$OSTYPE" in + darwin*) + add_path "/opt/homebrew/bin" + + set_include_lib_path "/opt/homebrew" + ;; + freebsd*) + texlive_prefix="$HOME/.local/texlive" + + if [[ -d "$texlive_prefix/bin/amd64-freebsd" ]]; then + add_path "$texlive_prefix/bin/amd64-freebsd" + + export MANPATH="${MANPATH:-$(manpath)}:$texlive_prefix/texmf-dist/man" + export INFOPATH="${INFOPATH:+$INFOPATH:}$texlive_prefix/texmf-dist/info" + fi + + set_include_lib_path "/usr/local" + ;; +esac + +# Fix Midnight Commander ESC Taste +# zusätzlich noch unter "F9 -> Optionen -> Konfiguration -> Escape Tastenmodus -> [x] Einzelner Tastendruck" aktivieren +export KEYBOARD_KEY_TIMEOUT_US=1000 + +# Tmuxp +# https://tmuxp.git-pull.com/configuration/environmental-variables.html +export TMUXP_CONFIGDIR="$XDG_CONFIG_HOME/tmuxp" + +# Vit (Taskwarrior UI) +# https://github.com/vit-project/vit/blob/2.x/CUSTOMIZE.md +export VIT_DIR="$XDG_CONFIG_HOME/vit" + +# Maildir für mu (mail-utils) +export MAILDIR="$HOME/Mail" + +# mpd starten +if [[ -x /usr/local/bin/musicpd ]] && ! pgrep "musicpd" > /dev/null; then + /usr/local/bin/musicpd +fi + +unfunction add_path +unfunction set_include_lib_path diff --git a/zsh/zshenv b/zsh/zshenv index 9ddbb8c..bddab8b 100644 --- a/zsh/zshenv +++ b/zsh/zshenv @@ -1,13 +1,13 @@ -# vim: filetype=zsh - -export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" -export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" -export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" - -export EDITOR="nvim" -export VISUAL="nvim" - -export HISTSIZE=10000 -export SAVEHIST=10000 -export HISTFILE="$XDG_DATA_HOME/zsh/history" - +# vim: filetype=zsh + +export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" +export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" +export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" + +export EDITOR="nvim" +export VISUAL="nvim" + +export HISTSIZE=10000 +export SAVEHIST=10000 +export HISTFILE="$XDG_DATA_HOME/zsh/history" + diff --git a/zsh/zshrc b/zsh/zshrc index 6f31eaa..b636dcd 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,126 +1,126 @@ -# vim: filetype=zsh - -# Hooks -chpwd() { - if [[ -n "$VIRTUAL_ENV" && -f "$VIRTUAL_ENV/bin/activate" ]]; then - local venv_dir="${VIRTUAL_ENV:h}" - if [[ "$PWD" != "$venv_dir"* ]] && (( $+functions[deactivate] )); then - deactivate - fi - fi - - for v in .venv venv .env; do - if [[ -f "$v/bin/activate" ]]; then - . "$v/bin/activate" - break - fi - done -} - -# Funktionen -source_if_exists() { - if [[ -r "$1" ]]; then - . "$1" - fi -} - -# Optionen -setopt AUTO_PARAM_SLASH -unsetopt CASE_GLOB -setopt HIST_SAVE_NO_DUPS -setopt INC_APPEND_HISTORY -setopt SHARE_HISTORY -setopt HIST_IGNORE_ALL_DUPS -setopt HIST_IGNORE_SPACE - -source_if_exists "$HOME/.opam/opam-init/init.zsh" - -case "$OSTYPE" in - darwin*) - source_if_exists "/opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" - source_if_exists "/opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh" - ;; - freebsd*) - source_if_exists "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" - source_if_exists "/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" - ;; -esac - -if (( ${+ZSH_HIGHLIGHT_STYLES} )); then - ZSH_HIGHLIGHT_STYLES[path]='none' - ZSH_HIGHLIGHT_STYLES[path_prefix]='none' -fi - -bindkey -v -export KEYTIMEOUT=1 - -# Keybindings -zmodload zsh/complist -bindkey -M menuselect 'h' vi-backward-char -bindkey -M menuselect 'k' vi-up-line-or-history -bindkey -M menuselect 'l' vi-forward-char -bindkey -M menuselect 'j' vi-down-line-or-history - -autoload -Uz surround -zle -N delete-surround surround -zle -N add-surround surround -zle -N change-surround surround -bindkey -M vicmd cs change-surround -bindkey -M vicmd ds delete-surround -bindkey -M vicmd ys add-surround -bindkey -M visual S add-surround - -bindkey '^A' vi-beginning-of-line -bindkey '^E' vi-end-of-line - -# Aliase -alias mc='mc -u' -alias gdb='gdb -q' -alias pwgen='pwgen -s 48 1' -alias ls='ls -G' - -# Funktionen -nvim-update() { - nvim --headless \ - -c "lua require[[lazy]].sync({ wait = true })" \ - -c "UpdateParsers" \ - -c "qa" -} - -# Command completion -autoload -U compinit -compinit -_comp_options+=(globdots) # With hidden files - -# ... Angular CLI -if (( $+commands[ng] )); then - . <(ng completion script) -fi - -zstyle ':completion:*' completer _extensions _complete _approximate - -zstyle ':completion:*' menu select - -zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f' -zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f' -zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f' -zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f' -zstyle ':completion:*' group-name '' - -# Prompt -autoload -Uz vcs_info -precmd_vcs_info() { vcs_info } -precmd_functions+=( precmd_vcs_info ) -setopt prompt_subst - -RPROMPT=\$vcs_info_msg_0_ -PROMPT=$'[%F{green}%8>..>%n%>>%F{white}@%F{green}%8>..>%m%>>%F{white}] %F{white}%(4~|.../%3~|%~) %B%F{blue}>%f%b ' - -zstyle ':vcs_info:*' unstagedstr ' *' -zstyle ':vcs_info:*' stagedstr ' +' -zstyle ':vcs_info:*' check-for-changes true -zstyle ':vcs_info:*' actionformats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%a%u%c%F{3}|%F{1}%a%F{5}]%f' -zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%u%c%F{5}]%f' -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' - -unfunction source_if_exists +# vim: filetype=zsh + +# Hooks +chpwd() { + if [[ -n "$VIRTUAL_ENV" && -f "$VIRTUAL_ENV/bin/activate" ]]; then + local venv_dir="${VIRTUAL_ENV:h}" + if [[ "$PWD" != "$venv_dir"* ]] && (( $+functions[deactivate] )); then + deactivate + fi + fi + + for v in .venv venv .env; do + if [[ -f "$v/bin/activate" ]]; then + . "$v/bin/activate" + break + fi + done +} + +# Funktionen +source_if_exists() { + if [[ -r "$1" ]]; then + . "$1" + fi +} + +# Optionen +setopt AUTO_PARAM_SLASH +unsetopt CASE_GLOB +setopt HIST_SAVE_NO_DUPS +setopt INC_APPEND_HISTORY +setopt SHARE_HISTORY +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_IGNORE_SPACE + +source_if_exists "$HOME/.opam/opam-init/init.zsh" + +case "$OSTYPE" in + darwin*) + source_if_exists "/opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" + source_if_exists "/opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh" + ;; + freebsd*) + source_if_exists "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" + source_if_exists "/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" + ;; +esac + +if (( ${+ZSH_HIGHLIGHT_STYLES} )); then + ZSH_HIGHLIGHT_STYLES[path]='none' + ZSH_HIGHLIGHT_STYLES[path_prefix]='none' +fi + +bindkey -v +export KEYTIMEOUT=1 + +# Keybindings +zmodload zsh/complist +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -M menuselect 'j' vi-down-line-or-history + +autoload -Uz surround +zle -N delete-surround surround +zle -N add-surround surround +zle -N change-surround surround +bindkey -M vicmd cs change-surround +bindkey -M vicmd ds delete-surround +bindkey -M vicmd ys add-surround +bindkey -M visual S add-surround + +bindkey '^A' vi-beginning-of-line +bindkey '^E' vi-end-of-line + +# Aliase +alias mc='mc -u' +alias gdb='gdb -q' +alias pwgen='pwgen -s 48 1' +alias ls='ls -G' + +# Funktionen +nvim-update() { + nvim --headless \ + -c "lua require[[lazy]].sync({ wait = true })" \ + -c "UpdateParsers" \ + -c "qa" +} + +# Command completion +autoload -U compinit +compinit +_comp_options+=(globdots) # With hidden files + +# ... Angular CLI +if (( $+commands[ng] )); then + . <(ng completion script) +fi + +zstyle ':completion:*' completer _extensions _complete _approximate + +zstyle ':completion:*' menu select + +zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f' +zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f' +zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f' +zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f' +zstyle ':completion:*' group-name '' + +# Prompt +autoload -Uz vcs_info +precmd_vcs_info() { vcs_info } +precmd_functions+=( precmd_vcs_info ) +setopt prompt_subst + +RPROMPT=\$vcs_info_msg_0_ +PROMPT=$'[%F{green}%8>..>%n%>>%F{white}@%F{green}%8>..>%m%>>%F{white}] %F{white}%(4~|.../%3~|%~) %B%F{blue}>%f%b ' + +zstyle ':vcs_info:*' unstagedstr ' *' +zstyle ':vcs_info:*' stagedstr ' +' +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' actionformats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%a%u%c%F{3}|%F{1}%a%F{5}]%f' +zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%u%c%F{5}]%f' +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' + +unfunction source_if_exists -- cgit v1.3