From d301dadc3fd279b0383eb0d37dc00dfdd17e9f2b Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 17 Apr 2026 10:53:12 +0100 Subject: refactor: move core config from after/plugin/ and cfg/ to lua/config/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit after/plugin/ runs after ALL plugins with unpredictable ordering. Explicit require() from init.lua after lazy.setup() is more predictable and standard. - after/plugin/autocmds.lua → lua/config/autocmds.lua - after/plugin/mappings.lua → lua/config/keymaps.lua - cfg/options.lua → config/options.lua - cfg/utils.lua → config/utils.lua Creates a consistent lua/config/ namespace for all non-plugin configuration. --- home/.config/nvim/lua/cfg/utils.lua | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 home/.config/nvim/lua/cfg/utils.lua (limited to 'home/.config/nvim/lua/cfg/utils.lua') diff --git a/home/.config/nvim/lua/cfg/utils.lua b/home/.config/nvim/lua/cfg/utils.lua deleted file mode 100644 index 300d7a7..0000000 --- a/home/.config/nvim/lua/cfg/utils.lua +++ /dev/null @@ -1,29 +0,0 @@ -local M = {} -local gitsigns = require("gitsigns") -local conform = require("conform") - -function M.format_hunks(options) - local hunks = gitsigns.get_hunks() - if not hunks or vim.tbl_isempty(hunks) then - return - end - for _, hunk in ipairs(hunks) do - if hunk and hunk.added then - local start = hunk.added.start - local last = start + hunk.added.count - -- nvim_buf_get_lines uses zero-based indexing -> subtract from last - local last_hunk_line = - vim.api.nvim_buf_get_lines(0, last - 2, last - 1, true)[1] - local range = - { start = { start, 0 }, ["end"] = { last - 1, last_hunk_line:len() } } - options = vim.tbl_extend( - "force", - { range = range, lsp_fallback = true, quiet = true }, - options or {} - ) - conform.format(options) - end - end -end - -return M -- cgit v1.2.3-70-g09d2