diff --git a/lazy-lock.json b/lazy-lock.json index b12c4de..bc4ba7e 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,64 +1,83 @@ { - "AstroNvim": { "branch": "main", "commit": "ced71e326fd5a314eca237abe8a357eb4e9f40ae" }, + "AstroNvim": { "branch": "main", "commit": "7fd58328e2bc91d5cad606ee48fdf924fca6ea3e" }, "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, - "aerial.nvim": { "branch": "master", "commit": "6ab1a0ce4874d21610fc5a67a6c82c7b943c635b" }, - "astrocommunity": { "branch": "main", "commit": "633ae885ba7e08c11a86dfa058769eb5ee062fb8" }, - "astrocore": { "branch": "main", "commit": "c797dd5a592e2bd154f2503e231b8a4083659534" }, + "actions-preview.nvim": { "branch": "master", "commit": "cb938c25edaac38d362555f19244a9cb85d561e8" }, + "aerial.nvim": { "branch": "master", "commit": "5c4e2da4486da5f9b798ea9a0f1fc5c6bcd3d9cf" }, + "animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" }, + "astrocommunity": { "branch": "main", "commit": "175a21dc270a2abd65b7059ddb7ff166212d1e0f" }, + "astrocore": { "branch": "main", "commit": "5052189882442cf71e04ad2d5472ee31bfe6a5cf" }, "astrolsp": { "branch": "main", "commit": "0befe28a4ea96e46b7f7c01e4a634c04225ba55a" }, - "astrotheme": { "branch": "main", "commit": "4a2af93815e4e6adfe69c836e46047a9451de858" }, + "astrotheme": { "branch": "main", "commit": "cf0e65a7b3ce2f830b052f4da937729eee1e7a7d" }, "astroui": { "branch": "main", "commit": "4943abbd42674b43249313afe83b91065a40e4be" }, "better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" }, - "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, + "blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" }, "blink.compat": { "branch": "main", "commit": "2ed6d9a28b07fa6f3bface818470605f8896408c" }, - "catppuccin": { "branch": "main", "commit": "ce4a8e0d5267e67056f9f4dcf6cb1d0933c8ca00" }, - "clangd_extensions.nvim": { "branch": "main", "commit": "b67cc417d9020fb4b83d46662351b4d16894905e" }, - "cmake-tools.nvim": { "branch": "master", "commit": "87944a5d79b4da7458145d7476d5336557e11911" }, + "catppuccin": { "branch": "main", "commit": "16408d203973da7e43fab87c6f9d3bf7fa98fa8b" }, + "clangd_extensions.nvim": { "branch": "main", "commit": "92b720768fad9d8a333a3cbb167f0bab550f9f50" }, + "cmake-tools.nvim": { "branch": "master", "commit": "e100f40b117381dadf42a34b0718f8e4350715b2" }, "cmp-dap": { "branch": "master", "commit": "ea92773e84c0ad3288c3bc5e452ac91559669087" }, + "codecompanion.nvim": { "branch": "main", "commit": "ed70638e9d0922177affc89a97c2d7bf338dac8f" }, "crates.nvim": { "branch": "main", "commit": "ac9fa498a9edb96dc3056724ff69d5f40b898453" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "garbage-day.nvim": { "branch": "main", "commit": "2fcc56556281de8ee871a5f3beb9db7ab747ef32" }, "gitsigns.nvim": { "branch": "main", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, "heirline.nvim": { "branch": "master", "commit": "fae936abb5e0345b85c3a03ecf38525b0828b992" }, "homeassistant-nvim": { "branch": "main", "commit": "1484ec0ad211eaeefa977444e3c6d0987b20a349" }, + "hover.nvim": { "branch": "main", "commit": "e73c00da3a9c87a21d2a8ddf7ab4a39824bd5d56" }, + "image.nvim": { "branch": "master", "commit": "da2be65c153ba15a14a342b05591652a6df70d58" }, "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lazydev.nvim": { "branch": "main", "commit": "01bc2aacd51cf9021eb19d048e70ce3dd09f7f93" }, + "lsp-lens.nvim": { "branch": "main", "commit": "48bb1a7e271424c15f3d588d54adc9b7c319d977" }, + "lsp_signature.nvim": { "branch": "master", "commit": "af7e4074d85d785cf6614352ba9ad3b28a1f8a56" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, + "magick": { "branch": "master", "commit": "6971fa700c4d392130492a3925344b51c7cc54aa" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "markview.nvim": { "branch": "main", "commit": "1861f959599ae03cfd59f56222a542035b0cd947" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason-null-ls.nvim": { "branch": "main", "commit": "2b8433f76598397fcc97318d410e0c4f7a4bea6a" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "e51f9b259f066c4347f9a79ffde54c29a0619384" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, - "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, + "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" }, "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, - "neo-tree.nvim": { "branch": "main", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, - "neoconf.nvim": { "branch": "main", "commit": "757a4cc7e12cdd4e2fe5f4abe97769742f50bf98" }, - "none-ls.nvim": { "branch": "main", "commit": "550197530c12b4838d685cf4e0d5eb4cca8d52c7" }, + "mini.indentscope": { "branch": "main", "commit": "065c7713fb4cd0124fe1462f15f27feeb8b04406" }, + "neo-tree.nvim": { "branch": "main", "commit": "84c75e7a7e443586f60508d12fc50f90d9aee14e" }, + "neoconf.nvim": { "branch": "main", "commit": "bbe36f4d60ed096282f564ddae4e781e420a8270" }, + "none-ls.nvim": { "branch": "main", "commit": "3c206dfedf5f1385e9d29f85ffaec7874358592a" }, "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, - "nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" }, - "nvim-dap": { "branch": "master", "commit": "b38f7d30366d9169d0a623c4c85fbcf99d8d58bb" }, - "nvim-dap-python": { "branch": "master", "commit": "64652d1ae1db80870d9aac7132d76e37acd86a26" }, + "nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" }, + "nvim-dap": { "branch": "master", "commit": "085386b9359ddf8d76ad89b98973b8e332dc5ba3" }, + "nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, - "nvim-highlight-colors": { "branch": "main", "commit": "e0c4a58ec8c3ca7c92d3ee4eb3bc1dd0f7be317e" }, - "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, + "nvim-highlight-colors": { "branch": "main", "commit": "e2cb22089cc2358b2b995c09578224f142de6039" }, + "nvim-lsp-file-operations": { "branch": "master", "commit": "b9c795d3973e8eec22706af14959bc60c579e771" }, "nvim-lspconfig": { "branch": "master", "commit": "fa2662510d30b06168b6e2e6915518decde6bbac" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" }, - "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, + "nvim-ts-autotag": { "branch": "main", "commit": "db15f2e0df2f5db916e511e3fffb682ef2f6354f" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" }, "nvim-vtsls": { "branch": "main", "commit": "0b5f73c9e50ce95842ea07bb3f05c7d66d87d14a" }, "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, - "package-info.nvim": { "branch": "master", "commit": "0826010a13967bee4f74337e74d36e9bfa8ff2a7" }, + "package-info.nvim": { "branch": "master", "commit": "52e407af634cd5d3add0dc916c517865850113a4" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "remote-sshfs.nvim": { "branch": "main", "commit": "45502b3892774811153aeab5f7f9b0033c82005c" }, "resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" }, "rustaceanvim": { "branch": "master", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" }, + "rustowl": { "branch": "main", "commit": "aaf7d15cc55ff6f48c577cdd6352d51fbc031aea" }, "smart-splits.nvim": { "branch": "master", "commit": "ddb23c1a1cf1507bda487cda7f6e4690965ef9f5" }, - "snacks.nvim": { "branch": "main", "commit": "a4e46becca45eb65c73a388634b1ce8aad629ae0" }, - "telescope.nvim": { "branch": "master", "commit": "a8c2223ea6b185701090ccb1ebc7f4e41c4c9784" }, + "snacks.nvim": { "branch": "main", "commit": "e6fd58c82f2f3fcddd3fe81703d47d6d48fc7b9f" }, + "telescope.nvim": { "branch": "master", "commit": "cfb85dcf7f822b79224e9e6aef9e8c794211b20b" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, - "tsc.nvim": { "branch": "main", "commit": "e4773833726beec2e8a8e11f0b21613b5472b97b" }, + "ts-comments.nvim": { "branch": "main", "commit": "123a9fb12e7229342f807ec9e6de478b1102b041" }, + "tsc.nvim": { "branch": "main", "commit": "e083bcf1e54bc3af7df92b33235efb334e8c782c" }, "vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }, - "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" } + "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" }, + "windows.nvim": { "branch": "main", "commit": "c7492552b23d0ab30325e90b56066ec51242adc8" }, + "yazi.nvim": { "branch": "main", "commit": "172bd64a4c2d3adbe2e0ef56289f47ffe139ca55" } } diff --git a/lua/community.lua b/lua/community.lua index 1273227..8fa895c 100644 --- a/lua/community.lua +++ b/lua/community.lua @@ -18,7 +18,58 @@ return { { import = "astrocommunity.colorscheme.catppuccin", }, + { + import = "astrocommunity.markdown-and-latex.markdown-preview-nvim", + }, -- { -- import = "astrocommunity.completion.copilot-lua", -- }, + { + import = "astrocommunity.ai.codecompanion-nvim", + }, + { + import = "astrocommunity.file-explorer.yazi-nvim", + }, + { + import = "astrocommunity.bars-and-lines.lualine-nvim", + }, + { + import = "astrocommunity.utility.hover-nvim", + }, + { + import = "astrocommunity.split-and-window.windows-nvim", + }, + { + import = "astrocommunity.lsp.lsp-lens-nvim", + }, + { + import = "astrocommunity.lsp.lsp-signature-nvim", + }, + { + import = "astrocommunity.lsp.actions-preview-nvim", + }, + { + import = "astrocommunity.lsp.garbage-day-nvim", + }, + { + import = "astrocommunity.indent.mini-indentscope", + }, + { + import = "astrocommunity.indent.snacks-indent-hlchunk", + }, + { + import = "astrocommunity.markdown-and-latex.markview-nvim", + }, + { + import = "astrocommunity.media.image-nvim", + }, + { + import = "astrocommunity.editing-support.rustowl", + }, + { + import = "astrocommunity.git.diffview-nvim", + }, + { + import = "astrocommunity.comment.ts-comments-nvim", + }, } diff --git a/lua/plugins/action-preview.lua b/lua/plugins/action-preview.lua new file mode 100644 index 0000000..2b80a20 --- /dev/null +++ b/lua/plugins/action-preview.lua @@ -0,0 +1,38 @@ +return { + "actions-preview.nvim", + opts = function(_, opts) + local hl = require "actions-preview.highlight" + + -- opts.diff = opts.diff or {} + -- opts.diff.ctxlen = 3 + opts.highlight_command = { + hl.delta "/usr/bin/delta --no-gitconfig --side-by-side", + } + opts.backend = { "snacks" } + -- opts.telescope = opts.telescope or {} + opts.telescope = { + sorting_strategy = "ascending", + layout_strategy = "vertical", + layout_config = { + width = 0.8, + height = 0.9, + prompt_position = "top", + preview_cutoff = 20, + preview_height = function(_, _, max_lines) return max_lines - 15 end, + }, + } + ---@type snacks.picker.Config + opts.snacks = { + layout = { + preset = "vertical", + -- assert -- backdrop = false, + -- -- width = 0.8, + -- -- height = 0.9, + -- { win = "input", height = 1, border = "rounded" }, + -- { win = "list", border = "rounded" }, + -- { win = "preview", title = "{preview}", border = "rounded", grow = true }, + }, + } + return opts + end, +} diff --git a/lua/plugins/astrolsp.lua b/lua/plugins/astrolsp.lua index 720b9d3..483146d 100644 --- a/lua/plugins/astrolsp.lua +++ b/lua/plugins/astrolsp.lua @@ -1,4 +1,4 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE +-- if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE -- AstroLSP allows you to customize the features in AstroNvim's LSP configuration engine -- Configuration documentation can be found with `:h astrolsp` @@ -10,96 +10,11 @@ return { "AstroNvim/astrolsp", ---@type AstroLSPOpts opts = { - -- Configuration table of features provided by AstroLSP - features = { - codelens = true, -- enable/disable codelens refresh on start - inlay_hints = false, -- enable/disable inlay hints on start - semantic_tokens = true, -- enable/disable semantic token highlighting - }, - -- customize lsp formatting options formatting = { - -- control auto formatting on save - format_on_save = { - enabled = true, -- enable or disable format on save globally - allow_filetypes = { -- enable format on save for specified filetypes only - -- "go", - }, - ignore_filetypes = { -- disable format on save for specified filetypes - -- "python", - }, - }, - disabled = { -- disable formatting capabilities for the listed language servers - -- disable lua_ls formatting capability if you want to use StyLua to format your lua code - -- "lua_ls", - }, - timeout_ms = 1000, -- default format timeout - -- filter = function(client) -- fully override the default formatting function - -- return true - -- end - }, - -- enable servers that you already have installed without mason - servers = { - -- "pyright" - }, - -- customize language server configuration options passed to `lspconfig` - ---@diagnostic disable: missing-fields - config = { - -- clangd = { capabilities = { offsetEncoding = "utf-8" } }, - }, - -- customize how language servers are attached - handlers = { - -- a function without a key is simply the default handler, functions take two parameters, the server name and the configured options table for that server - -- function(server, opts) require("lspconfig")[server].setup(opts) end - - -- the key is the server that is being setup with `lspconfig` - -- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server - -- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed - }, - -- Configure buffer local auto commands to add when attaching a language server - autocmds = { - -- first key is the `augroup` to add the auto commands to (:h augroup) - lsp_codelens_refresh = { - -- Optional condition to create/delete auto command group - -- can either be a string of a client capability or a function of `fun(client, bufnr): boolean` - -- condition will be resolved for each client on each execution and if it ever fails for all clients, - -- the auto commands will be deleted for that buffer - cond = "textDocument/codeLens", - -- cond = function(client, bufnr) return client.name == "lua_ls" end, - -- list of auto commands to set - { - -- events to trigger - event = { "InsertLeave", "BufEnter" }, - -- the rest of the autocmd options (:h nvim_create_autocmd) - desc = "Refresh codelens (buffer)", - callback = function(args) - if require("astrolsp").config.features.codelens then vim.lsp.codelens.refresh { bufnr = args.buf } end - end, - }, + disabled = { + "volar", + "vtsls", }, }, - -- mappings to be set up on attaching of a language server - mappings = { - n = { - -- a `cond` key can provided as the string of a server capability to be required to attach, or a function with `client` and `bufnr` parameters from the `on_attach` that returns a boolean - gD = { - function() vim.lsp.buf.declaration() end, - desc = "Declaration of current symbol", - cond = "textDocument/declaration", - }, - ["uY"] = { - function() require("astrolsp.toggles").buffer_semantic_tokens() end, - desc = "Toggle LSP semantic highlight (buffer)", - cond = function(client) - return client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens ~= nil - end, - }, - }, - }, - -- A custom `on_attach` function to be run after the default `on_attach` function - -- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`) - on_attach = function(client, bufnr) - -- this would disable semanticTokensProvider for all clients - -- client.server_capabilities.semanticTokensProvider = nil - end, }, } diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua new file mode 100644 index 0000000..852b1a8 --- /dev/null +++ b/lua/plugins/codecompanion.lua @@ -0,0 +1,51 @@ +--if true then return {} end + +return { + "olimorris/codecompanion.nvim", + opts = function(_, opts) + opts = opts or {} + + -- Wir bauen die Struktur EXAKT wie in deinem Doku-Beispiel + opts.adapters = { + -- Die Ebene 'http' ist hier der entscheidende Container + http = { + my_imac = function() + return require("codecompanion.adapters").extend("openai_compatible", { + env = { + url = os.getenv "LOCAL_LLM", -- Dein lokaler iMac Port + api_key = "local-not-needed", + }, + schema = { + model = { + default = "qwen2.5-7b-coder", + }, + }, + }) + end, + my_gemini = function() + return require("codecompanion.adapters").extend("gemini", { + env = { + -- Ersetze dies durch deinen echten API Key oder nutze eine Umgebungsvariable + api_key = os.getenv "GEMENI_API_KEY", + }, + schema = { + model = { + default = "gemini-1.5-pro", -- oder "gemini-1.5-flash" + }, + }, + }) + end, + }, + } + + -- Jetzt sagen wir den Strategien, wo sie suchen sollen: + -- Der Pfad ist intern nun "http.my_imac" + opts.strategies = { + chat = { adapter = nil }, + inline = { adapter = nil }, + agent = { adapter = nil }, + } + + return opts + end, +} diff --git a/lua/plugins/indent.lua b/lua/plugins/indent.lua new file mode 100644 index 0000000..3cb702b --- /dev/null +++ b/lua/plugins/indent.lua @@ -0,0 +1,14 @@ +return { + "snacks.nvim", + opts = function(_, opts) + opts.indent.chunk.char = { + -- Benutzt die "Heavy" oder "Rounded" Nerd Font Varianten + corner_top = "╭", + corner_bottom = "╰", + horizontal = "─", + vertical = "┆", -- Gestrichelte Linie wirkt weniger erdrückend + arrow = "❯", -- Ein schöner Nerd-Font Chevron + } + return opts + end, +} diff --git a/lua/plugins/lsp-signature.lua b/lua/plugins/lsp-signature.lua new file mode 100644 index 0000000..5f9a553 --- /dev/null +++ b/lua/plugins/lsp-signature.lua @@ -0,0 +1,4 @@ +return { + "lsp_signature.nvim", + opts = function(_, opts) opts.hint_enable = true end, +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..84900d6 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,102 @@ +-- Hole die Macchiato Palette von Catppuccin +local cp = require("catppuccin.palettes").get_palette "macchiato" + +local colors = { + red = cp.red, -- #ed8796 + grey = cp.surface2, -- Ein mittleres Grau für die B-Sektion + black = cp.crust, -- Sehr dunkles Grau/Schwarz für die Ränder + white = cp.text, -- Haupttextfarbe + light_green = cp.teal, -- Für den Insert-Modus (etwas frischer) + orange = cp.peach, -- Für den Visual-Modus + green = cp.green, -- Für den Replace-Modus + bg_center = cp.mantle, -- Hintergrund für den mittleren Teil (C) +} + +local theme = { + normal = { + a = { fg = cp.base, bg = cp.blue, gui = "bold" }, -- Blau für Normal Mode + b = { fg = colors.white, bg = colors.grey }, + c = { fg = colors.white, bg = colors.bg_center }, + }, + insert = { a = { fg = cp.base, bg = colors.light_green, gui = "bold" } }, + visual = { a = { fg = cp.base, bg = colors.orange, gui = "bold" } }, + replace = { a = { fg = cp.base, bg = colors.green, gui = "bold" } }, + command = { a = { fg = cp.base, bg = cp.yellow, gui = "bold" } }, +} + +local empty = require("lualine.component"):extend() +function empty:draw(default_highlight) + self.status = "" + self.applied_separator = "" + self:apply_highlights(default_highlight) + self:apply_section_separators() + return self.status +end + +-- Hilfsfunktion für die Trenner +local function process_sections(sections) + for name, section in pairs(sections) do + -- Wir nutzen hier cp.mantle für die Lücken, damit es zum Catppuccin-Fluss passt + for pos = #section - 1, 1, -1 do + table.insert(section, pos + 1, { empty, color = { fg = colors.white, bg = cp.mantle } }) + end + + for id, comp in ipairs(section) do + if type(comp) ~= "table" then + comp = { comp } + section[id] = comp + end + -- Die schrägen Trenner ( und ) bleiben erhalten + local is_left = name:sub(9, 10) < "x" + comp.separator = is_left and { right = "" } or { left = "" } + end + end + return sections +end + +-- Deine Hilfsfunktionen bleiben identisch +local function search_result() + if vim.v.hlsearch == 0 then return "" end + local last_search = vim.fn.getreg "/" + if not last_search or last_search == "" then return "" end + local searchcount = vim.fn.searchcount { maxcount = 9999 } + return last_search .. " (" .. searchcount.current .. "/" .. searchcount.total .. ")" +end + +local function modified() + if vim.bo.modified then + return " ●" -- Ein schönerer Punkt für Catppuccin + elseif vim.bo.modifiable == false or vim.bo.readonly == true then + return " 󰌾" -- Ein Schloss-Icon für Readonly + end + return "" +end + +-- Rückgabe für das Lualine Setup +return { + "lualine.nvim", + opts = { + options = { + theme = theme, + component_separators = "", + section_separators = { left = "", right = "" }, + disabled_filetypes = { "alpha", "dashboard", "NvimTree" }, + }, + sections = process_sections { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename", modified }, + lualine_x = { search_result, "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + }, +} diff --git a/lua/plugins/lualine.lua.old b/lua/plugins/lualine.lua.old new file mode 100644 index 0000000..9a9d768 --- /dev/null +++ b/lua/plugins/lualine.lua.old @@ -0,0 +1,122 @@ +if true then return {} end + +local colors = { + red = "#ca1243", + grey = "#a0a1a7", + black = "#383a42", + white = "#f3f3f3", + light_green = "#83a598", + orange = "#fe8019", + green = "#8ec07c", +} + +local theme = { + normal = { + a = { fg = colors.white, bg = colors.black }, + b = { fg = colors.white, bg = colors.grey }, + c = { fg = colors.black, bg = colors.white }, + z = { fg = colors.white, bg = colors.black }, + }, + insert = { a = { fg = colors.black, bg = colors.light_green } }, + visual = { a = { fg = colors.black, bg = colors.orange } }, + replace = { a = { fg = colors.black, bg = colors.green } }, +} + +local empty = require("lualine.component"):extend() +function empty:draw(default_highlight) + self.status = "" + self.applied_separator = "" + self:apply_highlights(default_highlight) + self:apply_section_separators() + return self.status +end + +-- Put proper separators and gaps between components in sections +local function process_sections(sections) + for name, section in pairs(sections) do + local left = name:sub(9, 10) < "x" + for pos = 1, name ~= "lualine_z" and #section or #section - 1 do + table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } }) + end + for id, comp in ipairs(section) do + if type(comp) ~= "table" then + comp = { comp } + section[id] = comp + end + comp.separator = left and { right = "" } or { left = "" } + end + end + return sections +end + +local function search_result() + if vim.v.hlsearch == 0 then return "" end + local last_search = vim.fn.getreg "/" + if not last_search or last_search == "" then return "" end + local searchcount = vim.fn.searchcount { maxcount = 9999 } + return last_search .. "(" .. searchcount.current .. "/" .. searchcount.total .. ")" +end + +local function modified() + if vim.bo.modified then + return "+" + elseif vim.bo.modifiable == false or vim.bo.readonly == true then + return "-" + end + return "" +end + +-- require("lualine").setup {} + +return { + "lualine.nvim", + opts = { + + options = { + theme = theme, + component_separators = "", + section_separators = { left = "", right = "" }, + }, + sections = process_sections { + lualine_a = { "mode" }, + lualine_b = { + "branch", + "diff", + { + "diagnostics", + source = { "nvim" }, + sections = { "error" }, + diagnostics_color = { error = { bg = colors.red, fg = colors.white } }, + }, + { + "diagnostics", + source = { "nvim" }, + sections = { "warn" }, + diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } }, + }, + { "filename", file_status = false, path = 1 }, + { modified, color = { bg = colors.red } }, + { + "%w", + cond = function() return vim.wo.previewwindow end, + }, + { + "%r", + cond = function() return vim.bo.readonly end, + }, + { + "%q", + cond = function() return vim.bo.buftype == "quickfix" end, + }, + }, + lualine_c = {}, + lualine_x = {}, + lualine_y = { search_result, "filetype" }, + lualine_z = { "%l:%c", "%p%%/%L" }, + }, + inactive_sections = { + lualine_c = { "%f %y %m" }, + lualine_x = {}, + }, + }, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 94436aa..2b56a05 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,4 +1,4 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE +-- if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE -- Customize Treesitter @@ -7,8 +7,12 @@ return { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = { - "lua", - "vim", + "vue", + "html", + "css", + "javascript", + "typescript", + "tsx", -- add more arguments for adding more treesitter parsers }, }, diff --git a/lua/plugins/windows.lua b/lua/plugins/windows.lua new file mode 100644 index 0000000..186fae8 --- /dev/null +++ b/lua/plugins/windows.lua @@ -0,0 +1,20 @@ +--if true then return {} end + +return { + "windows.nvim", + opts = function(_, opts) + opts.autowidth = { enable = true } + return opts + end, + -- event = "WindowsEnableAutoWidth", + dependencies = { + "AstroNvim/astrocore", + opts = { + mappings = { + n = { + ["W"] = function() vim.cmd "WindowsMaximize" end, + }, + }, + }, + }, +}