From bd59900cb8a1be57e40bd9f8f179f42dbd53aa98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Vaux?= Date: Mon, 29 Apr 2024 10:06:17 +0200 Subject: [PATCH 1/2] Restore default normal mode keymaps --- lua/xit/init.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lua/xit/init.lua b/lua/xit/init.lua index cb3a469..730c6f2 100644 --- a/lua/xit/init.lua +++ b/lua/xit/init.lua @@ -283,6 +283,22 @@ local options = { disable_default_mappings = false, default_jump_group = 'all', -- possible values: all, open_and_ongoing wrap_jumps = true, + keymaps = { + [''] = 'jump_to_next_task', + [''] = 'jump_to_previous_task', + [''] = 'jump_to_next_headline', + [''] = 'jump_to_previous_headline', + [''] = 'toggle_checkbox', + [''] = 'toggle_checkbox_reverse', + ['n'] = 'create_new_task_after', + ['N'] = 'create_new_task_before', + ['m'] = 'create_new_headline_after', + ['M'] = 'create_new_headline_before', + ['t'] = 'toggle_jumps', + ['x'] = 'delete_task', + ['fo'] = 'filter_open_ongoing_tasks', + ['fc'] = 'filter_checked_tasks', + }, } local configured = false local M = {} From 084592beb90c527d0291048fb944dc27b2c59545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Vaux?= Date: Mon, 29 Apr 2024 10:08:22 +0200 Subject: [PATCH 2/2] Run LSP format --- lua/xit/init.lua | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/lua/xit/init.lua b/lua/xit/init.lua index 730c6f2..ac44b44 100644 --- a/lua/xit/init.lua +++ b/lua/xit/init.lua @@ -96,20 +96,44 @@ local set_mappings = function(M, augroup, options) end local names_interactions = { - toggle_checkbox = function() M.toggle_checkbox(false) end, - toggle_checkbox_reverse = function() M.toggle_checkbox(true) end, - jump_to_next_task = function() M.jump_to_next_task(options.wrap_jumps, jump_between) end, - jump_to_previous_task = function() M.jump_to_previous_task(options.wrap_jumps, jump_between) end, - jump_to_next_headline = function() M.jump_to_next_headline(options.wrap_jumps) end, - jump_to_previous_headline = function() M.jump_to_previous_headline(options.wrap_jumps) end, - create_new_task_before = function() M.create_new_task(true) end, - create_new_task_after = function() M.create_new_task(false) end, - create_new_headline_before = function() M.create_new_headline(true) end, - create_new_headline_after = function() M.create_new_headline(false) end, + toggle_checkbox = function() + M.toggle_checkbox(false) + end, + toggle_checkbox_reverse = function() + M.toggle_checkbox(true) + end, + jump_to_next_task = function() + M.jump_to_next_task(options.wrap_jumps, jump_between) + end, + jump_to_previous_task = function() + M.jump_to_previous_task(options.wrap_jumps, jump_between) + end, + jump_to_next_headline = function() + M.jump_to_next_headline(options.wrap_jumps) + end, + jump_to_previous_headline = function() + M.jump_to_previous_headline(options.wrap_jumps) + end, + create_new_task_before = function() + M.create_new_task(true) + end, + create_new_task_after = function() + M.create_new_task(false) + end, + create_new_headline_before = function() + M.create_new_headline(true) + end, + create_new_headline_after = function() + M.create_new_headline(false) + end, toggle_jumps = toggle_jumps, delete_task = M.delete_task, - filter_open_ongoing_tasks = function() M.filter_tasks({ 'open_task', 'ongoing_task' }) end, - filter_checked_tasks = function() M.filter_tasks({ 'checked_task' }) end, + filter_open_ongoing_tasks = function() + M.filter_tasks({ 'open_task', 'ongoing_task' }) + end, + filter_checked_tasks = function() + M.filter_tasks({ 'checked_task' }) + end, } vim.api.nvim_create_autocmd('FileType', {