diff options
Diffstat (limited to 'nvim')
| -rw-r--r-- | nvim/ftplugin/gitolite.lua | 8 | ||||
| -rw-r--r-- | nvim/ftplugin/html.lua | 16 | ||||
| -rw-r--r-- | nvim/ftplugin/lua.lua | 12 | ||||
| -rw-r--r-- | nvim/ftplugin/markdown.lua | 6 | ||||
| -rw-r--r-- | nvim/ftplugin/sh.lua | 8 | ||||
| -rw-r--r-- | nvim/ftplugin/taskedit.lua | 2 | ||||
| -rw-r--r-- | nvim/ftplugin/taskwarrior.lua | 14 | ||||
| -rw-r--r-- | nvim/ftplugin/typescript.lua | 12 | ||||
| -rw-r--r-- | nvim/init.lua | 18 | ||||
| -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 | ||||
| -rw-r--r-- | nvim/lua/plugins/completion.lua | 92 | ||||
| -rw-r--r-- | nvim/lua/plugins/editing.lua | 64 | ||||
| -rw-r--r-- | nvim/lua/plugins/format.lua | 92 | ||||
| -rw-r--r-- | nvim/lua/plugins/git.lua | 32 | ||||
| -rw-r--r-- | nvim/lua/plugins/lsp.lua | 248 | ||||
| -rw-r--r-- | nvim/lua/plugins/telescope.lua | 42 | ||||
| -rw-r--r-- | nvim/lua/plugins/treesitter.lua | 44 | ||||
| -rw-r--r-- | nvim/stylua.toml | 26 |
22 files changed, 670 insertions, 670 deletions
diff --git a/nvim/ftplugin/gitolite.lua b/nvim/ftplugin/gitolite.lua index acbde0f..c5d1305 100644 --- a/nvim/ftplugin/gitolite.lua +++ b/nvim/ftplugin/gitolite.lua | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | local opt = vim.opt_local | 1 | local opt = vim.opt_local |
| 2 | 2 | ||
| 3 | opt.expandtab = true | 3 | opt.expandtab = true |
| 4 | opt.shiftwidth = 4 | 4 | opt.shiftwidth = 4 |
diff --git a/nvim/ftplugin/html.lua b/nvim/ftplugin/html.lua index 98580db..009e21d 100644 --- a/nvim/ftplugin/html.lua +++ b/nvim/ftplugin/html.lua | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | local opt = vim.opt_local | 1 | local opt = vim.opt_local |
| 2 | 2 | ||
| 3 | opt.tabstop = 2 | 3 | opt.tabstop = 2 |
| 4 | opt.softtabstop = 2 | 4 | opt.softtabstop = 2 |
| 5 | opt.shiftwidth = 2 | 5 | opt.shiftwidth = 2 |
| 6 | opt.expandtab = true | 6 | opt.expandtab = true |
| 7 | opt.autoindent = true | 7 | opt.autoindent = true |
| 8 | opt.foldenable = true | 8 | opt.foldenable = true |
diff --git a/nvim/ftplugin/lua.lua b/nvim/ftplugin/lua.lua index 087e84c..096143b 100644 --- a/nvim/ftplugin/lua.lua +++ b/nvim/ftplugin/lua.lua | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | local opt = vim.opt_local | 1 | local opt = vim.opt_local |
| 2 | 2 | ||
| 3 | opt.expandtab = true | 3 | opt.expandtab = true |
| 4 | opt.shiftwidth = 2 | 4 | opt.shiftwidth = 2 |
| 5 | opt.softtabstop = 2 | 5 | opt.softtabstop = 2 |
| 6 | opt.tabstop = 2 | 6 | opt.tabstop = 2 |
diff --git a/nvim/ftplugin/markdown.lua b/nvim/ftplugin/markdown.lua index dca68dd..5f07330 100644 --- a/nvim/ftplugin/markdown.lua +++ b/nvim/ftplugin/markdown.lua | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | local opt = vim.opt_local | 1 | local opt = vim.opt_local |
| 2 | 2 | ||
| 3 | opt.wrap = true | 3 | opt.wrap = true |
diff --git a/nvim/ftplugin/sh.lua b/nvim/ftplugin/sh.lua index 4bde5f7..cda52f1 100644 --- a/nvim/ftplugin/sh.lua +++ b/nvim/ftplugin/sh.lua | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | local opt = vim.opt_local | 1 | local opt = vim.opt_local |
| 2 | 2 | ||
| 3 | opt.expandtab = true | 3 | opt.expandtab = true |
| 4 | opt.shiftwidth = 2 | 4 | opt.shiftwidth = 2 |
diff --git a/nvim/ftplugin/taskedit.lua b/nvim/ftplugin/taskedit.lua index ebc56aa..a905acb 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 64f8ed7..a3c4537 100644 --- a/nvim/ftplugin/taskwarrior.lua +++ b/nvim/ftplugin/taskwarrior.lua | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | local opt = vim.opt_local | 1 | local opt = vim.opt_local |
| 2 | 2 | ||
| 3 | opt.autoindent = false | 3 | opt.autoindent = false |
| 4 | opt.cindent = false | 4 | opt.cindent = false |
| 5 | opt.indentexpr = "" | 5 | opt.indentexpr = "" |
| 6 | opt.indentkeys = "" | 6 | opt.indentkeys = "" |
| 7 | opt.smartindent = false | 7 | opt.smartindent = false |
diff --git a/nvim/ftplugin/typescript.lua b/nvim/ftplugin/typescript.lua index 087e84c..096143b 100644 --- a/nvim/ftplugin/typescript.lua +++ b/nvim/ftplugin/typescript.lua | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | local opt = vim.opt_local | 1 | local opt = vim.opt_local |
| 2 | 2 | ||
| 3 | opt.expandtab = true | 3 | opt.expandtab = true |
| 4 | opt.shiftwidth = 2 | 4 | opt.shiftwidth = 2 |
| 5 | opt.softtabstop = 2 | 5 | opt.softtabstop = 2 |
| 6 | opt.tabstop = 2 | 6 | opt.tabstop = 2 |
diff --git a/nvim/init.lua b/nvim/init.lua index bda12b3..e56561e 100644 --- a/nvim/init.lua +++ b/nvim/init.lua | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | require("config.options") | 1 | require("config.options") |
| 2 | 2 | ||
| 3 | local keymaps = require("config.keymaps") | 3 | local keymaps = require("config.keymaps") |
| 4 | keymaps.global() | 4 | keymaps.global() |
| 5 | 5 | ||
| 6 | require("config.autocmds") | 6 | require("config.autocmds") |
| 7 | require("config.usercmds") | 7 | require("config.usercmds") |
| 8 | require("config.lazy") | 8 | require("config.lazy") |
| 9 | require("config.colorscheme") | 9 | require("config.colorscheme") |
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 |
diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua index 6e20d73..4912815 100644 --- a/nvim/lua/plugins/completion.lua +++ b/nvim/lua/plugins/completion.lua | |||
| @@ -1,46 +1,46 @@ | |||
| 1 | return { | 1 | return { |
| 2 | { | 2 | { |
| 3 | "saghen/blink.cmp", | 3 | "saghen/blink.cmp", |
| 4 | dependencies = { "rafamadriz/friendly-snippets" }, | 4 | dependencies = { "rafamadriz/friendly-snippets" }, |
| 5 | version = "1.*", | 5 | version = "1.*", |
| 6 | 6 | ||
| 7 | opts = { | 7 | opts = { |
| 8 | keymap = { preset = "default" }, | 8 | keymap = { preset = "default" }, |
| 9 | 9 | ||
| 10 | appearance = { | 10 | appearance = { |
| 11 | use_nvim_cmp_as_default = true, | 11 | use_nvim_cmp_as_default = true, |
| 12 | nerd_font_variant = "mono", | 12 | nerd_font_variant = "mono", |
| 13 | }, | 13 | }, |
| 14 | 14 | ||
| 15 | completion = { | 15 | completion = { |
| 16 | documentation = { | 16 | documentation = { |
| 17 | auto_show = false, | 17 | auto_show = false, |
| 18 | window = { | 18 | window = { |
| 19 | border = "rounded", | 19 | border = "rounded", |
| 20 | }, | 20 | }, |
| 21 | }, | 21 | }, |
| 22 | 22 | ||
| 23 | menu = { | 23 | menu = { |
| 24 | border = "rounded", | 24 | border = "rounded", |
| 25 | }, | 25 | }, |
| 26 | }, | 26 | }, |
| 27 | 27 | ||
| 28 | signature = { | 28 | signature = { |
| 29 | enabled = true, | 29 | enabled = true, |
| 30 | window = { | 30 | window = { |
| 31 | border = "rounded", | 31 | border = "rounded", |
| 32 | }, | 32 | }, |
| 33 | }, | 33 | }, |
| 34 | 34 | ||
| 35 | sources = { | 35 | sources = { |
| 36 | default = { "lsp", "path", "snippets", "buffer" }, | 36 | default = { "lsp", "path", "snippets", "buffer" }, |
| 37 | }, | 37 | }, |
| 38 | 38 | ||
| 39 | fuzzy = { | 39 | fuzzy = { |
| 40 | implementation = "prefer_rust_with_warning", | 40 | implementation = "prefer_rust_with_warning", |
| 41 | }, | 41 | }, |
| 42 | }, | 42 | }, |
| 43 | 43 | ||
| 44 | opts_extend = { "sources.default" }, | 44 | opts_extend = { "sources.default" }, |
| 45 | }, | 45 | }, |
| 46 | } | 46 | } |
diff --git a/nvim/lua/plugins/editing.lua b/nvim/lua/plugins/editing.lua index 38e651c..b9f9283 100644 --- a/nvim/lua/plugins/editing.lua +++ b/nvim/lua/plugins/editing.lua | |||
| @@ -1,32 +1,32 @@ | |||
| 1 | return { | 1 | return { |
| 2 | { | 2 | { |
| 3 | "tpope/vim-repeat", | 3 | "tpope/vim-repeat", |
| 4 | event = "VeryLazy", | 4 | event = "VeryLazy", |
| 5 | }, | 5 | }, |
| 6 | 6 | ||
| 7 | { | 7 | { |
| 8 | "tpope/vim-surround", -- alternative: "kylechui/nvim-surround" | 8 | "tpope/vim-surround", -- alternative: "kylechui/nvim-surround" |
| 9 | event = "VeryLazy", | 9 | event = "VeryLazy", |
| 10 | }, | 10 | }, |
| 11 | 11 | ||
| 12 | { | 12 | { |
| 13 | "romainl/vim-cool", | 13 | "romainl/vim-cool", |
| 14 | event = "VeryLazy", | 14 | event = "VeryLazy", |
| 15 | }, | 15 | }, |
| 16 | 16 | ||
| 17 | { | 17 | { |
| 18 | "windwp/nvim-autopairs", | 18 | "windwp/nvim-autopairs", |
| 19 | event = "InsertEnter", | 19 | event = "InsertEnter", |
| 20 | config = true, | 20 | config = true, |
| 21 | }, | 21 | }, |
| 22 | 22 | ||
| 23 | { | 23 | { |
| 24 | "windwp/nvim-ts-autotag", | 24 | "windwp/nvim-ts-autotag", |
| 25 | event = "InsertEnter", | 25 | event = "InsertEnter", |
| 26 | }, | 26 | }, |
| 27 | 27 | ||
| 28 | { | 28 | { |
| 29 | "preservim/vim-markdown", | 29 | "preservim/vim-markdown", |
| 30 | ft = "markdown", | 30 | ft = "markdown", |
| 31 | }, | 31 | }, |
| 32 | } | 32 | } |
diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index 102326c..8ca7f1b 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua | |||
| @@ -1,46 +1,46 @@ | |||
| 1 | -- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters | 1 | -- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters |
| 2 | 2 | ||
| 3 | local clang = {} | 3 | local clang = {} |
| 4 | local gawk = { "gawk" } -- brew install gawk, pkg install gawk | 4 | local gawk = { "gawk" } -- brew install gawk, pkg install gawk |
| 5 | local jq = { "jq" } -- brew install jq, pkg install jq | 5 | local jq = { "jq" } -- brew install jq, pkg install jq |
| 6 | local prettier = { "prettier" } -- npm install -g prettier | 6 | local prettier = { "prettier" } -- npm install -g prettier |
| 7 | local ruff = { "ruff_format" } -- brew install ruff, pkg install ruff | 7 | local ruff = { "ruff_format" } -- brew install ruff, pkg install ruff |
| 8 | local shfmt = { "shfmt" } -- brew install shfmt, pkg install shfmt | 8 | local shfmt = { "shfmt" } -- brew install shfmt, pkg install shfmt |
| 9 | local stylua = { "stylua" } -- brew install stylua, pkg install stylua | 9 | local stylua = { "stylua" } -- brew install stylua, pkg install stylua |
| 10 | local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2) | 10 | local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2) |
| 11 | local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt | 11 | local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt |
| 12 | 12 | ||
| 13 | return { | 13 | return { |
| 14 | "stevearc/conform.nvim", | 14 | "stevearc/conform.nvim", |
| 15 | event = { "BufReadPre", "BufNewFile" }, | 15 | event = { "BufReadPre", "BufNewFile" }, |
| 16 | keys = { | 16 | keys = { |
| 17 | { | 17 | { |
| 18 | "<leader>cf", | 18 | "<leader>cf", |
| 19 | function() | 19 | function() |
| 20 | require("conform").format({ async = true }) | 20 | require("conform").format({ async = true }) |
| 21 | end, | 21 | end, |
| 22 | desc = "Format file", | 22 | desc = "Format file", |
| 23 | }, | 23 | }, |
| 24 | }, | 24 | }, |
| 25 | opts = { | 25 | opts = { |
| 26 | formatters_by_ft = { | 26 | formatters_by_ft = { |
| 27 | awk = gawk, | 27 | awk = gawk, |
| 28 | bash = shfmt, | 28 | bash = shfmt, |
| 29 | c = clang, | 29 | c = clang, |
| 30 | cpp = clang, | 30 | cpp = clang, |
| 31 | html = prettier, | 31 | html = prettier, |
| 32 | javascript = prettier, | 32 | javascript = prettier, |
| 33 | json = jq, | 33 | json = jq, |
| 34 | lua = stylua, | 34 | lua = stylua, |
| 35 | python = ruff, | 35 | python = ruff, |
| 36 | sh = shfmt, | 36 | sh = shfmt, |
| 37 | typescript = prettier, | 37 | typescript = prettier, |
| 38 | xml = xmllint, | 38 | xml = xmllint, |
| 39 | xsd = xmllint, | 39 | xsd = xmllint, |
| 40 | yaml = yamlfmt, | 40 | yaml = yamlfmt, |
| 41 | }, | 41 | }, |
| 42 | default_format_opts = { | 42 | default_format_opts = { |
| 43 | lsp_format = "fallback", | 43 | lsp_format = "fallback", |
| 44 | }, | 44 | }, |
| 45 | }, | 45 | }, |
| 46 | } | 46 | } |
diff --git a/nvim/lua/plugins/git.lua b/nvim/lua/plugins/git.lua index 37d5ee3..ed7bafe 100644 --- a/nvim/lua/plugins/git.lua +++ b/nvim/lua/plugins/git.lua | |||
| @@ -1,16 +1,16 @@ | |||
| 1 | return { | 1 | return { |
| 2 | { | 2 | { |
| 3 | "lewis6991/gitsigns.nvim", | 3 | "lewis6991/gitsigns.nvim", |
| 4 | event = { "BufReadPre", "BufNewFile" }, | 4 | event = { "BufReadPre", "BufNewFile" }, |
| 5 | opts = { | 5 | opts = { |
| 6 | current_line_blame = true, | 6 | current_line_blame = true, |
| 7 | current_line_blame_opts = { | 7 | current_line_blame_opts = { |
| 8 | delay = 250, | 8 | delay = 250, |
| 9 | }, | 9 | }, |
| 10 | }, | 10 | }, |
| 11 | config = function(_, opts) | 11 | config = function(_, opts) |
| 12 | require("gitsigns").setup(opts) | 12 | require("gitsigns").setup(opts) |
| 13 | require("config.keymaps").gitsigns() | 13 | require("config.keymaps").gitsigns() |
| 14 | end, | 14 | end, |
| 15 | }, | 15 | }, |
| 16 | } | 16 | } |
diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 812ed24..b301b68 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua | |||
| @@ -1,124 +1,124 @@ | |||
| 1 | return { | 1 | return { |
| 2 | { | 2 | { |
| 3 | "neovim/nvim-lspconfig", | 3 | "neovim/nvim-lspconfig", |
| 4 | dependencies = { "saghen/blink.cmp" }, | 4 | dependencies = { "saghen/blink.cmp" }, |
| 5 | lazy = false, | 5 | lazy = false, |
| 6 | config = function() | 6 | config = function() |
| 7 | local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities()) | 7 | local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities()) |
| 8 | 8 | ||
| 9 | vim.lsp.config.lua_ls = { | 9 | vim.lsp.config.lua_ls = { |
| 10 | capabilities = capabilities, | 10 | capabilities = capabilities, |
| 11 | settings = { | 11 | settings = { |
| 12 | Lua = { | 12 | Lua = { |
| 13 | runtime = { | 13 | runtime = { |
| 14 | version = "LuaJIT", | 14 | version = "LuaJIT", |
| 15 | }, | 15 | }, |
| 16 | diagnostics = { | 16 | diagnostics = { |
| 17 | globals = { "vim" }, | 17 | globals = { "vim" }, |
| 18 | }, | 18 | }, |
| 19 | workspace = { | 19 | workspace = { |
| 20 | checkThirdParty = false, | 20 | checkThirdParty = false, |
| 21 | library = { | 21 | library = { |
| 22 | vim.env.VIMRUNTIME .. "/lua", | 22 | vim.env.VIMRUNTIME .. "/lua", |
| 23 | vim.fn.stdpath("config") .. "/lua", | 23 | vim.fn.stdpath("config") .. "/lua", |
| 24 | }, | 24 | }, |
| 25 | }, | 25 | }, |
| 26 | telemetry = { | 26 | telemetry = { |
| 27 | enable = false, | 27 | enable = false, |
| 28 | }, | 28 | }, |
| 29 | }, | 29 | }, |
| 30 | }, | 30 | }, |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | vim.lsp.config.bashls = { | 33 | vim.lsp.config.bashls = { |
| 34 | capabilities = capabilities, | 34 | capabilities = capabilities, |
| 35 | filetypes = { "sh", "bash" }, | 35 | filetypes = { "sh", "bash" }, |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | vim.lsp.config.clangd = { | 38 | vim.lsp.config.clangd = { |
| 39 | capabilities = capabilities, | 39 | capabilities = capabilities, |
| 40 | cmd = { | 40 | cmd = { |
| 41 | "clangd", | 41 | "clangd", |
| 42 | "--background-index", | 42 | "--background-index", |
| 43 | "--clang-tidy", | 43 | "--clang-tidy", |
| 44 | "--completion-style=detailed", | 44 | "--completion-style=detailed", |
| 45 | "--header-insertion=iwyu", | 45 | "--header-insertion=iwyu", |
| 46 | "--header-insertion-decorators", | 46 | "--header-insertion-decorators", |
| 47 | "--pch-storage=memory", | 47 | "--pch-storage=memory", |
| 48 | "--all-scopes-completion", | 48 | "--all-scopes-completion", |
| 49 | "--inlay-hints", | 49 | "--inlay-hints", |
| 50 | "--function-arg-placeholders", | 50 | "--function-arg-placeholders", |
| 51 | "--fallback-style=llvm", | 51 | "--fallback-style=llvm", |
| 52 | }, | 52 | }, |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | vim.lsp.config.prismals = { | 55 | vim.lsp.config.prismals = { |
| 56 | capabilities = capabilities, | 56 | capabilities = capabilities, |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | vim.lsp.config.jsonls = { | 59 | vim.lsp.config.jsonls = { |
| 60 | capabilities = capabilities, | 60 | capabilities = capabilities, |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | vim.lsp.config.html = { | 63 | vim.lsp.config.html = { |
| 64 | capabilities = capabilities, | 64 | capabilities = capabilities, |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | vim.lsp.config.vtsls = { | 67 | vim.lsp.config.vtsls = { |
| 68 | capabilities = capabilities, | 68 | capabilities = capabilities, |
| 69 | settings = { | 69 | settings = { |
| 70 | typescript = { | 70 | typescript = { |
| 71 | updateImportsOnFileMove = { enabled = "always" }, | 71 | updateImportsOnFileMove = { enabled = "always" }, |
| 72 | suggest = { | 72 | suggest = { |
| 73 | completeFunctionCalls = true, | 73 | completeFunctionCalls = true, |
| 74 | }, | 74 | }, |
| 75 | inlayHints = { | 75 | inlayHints = { |
| 76 | enumMemberValues = { enabled = true }, | 76 | enumMemberValues = { enabled = true }, |
| 77 | functionLikeReturnTypes = { enabled = true }, | 77 | functionLikeReturnTypes = { enabled = true }, |
| 78 | parameterNames = { enabled = "all" }, | 78 | parameterNames = { enabled = "all" }, |
| 79 | parameterTypes = { enabled = true }, | 79 | parameterTypes = { enabled = true }, |
| 80 | propertyDeclarationTypes = { enabled = true }, | 80 | propertyDeclarationTypes = { enabled = true }, |
| 81 | variableTypes = { enabled = false }, | 81 | variableTypes = { enabled = false }, |
| 82 | }, | 82 | }, |
| 83 | }, | 83 | }, |
| 84 | javascript = { | 84 | javascript = { |
| 85 | suggest = { | 85 | suggest = { |
| 86 | completeFunctionCalls = true, | 86 | completeFunctionCalls = true, |
| 87 | }, | 87 | }, |
| 88 | inlayHints = { | 88 | inlayHints = { |
| 89 | parameterNames = { enabled = "all" }, | 89 | parameterNames = { enabled = "all" }, |
| 90 | }, | 90 | }, |
| 91 | }, | 91 | }, |
| 92 | }, | 92 | }, |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | vim.lsp.config.basedpyright = { | 95 | vim.lsp.config.basedpyright = { |
| 96 | capabilities = capabilities, | 96 | capabilities = capabilities, |
| 97 | settings = { | 97 | settings = { |
| 98 | basedpyright = { | 98 | basedpyright = { |
| 99 | analysis = { | 99 | analysis = { |
| 100 | diagnosticMode = "openFilesOnly", | 100 | diagnosticMode = "openFilesOnly", |
| 101 | inlayHints = { | 101 | inlayHints = { |
| 102 | callArgumentNames = true, | 102 | callArgumentNames = true, |
| 103 | }, | 103 | }, |
| 104 | typeCheckingMode = "basic", -- oder "strict" für strenger | 104 | typeCheckingMode = "basic", -- oder "strict" für strenger |
| 105 | autoSearchPaths = true, | 105 | autoSearchPaths = true, |
| 106 | useLibraryCodeForTypes = true, | 106 | useLibraryCodeForTypes = true, |
| 107 | }, | 107 | }, |
| 108 | }, | 108 | }, |
| 109 | }, | 109 | }, |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | vim.lsp.enable({ | 112 | vim.lsp.enable({ |
| 113 | "basedpyright", -- npm install -g basedpyright, brew install basedpyright | 113 | "basedpyright", -- npm install -g basedpyright, brew install basedpyright |
| 114 | "bashls", -- npm install -g bash-language-server, pkg install hs-ShellCheck | 114 | "bashls", -- npm install -g bash-language-server, pkg install hs-ShellCheck |
| 115 | "clangd", -- pkg install llvm | 115 | "clangd", -- pkg install llvm |
| 116 | "html", -- npm install -g vscode-langservers-extracted | 116 | "html", -- npm install -g vscode-langservers-extracted |
| 117 | "jsonls", -- npm install -g vscode-langservers-extracted | 117 | "jsonls", -- npm install -g vscode-langservers-extracted |
| 118 | "lua_ls", -- pkg install lua-language-server, brew install lua-language-server | 118 | "lua_ls", -- pkg install lua-language-server, brew install lua-language-server |
| 119 | "prismals", -- npm install -g @prisma/language-server | 119 | "prismals", -- npm install -g @prisma/language-server |
| 120 | "vtsls", -- npm install -g @vtsls/language-server | 120 | "vtsls", -- npm install -g @vtsls/language-server |
| 121 | }) | 121 | }) |
| 122 | end, | 122 | end, |
| 123 | }, | 123 | }, |
| 124 | } | 124 | } |
diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index d4e3fd3..d7fd279 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua | |||
| @@ -1,21 +1,21 @@ | |||
| 1 | return { | 1 | return { |
| 2 | { | 2 | { |
| 3 | "nvim-telescope/telescope.nvim", | 3 | "nvim-telescope/telescope.nvim", |
| 4 | dependencies = { | 4 | dependencies = { |
| 5 | "nvim-lua/plenary.nvim", | 5 | "nvim-lua/plenary.nvim", |
| 6 | }, | 6 | }, |
| 7 | lazy = true, | 7 | lazy = true, |
| 8 | opts = { | 8 | opts = { |
| 9 | defaults = { | 9 | defaults = { |
| 10 | path_display = { "smart", "truncate" }, | 10 | path_display = { "smart", "truncate" }, |
| 11 | }, | 11 | }, |
| 12 | }, | 12 | }, |
| 13 | keys = { | 13 | keys = { |
| 14 | { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" }, | 14 | { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" }, |
| 15 | { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live grep" }, | 15 | { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live grep" }, |
| 16 | { "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" }, | 16 | { "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" }, |
| 17 | { "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Help tags" }, | 17 | { "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Help tags" }, |
| 18 | { "<leader>dd", "<cmd>Telescope diagnostics<cr>", desc = "Diagnostics" }, | 18 | { "<leader>dd", "<cmd>Telescope diagnostics<cr>", desc = "Diagnostics" }, |
| 19 | }, | 19 | }, |
| 20 | }, | 20 | }, |
| 21 | } | 21 | } |
diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index 954e05f..faa850a 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua | |||
| @@ -1,22 +1,22 @@ | |||
| 1 | -- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/README.md | 1 | -- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/README.md |
| 2 | 2 | ||
| 3 | -- Stelle sicher, dass die TreeSitter-CLI installiert ist: | 3 | -- Stelle sicher, dass die TreeSitter-CLI installiert ist: |
| 4 | -- MacOS: `brew install tree-sitter-cli` | 4 | -- MacOS: `brew install tree-sitter-cli` |
| 5 | -- FreeBSD: `doas pkg install tree-sitter-cli` | 5 | -- FreeBSD: `doas pkg install tree-sitter-cli` |
| 6 | 6 | ||
| 7 | return { | 7 | return { |
| 8 | { | 8 | { |
| 9 | "nvim-treesitter/nvim-treesitter", | 9 | "nvim-treesitter/nvim-treesitter", |
| 10 | branch = "main", | 10 | branch = "main", |
| 11 | build = ":TSUpdate", | 11 | build = ":TSUpdate", |
| 12 | lazy = false, | 12 | lazy = false, |
| 13 | opts = {}, | 13 | opts = {}, |
| 14 | config = function(_, opts) | 14 | config = function(_, opts) |
| 15 | local treesitter = require("nvim-treesitter") | 15 | local treesitter = require("nvim-treesitter") |
| 16 | local langs = require("config.treesitter").languages | 16 | local langs = require("config.treesitter").languages |
| 17 | 17 | ||
| 18 | treesitter.setup(opts) | 18 | treesitter.setup(opts) |
| 19 | treesitter.install(langs) | 19 | treesitter.install(langs) |
| 20 | end, | 20 | end, |
| 21 | }, | 21 | }, |
| 22 | } | 22 | } |
diff --git a/nvim/stylua.toml b/nvim/stylua.toml index 133302c..28b83c7 100644 --- a/nvim/stylua.toml +++ b/nvim/stylua.toml | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | syntax = "All" | 1 | syntax = "All" |
| 2 | column_width = 120 | 2 | column_width = 120 |
| 3 | line_endings = "Unix" | 3 | line_endings = "Unix" |
| 4 | indent_type = "Spaces" | 4 | indent_type = "Spaces" |
| 5 | indent_width = 2 | 5 | indent_width = 2 |
| 6 | quote_style = "AutoPreferDouble" | 6 | quote_style = "AutoPreferDouble" |
| 7 | call_parentheses = "Always" | 7 | call_parentheses = "Always" |
| 8 | collapse_simple_statement = "ConditionalOnly" | 8 | collapse_simple_statement = "ConditionalOnly" |
| 9 | space_after_function_names = "Never" | 9 | space_after_function_names = "Never" |
| 10 | block_newline_gaps = "Never" | 10 | block_newline_gaps = "Never" |
| 11 | 11 | ||
| 12 | [sort_requires] | 12 | [sort_requires] |
| 13 | enabled = false | 13 | enabled = false |
