Skip to content

Commit

Permalink
docs: document keybinds in modules that were missing them
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas committed Oct 15, 2024
1 parent afc9a37 commit 735f27a
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 13 deletions.
2 changes: 2 additions & 0 deletions docgen/docgen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ docgen.generators = {
return configuration
end
end,
"",

"",
function()
local required_modules = module.parsed.setup().requires or {}
Expand Down
10 changes: 9 additions & 1 deletion lua/neorg/modules/core/dirman/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ After a recent update `core.dirman` will no longer change the current working di
workspace. To get the best experience it's recommended to set the `autochdir` Neovim option.
### Create a new note
### Create a new note (in lua)
You can use dirman to create new notes in your workspaces.
```lua
Expand All @@ -47,6 +47,14 @@ dirman.create_file("my_file", "my_ws", {
metadata = {} -- key-value table for metadata fields
})
```
## Keybinds
This module exposes the following keybinds (see [`core.keybinds`](@core.keybinds) for instructions on
mapping them):
- `neorg.dirman.new-note` - Create a new note in the current workspace, prompt for name
--]]

local Path = require("pathlib")
Expand Down
8 changes: 8 additions & 0 deletions lua/neorg/modules/core/esupports/hop/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ The hop module serves to provide an easy way to follow and fix broken links with
By default, pressing `<CR>` in normal mode under a link will attempt to follow said link.
If the link location is found, you will be taken to the destination - if it is not, you will be
prompted with a set of actions that you can perform on the broken link.
## Keybinds
This module exposes the following keybinds (see [`core.keybinds`](@core.keybinds) for instructions on
mapping them):
- `neorg.esupports.hop.hop-link` - Follow the link under the cursor, seeks forward
- `neorg.esupports.hop.hop-link.vsplit` - Same, but open the link in a vertical split
--]]

local neorg = require("neorg.core")
Expand Down
10 changes: 10 additions & 0 deletions lua/neorg/modules/core/integrations/treesitter/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
embed: https://user-images.githubusercontent.com/76052559/151668244-9805afc4-8c50-4925-85ec-1098aff5ede6.gif
internal: true
---
## Keybinds
This module exposes the following keybinds (see [`core.keybinds`](@core.keybinds) for instructions on
mapping them):
- `neorg.treesitter.next.heading` - jump to the next heading
- `neorg.treesitter.next.link` - jump to the next link
- `neorg.treesitter.previous.heading` - jump to the previous heading
- `neorg.treesitter.previous.link` - jump to the previous link
--]]

