diff options
| -rwxr-xr-x | bootstrap/neovim.sh | 12 | ||||
| -rw-r--r-- | nvim/lua/config/statusline.lua | 11 |
2 files changed, 22 insertions, 1 deletions
diff --git a/bootstrap/neovim.sh b/bootstrap/neovim.sh index 6ffefaf..94bf82b 100755 --- a/bootstrap/neovim.sh +++ b/bootstrap/neovim.sh | |||
| @@ -141,6 +141,17 @@ install_lsp() { | |||
| 141 | install_npm vtsls @vtsls/language-server | 141 | install_npm vtsls @vtsls/language-server |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | install_analysis() { | ||
| 145 | # sonar-scanner wird direkt von nvim/lua/config/usercmds.lua (:SonarScan) | ||
| 146 | # und nvim/scripts/sonarqube.sh (:SonarIssues) genutzt. Nur beruflich | ||
| 147 | # unter macOS im Einsatz, deshalb kein FreeBSD-Zweig. | ||
| 148 | case "$OS" in | ||
| 149 | Darwin) | ||
| 150 | install_pkg sonar-scanner sonar-scanner | ||
| 151 | ;; | ||
| 152 | esac | ||
| 153 | } | ||
| 154 | |||
| 144 | main() { | 155 | main() { |
| 145 | check_prerequisites | 156 | check_prerequisites |
| 146 | setup_homebrew_env | 157 | setup_homebrew_env |
| @@ -149,6 +160,7 @@ main() { | |||
| 149 | install_formatters | 160 | install_formatters |
| 150 | install_tools | 161 | install_tools |
| 151 | install_lsp | 162 | install_lsp |
| 163 | install_analysis | ||
| 152 | 164 | ||
| 153 | printf "\nBootstrap abgeschlossen.\n" | 165 | printf "\nBootstrap abgeschlossen.\n" |
| 154 | } | 166 | } |
diff --git a/nvim/lua/config/statusline.lua b/nvim/lua/config/statusline.lua index 0ec6579..8a9c75a 100644 --- a/nvim/lua/config/statusline.lua +++ b/nvim/lua/config/statusline.lua | |||
| @@ -20,6 +20,10 @@ end | |||
| 20 | -- Git branch (buffer-lokal, gecached, kein redraw-spam) | 20 | -- Git branch (buffer-lokal, gecached, kein redraw-spam) |
| 21 | ---------------------------------------------------------------------- | 21 | ---------------------------------------------------------------------- |
| 22 | 22 | ||
| 23 | -- /dev/null gibt es unter Windows nicht (cmd.exe versteht das nicht als | ||
| 24 | -- Pfad und meldet "Das System kann den angegebenen Pfad nicht finden"). | ||
| 25 | local devnull = vim.fn.has("win32") == 1 and "NUL" or "/dev/null" | ||
| 26 | |||
| 23 | local function update_git_branch(bufnr) | 27 | local function update_git_branch(bufnr) |
| 24 | bufnr = bufnr or 0 | 28 | bufnr = bufnr or 0 |
| 25 | 29 | ||
| @@ -35,7 +39,12 @@ local function update_git_branch(bufnr) | |||
| 35 | return | 39 | return |
| 36 | end | 40 | end |
| 37 | 41 | ||
| 38 | local branch = vim.fn.systemlist("git rev-parse --abbrev-ref HEAD 2>/dev/null")[1] | 42 | local branch = vim.fn.systemlist("git rev-parse --abbrev-ref HEAD 2>" .. devnull)[1] |
| 43 | if branch then | ||
| 44 | -- unter Windows bleibt an systemlist()-Zeilen mitunter ein | ||
| 45 | -- trailing \r haengen (^M in der Statuszeile sichtbar) | ||
| 46 | branch = branch:gsub("\r$", "") | ||
| 47 | end | ||
| 39 | 48 | ||
| 40 | if branch and branch ~= "" then | 49 | if branch and branch ~= "" then |
| 41 | vim.b[bufnr].git_branch = " " .. branch .. " " | 50 | vim.b[bufnr].git_branch = " " .. branch .. " " |
