From 9e649894eed2c09ce7031fe45cd128b899fd3004 Mon Sep 17 00:00:00 2001 From: joelazar Date: Mon, 25 May 2026 18:10:51 +0200 Subject: [PATCH] :fire: remove autolist plugin --- lua/plugins/autolist.lua | 44 ---------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 lua/plugins/autolist.lua diff --git a/lua/plugins/autolist.lua b/lua/plugins/autolist.lua deleted file mode 100644 index 1649915..0000000 --- a/lua/plugins/autolist.lua +++ /dev/null @@ -1,44 +0,0 @@ --- Returns true if we should skip bullet creation: --- next line is empty AND the line after that is NOT a header (or end of file) -local function should_skip_bullet() - local row = vim.api.nvim_win_get_cursor(0)[1] -- 1-indexed - local line_count = vim.api.nvim_buf_line_count(0) - if row >= line_count then - return false - end - local next_line = vim.api.nvim_buf_get_lines(0, row, row + 1, false)[1] - if not next_line or not next_line:match("^%s*$") then - return false -- next line is not empty, don't skip - end - -- Next line is empty — check if the line after that is a header - if row + 1 < line_count then - local line_after = vim.api.nvim_buf_get_lines(0, row + 1, row + 2, false)[1] - if line_after and line_after:match("^#+ ") then - return false -- line after empty line is a header, allow bullet - end - end - return true -- empty line followed by non-header or EOF, skip bullet -end - -return { - "gaoDean/autolist.nvim", - ft = { "markdown" }, - opts = {}, - keys = { - { - "", - function() - -- Check BEFORE the CR is processed whether the line below cursor is empty - local skip = should_skip_bullet() - -- Insert the newline - local cr = vim.api.nvim_replace_termcodes("", true, false, true) - vim.api.nvim_feedkeys(cr, "n", false) - if not skip then - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("AutolistNewBullet", true, false, true), "n", false) - end - end, - ft = "markdown", - mode = "i", - }, - }, -} -- 2.51.2