From 7b1d1158e830faacef2fbcc102cfdf8a85777ee9 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Wed, 22 Jan 2025 11:55:08 -0500 Subject: [PATCH] AutoYADM commit: 2025-01-22 11:55:08 --- .config/nvim/after/ftplugin/org.lua | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.config/nvim/after/ftplugin/org.lua b/.config/nvim/after/ftplugin/org.lua index 6a3a794c..610e3641 100644 --- a/.config/nvim/after/ftplugin/org.lua +++ b/.config/nvim/after/ftplugin/org.lua @@ -7,14 +7,20 @@ vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, { buffer = 0, command = "silent! write", }) -vim.keymap.set("n", "}", function() - require("orgmode").action("org_mappings.next_visible_heading") - vim.cmd("normal! zz") -end) -vim.keymap.set("n", "{", function() - require("orgmode").action("org_mappings.previous_visible_heading") - vim.cmd("normal! zz") -end) +local override = false +if override then + vim.keymap.set("n", "}", function() + require("orgmode").action("org_mappings.next_visible_heading") + vim.cmd("normal! zz") + end) + vim.keymap.set({ "n", "x" }, "{", function() + local mode = vim.api.nvim_get_mode() + require("orgmode").action("org_mappings.previous_visible_heading") + if mode.mode == "n" then + vim.cmd("normal! zz") + end + end) +end -- vim.api.nvim_create_autocmd({ "CursorMoved" }, { -- buffer = 0, -- callback = function()