feat: text objects and motions for the pending buffer
Problem: the pending buffer has action-button mappings but no Vim grammar. You cannot dat to delete a task, cit to change a description, or ]] to jump to the next category header. Solution: add textobj.lua with at/it (a task / inner task), aC/iC (a category / inner category), ]]/[[ (next/prev header), and ]t/[t (next/prev task). All text objects work in operator-pending and visual modes; motions work in normal, visual, and operator-pending. Mappings are configurable via the keymaps table and exposed as <Plug> mappings.
This commit is contained in:
parent
c57cc0845b
commit
233ff31df1
5 changed files with 661 additions and 0 deletions
|
|
@ -11,6 +11,14 @@
|
|||
---@field undo? string|false
|
||||
---@field open_line? string|false
|
||||
---@field open_line_above? string|false
|
||||
---@field a_task? string|false
|
||||
---@field i_task? string|false
|
||||
---@field a_category? string|false
|
||||
---@field i_category? string|false
|
||||
---@field next_header? string|false
|
||||
---@field prev_header? string|false
|
||||
---@field next_task? string|false
|
||||
---@field prev_task? string|false
|
||||
|
||||
---@class pending.Config
|
||||
---@field data_path string
|
||||
|
|
@ -47,6 +55,14 @@ local defaults = {
|
|||
undo = 'U',
|
||||
open_line = 'o',
|
||||
open_line_above = 'O',
|
||||
a_task = 'at',
|
||||
i_task = 'it',
|
||||
a_category = 'aC',
|
||||
i_category = 'iC',
|
||||
next_header = ']]',
|
||||
prev_header = '[[',
|
||||
next_task = ']t',
|
||||
prev_task = '[t',
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue