From 9924f11acb9a7a6e15b124bcb57c65cd1313907d Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Tue, 12 Nov 2024 17:30:03 -0500 Subject: [PATCH] AutoYADM commit: 2024-11-12 17:30:02 --- .config/nvim/lua/config/autocmds.lua | 3 --- .config/nvim/lua/md-utils.lua | 14 +------------- .config/nvim/lua/plugins/dashboard.lua | 2 +- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index f2cb9912..e83ee584 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -47,15 +47,12 @@ vim.api.nvim_create_autocmd({ "FileType" }, { buffer = 0, command = "silent! write", }) - -- TODO: fix the not being sent\ recognize other types too? vim.keymap.set("i", "", function() local md_utils = require("md-utils") local isList = md_utils.isCursorInList() if isList then - -- print("Markdown list!") vim.api.nvim_command("MDListItemBelow") else - -- print("Not markdown list") vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n", true) end end, { desc = "Continue List", silent = true, remap = true }) diff --git a/.config/nvim/lua/md-utils.lua b/.config/nvim/lua/md-utils.lua index f2b5d673..5de8eddd 100644 --- a/.config/nvim/lua/md-utils.lua +++ b/.config/nvim/lua/md-utils.lua @@ -1,20 +1,8 @@ local M = {} -local ts_utils = require("nvim-treesitter.ts_utils") - M.isCursorInList = function() - local node = ts_utils.get_node_at_cursor() - print(node) - while node do - -- Check if node is a list item - if (node:type() == "list_item") or (node:type() == "list_item_content") then - return true - end - node = node:parent() - end - -- Fall back to line-based check for list item pattern if not directly on `list_item` node local line = vim.api.nvim_get_current_line() - if line:match("^%s*[%-%*%+%d+%.]%s+") then + if line:match("^%s*[%-%*%+]%s+") or line:match("^%s*%d+%.%s+") then return true end return false diff --git a/.config/nvim/lua/plugins/dashboard.lua b/.config/nvim/lua/plugins/dashboard.lua index e8041d52..2f43f678 100644 --- a/.config/nvim/lua/plugins/dashboard.lua +++ b/.config/nvim/lua/plugins/dashboard.lua @@ -61,7 +61,7 @@ YMMMUP^ -- { action = loadObsidian, desc = " Obsidian Tags", icon = "󱤇 ", key = "o" }, { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, { action = function () vim.api.nvim_input("ObsidianQuickSwitch") end, desc = " Obsidian", icon = " ", key = "o"}, - -- { action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = " ", key = "r" }, + { action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = " ", key = "r" }, -- { action = 'lua LazyVim.pick("live_grep")()', desc = " Grep", icon = " ", key = "/" }, -- { action = function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, desc = " Git", icon = " ", key = "g" }, { action = 'lua LazyVim.pick.config_files()()', desc = " Search Config", icon = " ", key = "c" },