From 367e2f17233b1c19238fd77fde33c379eb0814be Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Thu, 23 Apr 2026 11:04:19 +0200 Subject: Neovim: Umbrucheinstellungen geändert und Unterstützung für Markdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/ftplugin/markdown.lua | 3 +++ nvim/lua/config/options.lua | 9 ++++++++- nvim/lua/config/usercmds.lua | 27 +++++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 nvim/ftplugin/markdown.lua (limited to 'nvim') diff --git a/nvim/ftplugin/markdown.lua b/nvim/ftplugin/markdown.lua new file mode 100644 index 0000000..5f07330 --- /dev/null +++ b/nvim/ftplugin/markdown.lua @@ -0,0 +1,3 @@ +local opt = vim.opt_local + +opt.wrap = true diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 37adc84..848966b 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -5,7 +5,6 @@ local g = vim.g opt.number = true opt.cursorline = true opt.shortmess:append("I") -opt.wrap = false opt.wildmenu = true opt.splitright = true opt.splitbelow = true @@ -13,6 +12,11 @@ opt.signcolumn = "yes" opt.termguicolors = true opt.showcmd = false +-- Texte umbrechen +opt.wrap = false +opt.linebreak = true +opt.breakindent = true + -- Rechtschreibprüfung opt.spelllang = { "de", "en" } opt.spell = false @@ -35,6 +39,9 @@ opt.listchars = { precedes = "<", nbsp = "+" } +opt.showbreak = "↪ " + +-- Erlaube % für Winkelklammern opt.matchpairs:append("<:>") -- automatisches Einlesen geänderter Dateien diff --git a/nvim/lua/config/usercmds.lua b/nvim/lua/config/usercmds.lua index e7dd220..490e4b5 100644 --- a/nvim/lua/config/usercmds.lua +++ b/nvim/lua/config/usercmds.lua @@ -11,8 +11,31 @@ local function run_sonar() return end - -- vim.cmd("!" .. exe) - vim.cmd("botright split | terminal " .. exe) + -- Suche nach *.properties im aktuellen Verzeichnis + local files = vim.fn.glob("*.properties", false, true) + + local cmd = exe + + if #files > 0 then + -- Optional: gezielt sonar-project.properties bevorzugen + local selected = nil + for _, f in ipairs(files) do + if f == "sonar-project.properties" then + selected = f + break + end + end + + -- Falls keine Standarddatei, nimm die erste + if not selected then selected = files[1] end + + cmd = cmd .. " -Dproject.settings=" .. selected + vim.notify("Verwende Properties: " .. selected, vim.log.levels.INFO) + else + vim.notify("Keine .properties Datei gefunden, nutze Default-Verhalten", vim.log.levels.WARN) + end + + vim.cmd("botright split | terminal " .. cmd) vim.cmd("norm G") end -- cgit v1.3