diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-08-12 09:22:12 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-08-12 09:22:12 +0200 |
| commit | 189d244d36d4ebb2189b698adb21f51cf1c4176a (patch) | |
| tree | 3a6a9847dafabea051997b1a9cbc124a242ec1d3 /nvim/lua/config | |
| parent | 6e5882a2fd02d30206ab9ca8aa5847b8ea09196c (diff) | |
| download | dotfiles-189d244d36d4ebb2189b698adb21f51cf1c4176a.tar.gz dotfiles-189d244d36d4ebb2189b698adb21f51cf1c4176a.tar.bz2 dotfiles-189d244d36d4ebb2189b698adb21f51cf1c4176a.zip | |
Revert "Normalize line endings"
This reverts commit 6e5882a2fd02d30206ab9ca8aa5847b8ea09196c.
Diffstat (limited to 'nvim/lua/config')
| -rw-r--r-- | nvim/lua/config/autocmds.lua | 86 | ||||
| -rw-r--r-- | nvim/lua/config/colorscheme.lua | 34 | ||||
| -rw-r--r-- | nvim/lua/config/lazy.lua | 64 | ||||
| -rw-r--r-- | nvim/lua/config/statusline.lua | 364 | ||||
| -rw-r--r-- | nvim/lua/config/treesitter.lua | 56 |
5 files changed, 302 insertions, 302 deletions
diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua index 58adafb..53bf7a9 100644 --- a/nvim/lua/config/autocmds.lua +++ b/nvim/lua/config/autocmds.lua | |||
| @@ -1,43 +1,43 @@ | |||
| 1 | -- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/doc/nvim-treesitter.txt | 1 | -- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/doc/nvim-treesitter.txt |
| 2 | local treesitter_languages = require("config.treesitter").languages | 2 | local treesitter_languages = require("config.treesitter").languages |
| 3 | 3 | ||
| 4 | local function enable_treesitter_features() | 4 | local function enable_treesitter_features() |
| 5 | if not pcall(vim.treesitter.start) then return end | 5 | if not pcall(vim.treesitter.start) then return end |
| 6 | 6 | ||
| 7 | vim.wo.foldmethod = "expr" | 7 | vim.wo.foldmethod = "expr" |
| 8 | vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" | 8 | vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" |
| 9 | vim.bo.indentexpr = "v:lua.require('nvim-treesitter').indentexpr()" | 9 | vim.bo.indentexpr = "v:lua.require('nvim-treesitter').indentexpr()" |
| 10 | end | 10 | end |
| 11 | 11 | ||
| 12 | vim.api.nvim_create_autocmd("FileType", { | 12 | vim.api.nvim_create_autocmd("FileType", { |
| 13 | pattern = treesitter_languages, | 13 | pattern = treesitter_languages, |
| 14 | callback = enable_treesitter_features, | 14 | callback = enable_treesitter_features, |
| 15 | }) | 15 | }) |
| 16 | 16 | ||
| 17 | -- https://github.com/nvim-tree/nvim-tree.lua/wiki/Auto-Close | 17 | -- https://github.com/nvim-tree/nvim-tree.lua/wiki/Auto-Close |
| 18 | vim.api.nvim_create_autocmd("QuitPre", { | 18 | vim.api.nvim_create_autocmd("QuitPre", { |
| 19 | callback = function() | 19 | callback = function() |
| 20 | local invalid_win = {} | 20 | local invalid_win = {} |
| 21 | local wins = vim.api.nvim_list_wins() | 21 | local wins = vim.api.nvim_list_wins() |
| 22 | 22 | ||
| 23 | for _, w in ipairs(wins) do | 23 | for _, w in ipairs(wins) do |
| 24 | local bufname = vim.api.nvim_buf_get_name(vim.api.nvim_win_get_buf(w)) | 24 | local bufname = vim.api.nvim_buf_get_name(vim.api.nvim_win_get_buf(w)) |
| 25 | if bufname:match("NvimTree_") ~= nil then table.insert(invalid_win, w) end | 25 | if bufname:match("NvimTree_") ~= nil then table.insert(invalid_win, w) end |
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | if #invalid_win == #wins - 1 then | 28 | if #invalid_win == #wins - 1 then |
| 29 | -- Should quit, so we close all invalid windows. | 29 | -- Should quit, so we close all invalid windows. |
| 30 | for _, w in ipairs(invalid_win) do | 30 | for _, w in ipairs(invalid_win) do |
| 31 | vim.api.nvim_win_close(w, true) | 31 | vim.api.nvim_win_close(w, true) |
| 32 | end | 32 | end |
| 33 | end | 33 | end |
| 34 | end, | 34 | end, |
| 35 | }) | 35 | }) |
| 36 | 36 | ||
| 37 | vim.api.nvim_create_autocmd("LspAttach", { | 37 | vim.api.nvim_create_autocmd("LspAttach", { |
| 38 | callback = function(event) | 38 | callback = function(event) |
| 39 | local client = vim.lsp.get_client_by_id(event.data.client_id) | 39 | local client = vim.lsp.get_client_by_id(event.data.client_id) |
| 40 | local keymaps = require("config.keymaps") | 40 | local keymaps = require("config.keymaps") |
| 41 | keymaps.lsp(event.buf, client) | 41 | keymaps.lsp(event.buf, client) |
| 42 | end, | 42 | end, |
| 43 | }) | 43 | }) |
diff --git a/nvim/lua/config/colorscheme.lua b/nvim/lua/config/colorscheme.lua index dfc8d24..8d944c3 100644 --- a/nvim/lua/config/colorscheme.lua +++ b/nvim/lua/config/colorscheme.lua | |||
| @@ -1,17 +1,17 @@ | |||
| 1 | -- Fix: Farbschema für Rechtschreibfehler | 1 | -- Fix: Farbschema für Rechtschreibfehler |
| 2 | vim.api.nvim_set_hl(0, "SpellBad", { fg = "#ffffff", bg = "#5f0000" }) | 2 | vim.api.nvim_set_hl(0, "SpellBad", { fg = "#ffffff", bg = "#5f0000" }) |
| 3 | vim.api.nvim_set_hl(0, "SpellCap", { fg = "#000000", bg = "#ffaf00" }) | 3 | vim.api.nvim_set_hl(0, "SpellCap", { fg = "#000000", bg = "#ffaf00" }) |
| 4 | vim.api.nvim_set_hl(0, "SpellRare", { fg = "#000000", bg = "#5fd7ff" }) | 4 | vim.api.nvim_set_hl(0, "SpellRare", { fg = "#000000", bg = "#5fd7ff" }) |
| 5 | vim.api.nvim_set_hl(0, "SpellLocal", { fg = "#000000", bg = "#5fff87" }) | 5 | vim.api.nvim_set_hl(0, "SpellLocal", { fg = "#000000", bg = "#5fff87" }) |
| 6 | vim.api.nvim_set_hl(0, "CursorLine", { bg = "#252526" }) | 6 | vim.api.nvim_set_hl(0, "CursorLine", { bg = "#252526" }) |
| 7 | 7 | ||
| 8 | -- Statusline Farben | 8 | -- Statusline Farben |
| 9 | vim.api.nvim_set_hl(0, "StatuslineModeNormal", { fg = "#1e222a", bg = "#61afef", bold = true }) | 9 | vim.api.nvim_set_hl(0, "StatuslineModeNormal", { fg = "#1e222a", bg = "#61afef", bold = true }) |
| 10 | vim.api.nvim_set_hl(0, "StatuslineModeInsert", { fg = "#1e222a", bg = "#98c379", bold = true }) | 10 | vim.api.nvim_set_hl(0, "StatuslineModeInsert", { fg = "#1e222a", bg = "#98c379", bold = true }) |
| 11 | vim.api.nvim_set_hl(0, "StatuslineModeVisual", { fg = "#1e222a", bg = "#c678dd", bold = true }) | 11 | vim.api.nvim_set_hl(0, "StatuslineModeVisual", { fg = "#1e222a", bg = "#c678dd", bold = true }) |
| 12 | vim.api.nvim_set_hl(0, "StatuslineModeReplace", { fg = "#1e222a", bg = "#e86671", bold = true }) | 12 | vim.api.nvim_set_hl(0, "StatuslineModeReplace", { fg = "#1e222a", bg = "#e86671", bold = true }) |
| 13 | vim.api.nvim_set_hl(0, "StatuslineModeCommand", { fg = "#1e222a", bg = "#e5c07b", bold = true }) | 13 | vim.api.nvim_set_hl(0, "StatuslineModeCommand", { fg = "#1e222a", bg = "#e5c07b", bold = true }) |
| 14 | 14 | ||
| 15 | -- NVim-Tree | 15 | -- NVim-Tree |
| 16 | vim.api.nvim_set_hl(0, "NvimTreeOpenedFile", { bold = true }) | 16 | vim.api.nvim_set_hl(0, "NvimTreeOpenedFile", { bold = true }) |
| 17 | vim.api.nvim_set_hl(0, "NvimTreeCursorLine", { bg = "#2A2D2E" }) | 17 | vim.api.nvim_set_hl(0, "NvimTreeCursorLine", { bg = "#2A2D2E" }) |
diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index 972e777..76f59cb 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua | |||
| @@ -1,32 +1,32 @@ | |||
| 1 | -- https://lazy.folke.io/installation | 1 | -- https://lazy.folke.io/installation |
| 2 | 2 | ||
| 3 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | 3 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" |
| 4 | if not vim.uv.fs_stat(lazypath) then | 4 | if not vim.uv.fs_stat(lazypath) then |
| 5 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" | 5 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" |
| 6 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) | 6 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) |
| 7 | if vim.v.shell_error ~= 0 then | 7 | if vim.v.shell_error ~= 0 then |
| 8 | vim.api.nvim_echo({ | 8 | vim.api.nvim_echo({ |
| 9 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, | 9 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, |
| 10 | { out, "WarningMsg" }, | 10 | { out, "WarningMsg" }, |
| 11 | { "\nPress any key to exit..." }, | 11 | { "\nPress any key to exit..." }, |
| 12 | }, true, {}) | 12 | }, true, {}) |
| 13 | vim.fn.getchar() | 13 | vim.fn.getchar() |
| 14 | os.exit(1) | 14 | os.exit(1) |
| 15 | end | 15 | end |
| 16 | end | 16 | end |
| 17 | vim.opt.rtp:prepend(lazypath) | 17 | vim.opt.rtp:prepend(lazypath) |
| 18 | 18 | ||
| 19 | require("lazy").setup({ | 19 | require("lazy").setup({ |
| 20 | spec = { | 20 | spec = { |
| 21 | { import = "plugins" }, | 21 | { import = "plugins" }, |
| 22 | }, | 22 | }, |
| 23 | checker = { | 23 | checker = { |
| 24 | enabled = true, | 24 | enabled = true, |
| 25 | notify = false, | 25 | notify = false, |
| 26 | frequency = 86400, -- Sekunden (1 Tag) | 26 | frequency = 86400, -- Sekunden (1 Tag) |
| 27 | log = true, | 27 | log = true, |
| 28 | }, | 28 | }, |
| 29 | rocks = { | 29 | rocks = { |
| 30 | enabled = false, | 30 | enabled = false, |
| 31 | }, | 31 | }, |
| 32 | }) | 32 | }) |
diff --git a/nvim/lua/config/statusline.lua b/nvim/lua/config/statusline.lua index 3a6f1c7..8a9c75a 100644 --- a/nvim/lua/config/statusline.lua +++ b/nvim/lua/config/statusline.lua | |||
| @@ -1,182 +1,182 @@ | |||
| 1 | local M = {} | 1 | local M = {} |
| 2 | 2 | ||
| 3 | local modes = { | 3 | local modes = { |
| 4 | n = { "NORMAL", "StatuslineModeNormal" }, | 4 | n = { "NORMAL", "StatuslineModeNormal" }, |
| 5 | i = { "INSERT", "StatuslineModeInsert" }, | 5 | i = { "INSERT", "StatuslineModeInsert" }, |
| 6 | v = { "VISUAL", "StatuslineModeVisual" }, | 6 | v = { "VISUAL", "StatuslineModeVisual" }, |
| 7 | V = { "V-LINE", "StatuslineModeVisual" }, | 7 | V = { "V-LINE", "StatuslineModeVisual" }, |
| 8 | [""] = { "V-BLOCK", "StatuslineModeVisual" }, | 8 | [""] = { "V-BLOCK", "StatuslineModeVisual" }, |
| 9 | R = { "REPLACE", "StatuslineModeReplace" }, | 9 | R = { "REPLACE", "StatuslineModeReplace" }, |
| 10 | c = { "COMMAND", "StatuslineModeCommand" }, | 10 | c = { "COMMAND", "StatuslineModeCommand" }, |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | local function mode() | 13 | local function mode() |
| 14 | local m = vim.fn.mode() | 14 | local m = vim.fn.mode() |
| 15 | local entry = modes[m] or { m, "StatusLine" } | 15 | local entry = modes[m] or { m, "StatusLine" } |
| 16 | return string.format("%%#%s# %s %%#StatusLine#", entry[2], entry[1]) | 16 | return string.format("%%#%s# %s %%#StatusLine#", entry[2], entry[1]) |
| 17 | end | 17 | end |
| 18 | 18 | ||
| 19 | ---------------------------------------------------------------------- | 19 | ---------------------------------------------------------------------- |
| 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 | 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"). | 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" | 25 | local devnull = vim.fn.has("win32") == 1 and "NUL" or "/dev/null" |
| 26 | 26 | ||
| 27 | local function update_git_branch(bufnr) | 27 | local function update_git_branch(bufnr) |
| 28 | bufnr = bufnr or 0 | 28 | bufnr = bufnr or 0 |
| 29 | 29 | ||
| 30 | -- nur in echten Dateien | 30 | -- nur in echten Dateien |
| 31 | if vim.bo[bufnr].buftype ~= "" then | 31 | if vim.bo[bufnr].buftype ~= "" then |
| 32 | vim.b[bufnr].git_branch = "" | 32 | vim.b[bufnr].git_branch = "" |
| 33 | return | 33 | return |
| 34 | end | 34 | end |
| 35 | 35 | ||
| 36 | -- kein Git → nichts tun | 36 | -- kein Git → nichts tun |
| 37 | if vim.fn.executable("git") ~= 1 then | 37 | if vim.fn.executable("git") ~= 1 then |
| 38 | vim.b[bufnr].git_branch = "" | 38 | vim.b[bufnr].git_branch = "" |
| 39 | return | 39 | return |
| 40 | end | 40 | end |
| 41 | 41 | ||
| 42 | local branch = vim.fn.systemlist("git rev-parse --abbrev-ref HEAD 2>" .. devnull)[1] | 42 | local branch = vim.fn.systemlist("git rev-parse --abbrev-ref HEAD 2>" .. devnull)[1] |
| 43 | if branch then | 43 | if branch then |
| 44 | -- unter Windows bleibt an systemlist()-Zeilen mitunter ein | 44 | -- unter Windows bleibt an systemlist()-Zeilen mitunter ein |
| 45 | -- trailing \r haengen (^M in der Statuszeile sichtbar) | 45 | -- trailing \r haengen (^M in der Statuszeile sichtbar) |
| 46 | branch = branch:gsub("\r$", "") | 46 | branch = branch:gsub("\r$", "") |
| 47 | end | 47 | end |
| 48 | 48 | ||
| 49 | if branch and branch ~= "" then | 49 | if branch and branch ~= "" then |
| 50 | vim.b[bufnr].git_branch = " " .. branch .. " " | 50 | vim.b[bufnr].git_branch = " " .. branch .. " " |
| 51 | else | 51 | else |
| 52 | vim.b[bufnr].git_branch = "" | 52 | vim.b[bufnr].git_branch = "" |
| 53 | end | 53 | end |
| 54 | end | 54 | end |
| 55 | 55 | ||
| 56 | ---------------------------------------------------------------------- | 56 | ---------------------------------------------------------------------- |
| 57 | -- Autocmd: Git nur bei Bedarf aktualisieren | 57 | -- Autocmd: Git nur bei Bedarf aktualisieren |
| 58 | ---------------------------------------------------------------------- | 58 | ---------------------------------------------------------------------- |
| 59 | 59 | ||
| 60 | vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained" }, { | 60 | vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained" }, { |
| 61 | callback = function(args) | 61 | callback = function(args) |
| 62 | update_git_branch(args.buf) | 62 | update_git_branch(args.buf) |
| 63 | end, | 63 | end, |
| 64 | }) | 64 | }) |
| 65 | 65 | ||
| 66 | ---------------------------------------------------------------------- | 66 | ---------------------------------------------------------------------- |
| 67 | -- Statusline-Sektionen (reine Darstellung, keine IO) | 67 | -- Statusline-Sektionen (reine Darstellung, keine IO) |
| 68 | ---------------------------------------------------------------------- | 68 | ---------------------------------------------------------------------- |
| 69 | 69 | ||
| 70 | -- Git-Branch (buffer-lokal, gecached, kein redraw-spam) | 70 | -- Git-Branch (buffer-lokal, gecached, kein redraw-spam) |
| 71 | 71 | ||
| 72 | local function git() | 72 | local function git() |
| 73 | return vim.b.git_branch or "" | 73 | return vim.b.git_branch or "" |
| 74 | end | 74 | end |
| 75 | 75 | ||
| 76 | -- Git-Diff (buffer-lokal, kein redraw-spam) | 76 | -- Git-Diff (buffer-lokal, kein redraw-spam) |
| 77 | 77 | ||
| 78 | local function git_diff() | 78 | local function git_diff() |
| 79 | local gsd = vim.b.gitsigns_status_dict | 79 | local gsd = vim.b.gitsigns_status_dict |
| 80 | if not gsd then return "" end | 80 | if not gsd then return "" end |
| 81 | 81 | ||
| 82 | local parts = {} | 82 | local parts = {} |
| 83 | if gsd.added and gsd.added > 0 then table.insert(parts, "+" .. gsd.added) end | 83 | if gsd.added and gsd.added > 0 then table.insert(parts, "+" .. gsd.added) end |
| 84 | if gsd.changed and gsd.changed > 0 then table.insert(parts, "~" .. gsd.changed) end | 84 | if gsd.changed and gsd.changed > 0 then table.insert(parts, "~" .. gsd.changed) end |
| 85 | if gsd.removed and gsd.removed > 0 then table.insert(parts, "-" .. gsd.removed) end | 85 | if gsd.removed and gsd.removed > 0 then table.insert(parts, "-" .. gsd.removed) end |
| 86 | 86 | ||
| 87 | if #parts > 0 then return " " .. table.concat(parts, " ") .. " " end | 87 | if #parts > 0 then return " " .. table.concat(parts, " ") .. " " end |
| 88 | 88 | ||
| 89 | return "" | 89 | return "" |
| 90 | end | 90 | end |
| 91 | 91 | ||
| 92 | ---------------------------------------------------------------------- | 92 | ---------------------------------------------------------------------- |
| 93 | -- Dateiname mit Modifikationsstatus | 93 | -- Dateiname mit Modifikationsstatus |
| 94 | ---------------------------------------------------------------------- | 94 | ---------------------------------------------------------------------- |
| 95 | 95 | ||
| 96 | local function filename() | 96 | local function filename() |
| 97 | local name = vim.fn.expand("%:.") | 97 | local name = vim.fn.expand("%:.") |
| 98 | if name == "" then name = "[No Name]" end | 98 | if name == "" then name = "[No Name]" end |
| 99 | 99 | ||
| 100 | if vim.bo.modified then name = name .. " [+]" end | 100 | if vim.bo.modified then name = name .. " [+]" end |
| 101 | 101 | ||
| 102 | return " " .. name .. " " | 102 | return " " .. name .. " " |
| 103 | end | 103 | end |
| 104 | 104 | ||
| 105 | ------------------------------------------------------------------------ | 105 | ------------------------------------------------------------------------ |
| 106 | -- Treesitter-Aktivität (buffer-lokal, kein redraw-spam) | 106 | -- Treesitter-Aktivität (buffer-lokal, kein redraw-spam) |
| 107 | ------------------------------------------------------------------------ | 107 | ------------------------------------------------------------------------ |
| 108 | 108 | ||
| 109 | local function treesitter() | 109 | local function treesitter() |
| 110 | local ok = vim.treesitter.highlighter.active[vim.api.nvim_get_current_buf()] | 110 | local ok = vim.treesitter.highlighter.active[vim.api.nvim_get_current_buf()] |
| 111 | if ok then return " 🌳 " end | 111 | if ok then return " 🌳 " end |
| 112 | return "" | 112 | return "" |
| 113 | end | 113 | end |
| 114 | 114 | ||
| 115 | ------------------------------------------------------------------------ | 115 | ------------------------------------------------------------------------ |
| 116 | -- Diagnostik-Counts (buffer-lokal, kein redraw-spam) | 116 | -- Diagnostik-Counts (buffer-lokal, kein redraw-spam) |
| 117 | ------------------------------------------------------------------------ | 117 | ------------------------------------------------------------------------ |
| 118 | 118 | ||
| 119 | local function diagnostics() | 119 | local function diagnostics() |
| 120 | local counts = { | 120 | local counts = { |
| 121 | error = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR }), | 121 | error = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR }), |
| 122 | warn = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN }), | 122 | warn = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN }), |
| 123 | info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO }), | 123 | info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO }), |
| 124 | hint = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT }), | 124 | hint = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT }), |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | local parts = {} | 127 | local parts = {} |
| 128 | 128 | ||
| 129 | if counts.error > 0 then table.insert(parts, " " .. counts.error) end | 129 | if counts.error > 0 then table.insert(parts, " " .. counts.error) end |
| 130 | if counts.warn > 0 then table.insert(parts, " " .. counts.warn) end | 130 | if counts.warn > 0 then table.insert(parts, " " .. counts.warn) end |
| 131 | if counts.info > 0 then table.insert(parts, " " .. counts.info) end | 131 | if counts.info > 0 then table.insert(parts, " " .. counts.info) end |
| 132 | if counts.hint > 0 then table.insert(parts, " " .. counts.hint) end | 132 | if counts.hint > 0 then table.insert(parts, " " .. counts.hint) end |
| 133 | 133 | ||
| 134 | if #parts > 0 then return " " .. table.concat(parts, " ") .. " " end | 134 | if #parts > 0 then return " " .. table.concat(parts, " ") .. " " end |
| 135 | 135 | ||
| 136 | return "" | 136 | return "" |
| 137 | end | 137 | end |
| 138 | 138 | ||
| 139 | ------------------------------------------------------------------------ | 139 | ------------------------------------------------------------------------ |
| 140 | -- Filetype & Encoding (buffer-lokal, kein redraw-spam) | 140 | -- Filetype & Encoding (buffer-lokal, kein redraw-spam) |
| 141 | ------------------------------------------------------------------------ | 141 | ------------------------------------------------------------------------ |
| 142 | 142 | ||
| 143 | local function fileinfo() | 143 | local function fileinfo() |
| 144 | local ft = vim.bo.filetype ~= "" and vim.bo.filetype or "none" | 144 | local ft = vim.bo.filetype ~= "" and vim.bo.filetype or "none" |
| 145 | local enc = vim.bo.fileencoding ~= "" and vim.bo.fileencoding or vim.o.encoding | 145 | local enc = vim.bo.fileencoding ~= "" and vim.bo.fileencoding or vim.o.encoding |
| 146 | return string.format(" %s %s ", ft, enc) | 146 | return string.format(" %s %s ", ft, enc) |
| 147 | end | 147 | end |
| 148 | 148 | ||
| 149 | ------------------------------------------------------------------------ | 149 | ------------------------------------------------------------------------ |
| 150 | -- Cursor-Position (kein redraw-spam) | 150 | -- Cursor-Position (kein redraw-spam) |
| 151 | ------------------------------------------------------------------------ | 151 | ------------------------------------------------------------------------ |
| 152 | 152 | ||
| 153 | local function position() | 153 | local function position() |
| 154 | return string.format(" %d:%d ", vim.fn.line("."), vim.fn.col(".")) | 154 | return string.format(" %d:%d ", vim.fn.line("."), vim.fn.col(".")) |
| 155 | end | 155 | end |
| 156 | 156 | ||
| 157 | ---------------------------------------------------------------------- | 157 | ---------------------------------------------------------------------- |
| 158 | -- Öffentliche Statusline-Funktion | 158 | -- Öffentliche Statusline-Funktion |
| 159 | ---------------------------------------------------------------------- | 159 | ---------------------------------------------------------------------- |
| 160 | 160 | ||
| 161 | function M.statusline() | 161 | function M.statusline() |
| 162 | return table.concat({ | 162 | return table.concat({ |
| 163 | -- LEFT: Mode & Context | 163 | -- LEFT: Mode & Context |
| 164 | mode(), | 164 | mode(), |
| 165 | "%#PmenuSel#", | 165 | "%#PmenuSel#", |
| 166 | git(), | 166 | git(), |
| 167 | git_diff(), | 167 | git_diff(), |
| 168 | "%#StatusLine#", | 168 | "%#StatusLine#", |
| 169 | filename(), | 169 | filename(), |
| 170 | 170 | ||
| 171 | "%=", | 171 | "%=", |
| 172 | 172 | ||
| 173 | -- RIGHT: Feedback & Meta | 173 | -- RIGHT: Feedback & Meta |
| 174 | diagnostics(), | 174 | diagnostics(), |
| 175 | treesitter(), | 175 | treesitter(), |
| 176 | fileinfo(), | 176 | fileinfo(), |
| 177 | " %p%% ", | 177 | " %p%% ", |
| 178 | position(), | 178 | position(), |
| 179 | }) | 179 | }) |
| 180 | end | 180 | end |
| 181 | 181 | ||
| 182 | return M | 182 | return M |
diff --git a/nvim/lua/config/treesitter.lua b/nvim/lua/config/treesitter.lua index d900e41..1eee267 100644 --- a/nvim/lua/config/treesitter.lua +++ b/nvim/lua/config/treesitter.lua | |||
| @@ -1,28 +1,28 @@ | |||
| 1 | local M = {} | 1 | local M = {} |
| 2 | 2 | ||
| 3 | -- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/SUPPORTED_LANGUAGES.md | 3 | -- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/SUPPORTED_LANGUAGES.md |
| 4 | M.languages = { | 4 | M.languages = { |
| 5 | "bash", | 5 | "bash", |
| 6 | "c", | 6 | "c", |
| 7 | "cpp", | 7 | "cpp", |
| 8 | "html", | 8 | "html", |
| 9 | "javascript", | 9 | "javascript", |
| 10 | "jq", | 10 | "jq", |
| 11 | "json", | 11 | "json", |
| 12 | "lua", | 12 | "lua", |
| 13 | "make", | 13 | "make", |
| 14 | "markdown", | 14 | "markdown", |
| 15 | "markdown_inline", | 15 | "markdown_inline", |
| 16 | "po", | 16 | "po", |
| 17 | "powershell", | 17 | "powershell", |
| 18 | "prisma", | 18 | "prisma", |
| 19 | "python", | 19 | "python", |
| 20 | "typescript", | 20 | "typescript", |
| 21 | "vim", | 21 | "vim", |
| 22 | "vimdoc", | 22 | "vimdoc", |
| 23 | "xml", | 23 | "xml", |
| 24 | "yaml", | 24 | "yaml", |
| 25 | "zsh", | 25 | "zsh", |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | return M | 28 | return M |