local neorg = require("neorg.core")
Expand Down
2 changes: 1 addition & 1 deletion lua/neorg/modules/core/itero/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
headings and other repeatable (iterable) items.
By default, the key that is used to iterate on an item is `<M-CR>` (Alt + Enter). If you want to
change the bind, remap the `core.itero.next-iteration` event.
change the bind, remap the `neorg.itero.next-iteration` event.
Begin by writing an initial item you'd like to iterate (in this instance, and unordered list item):
```md
Expand Down
13 changes: 9 additions & 4 deletions lua/neorg/modules/core/looking-glass/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
The looking glass module provides a simple way to edit code blocks in an external buffer,
which allows LSPs and other language-specific tools to kick in.
The magnify command can be accessed by running `:Neorg keybind all
core.looking-glass.magnify-code-block` with your cursor underneath the code
block you would like to magnify - it is not bound to any key as of currently,
but you may map it yourself via the [`core.keybinds`](@core.keybinds) module.
If you would like LSP features in code blocks without having to magnify, you can use
[`core.integrations.otter`](@core.integrations.otter).
## Keybinds
This module exposes the following keybinds (see [`core.keybinds`](@core.keybinds) for instructions on
mapping them):
- `neorg.looking-glass.magnify-code-block` - magnify the code block under the cursor
--]]

local neorg = require("neorg.core")
Expand Down
10 changes: 6 additions & 4 deletions lua/neorg/modules/core/pivot/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
---
`core.pivot` allows you to switch (or pivot) between the two list types in Norg with the press of a button.
### Keybinds
## Keybinds
This module exposes two keybinds:
- `core.pivot.toggle-list-type` (default binding: `<LocalLeader>lt` ["list toggle"]) - takes a
This module exposes the following keybinds (see [`core.keybinds`](@core.keybinds) for instructions on
mapping them):
- `neorg.pivot.list.toggle` (default binding: `<LocalLeader>lt` ["list toggle"]) - takes a
list and, based on the opposite type of the first list item, inverts all the other items in that list.
Does not respect mixed lists, all items in the list will be converted to the same type.
- `core.pivot.invert-list-type` (default binding: `<LocalLeader>li` ["list invert"]) - same behaviour as
- `neorg.pivot.list.invert` (default binding: `<LocalLeader>li` ["list invert"]) - same behaviour as
the previous keybind, however respects mixed lists - unordered items will become ordered, whereas ordered
items will become unordered.
--]]
Expand Down
14 changes: 12 additions & 2 deletions lua/neorg/modules/core/presenter/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@ To set it up, first be sure to set the `zen_mode` variable in the [configuration
Afterwards, run `:Neorg presenter start` on any Norg file. The presenter will split up your file
at each level 1 heading, and display each in a different slide.
NOTE: This module is due for a rewrite. All of its behaviour is not fully documented here as it will be
overwritten soon anyway.
NOTE: This module is due for a rewrite. All of its behaviour is not fully documented here as it will
be overwritten soon anyway.
## Keybinds
This module exposes the following keybinds (see [`core.keybinds`](@core.keybinds) for instructions on
mapping them):
- `neorg.presenter.next-page` - go to next page
- `neorg.presenter.previous-page` - go to previous page
- `neorg.presenter.close` - close presentation view
--]]

local neorg = require("neorg.core")
Expand Down
13 changes: 13 additions & 0 deletions lua/neorg/modules/core/promo/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ In insert mode, you are also provided with two keybinds, also being Neovim defau
- `<C-d>` decrease the indentation level for the current object
This module is commonly used with the [`core.itero`](@core.itero) module for an effective workflow.
## Keybinds
This module exposes the following keybinds (see [`core.keybinds`](@core.keybinds) for instructions on
mapping them):
- `neorg.promo.promote` - Promote item on current line
- `neorg.promo.promote.nested` - Promote current line and nested items
- `neorg.promo.promote.range` - Promote all items in range
- `neorg.promo.demote` - similar
- `neorg.promo.demote.nested` - similar
- `neorg.promo.demote.range` - similar
--]]

local neorg = require("neorg.core")
Expand Down
2 changes: 1 addition & 1 deletion lua/neorg/modules/core/qol/todo_items/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This module handles the whole concept of toggling TODO items, as well as updating
parent and/or children items alongside the current item.
The following keybinds are exposed:
The following keybinds are exposed (with their default binds):
- `<Plug>(neorg.qol.todo-items.todo.task-done)` (`<LocalLeader>td`)
- `<Plug>(neorg.qol.todo-items.todo.task-undone)` (`<LocalLeader>tu`)
- `<Plug>(neorg.qol.todo-items.todo.task-pending)` (`<LocalLeader>tp`)
Expand Down
8 changes: 8 additions & 0 deletions lua/neorg/modules/core/tempus/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
`core.tempus` is an internal module specifically designed
to handle complex dates. It exposes two functions: `parse_date(string) -> date|string`
and `to_lua_date(date) -> osdate`.
## Keybinds
This module exposes the following keybinds (see [`core.keybinds`](@core.keybinds) for instructions on
mapping them):
- `neorg.tempus.insert-date` - Insert date at cursor position (called from normal mode)
- `neorg.tempus.insert-date.insert-mode` - Insert date at cursor position (called from insert mode)
--]]

local neorg = require("neorg.core")
Expand Down

0 comments on commit 735f27a

Please sign in to comment.