-
-
Notifications
You must be signed in to change notification settings - Fork 215
Norg Text Objects
github-actions[bot] edited this page May 17, 2024
·
6 revisions
WARNING: Requires nvim 0.10+
- Easily move items up and down in the document
- Provides text objects for headings, tags, and lists
Users can create keybinds for some or all of the different events this module exposes. Those are:
those events are:
-
core.text-objects.item_up
- Moves the current "item" up -
core.text-objects.item_down
- same but down core.text-objects.textobject.heading.outer
core.text-objects.textobject.heading.inner
core.text-objects.textobject.tag.inner
core.text-objects.textobject.tag.outer
-
core.text-objects.textobject.list.outer
- around the entire list
Movable "items" include headings, and list items (ordered/unordered/todo)
Example keybinds that would go in your Neorg configuration:
["core.keybinds"] = {
config = {
hook = function(keybinds)
-- Binds to move items up or down
keybinds.remap_event("norg", "n", "<up>", "core.text-objects.item_up")
keybinds.remap_event("norg", "n", "<down>", "core.text-objects.item_down")
-- text objects, these binds are available as `vaH` to "visual select around a header" or
-- `diH` to "delete inside a header"
keybinds.remap_event("norg", { "o", "x" }, "iH", "core.text-objects.textobject.heading.inner")
keybinds.remap_event("norg", { "o", "x" }, "aH", "core.text-objects.textobject.heading.outer")
end,
},
},
-
core.integrations.treesitter
- A module designed to integrate Treesitter into Neorg. -
core.keybinds
- Module for managing keybindings with Neorg mode support.
core.autocommands
core.clipboard
core.clipboard.code-blocks
core.completion
core.concealer
core.defaults
core.dirman
core.dirman.utils
core.esupports.hop
core.esupports.indent
core.esupports.metagen
core.export
core.export.markdown
core.fs
core.highlights
core.integrations.coq_nvim
core.integrations.nvim-cmp
core.integrations.nvim-compe
core.integrations.treesitter
core.itero
core.journal
core.keybinds
core.latex.renderer
core.looking-glass
core.neorgcmd
core.neorgcmd.commands.return
core.pivot
core.presenter
core.promo
core.qol.toc
core.qol.todo_items
core.queries.native
core.scanner
core.storage
core.summary
core.syntax
core.tangle
core.tempus
core.text-objects
core.todo-introspector
core.ui
core.ui.calendar