From 462011e99590775d1b9726a48a39fee774dba276 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Thu, 23 Jan 2025 19:25:06 -0500 Subject: [PATCH] AutoYADM commit: 2025-01-23 19:25:06 --- .config/nvim/after/ftplugin/org.lua | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.config/nvim/after/ftplugin/org.lua b/.config/nvim/after/ftplugin/org.lua index e1c7b8f0..17ccdf4c 100644 --- a/.config/nvim/after/ftplugin/org.lua +++ b/.config/nvim/after/ftplugin/org.lua @@ -8,8 +8,25 @@ vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, { buffer = 0, command = "silent! write", }) -local function util(dir) + +local function modmap(dir, type) local mode = vim.api.nvim_get_mode() + local level = { + notsame = { + map = { "org_mappings.", "_visible_heading" }, + words = { + next = "next", + previous = "previous", + }, + }, + same = { + map = { "org_mappings.", "_heading_same_level" }, + words = { + next = "forward", + previous = "backward", + }, + }, + } require("orgmode").action("org_mappings." .. dir .. "_visible_heading") if mode.mode == "n" then vim.cmd("normal! zz") @@ -18,10 +35,10 @@ end local override = true if override then vim.keymap.set("n", "}", function() - util("next") + modmap("next") end) vim.keymap.set({ "n", "x" }, "{", function() - util("previous") + modmap("previous") end) end -- vim.api.nvim_create_autocmd({ "CursorMoved" }, {