Skip to content

Commit

Permalink
feat: add descriptions to all Neorg keybinds
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Jul 13, 2024
1 parent 52be703 commit a042515
Showing 1 changed file with 36 additions and 15 deletions.
51 changes: 36 additions & 15 deletions lua/neorg/modules/core/keybinds/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,17 @@ module.public = {
}

module.private = {

-- TODO: Move these to the "vim" preset
-- { "gd", "<Plug>(neorg.esupports.hop.hop-link)", opts = { desc = "[neorg] Jump to Link" } },
-- { "gf", "<Plug>(neorg.esupports.hop.hop-link)", opts = { desc = "[neorg] Jump to Link" } },
-- { "gF", "<Plug>(neorg.esupports.hop.hop-link)", opts = { desc = "[neorg] Jump to Link" } },
presets = {
---@class neorg.keybinds.preset
neorg = {
all = {
n = {
-- Creates a new .norg file to take notes in
-- Create a new `.norg` file to take notes in
-- ^New Note
{
"<LocalLeader>nn",
Expand All @@ -148,71 +153,71 @@ module.private = {
},
norg = {
n = {
-- Marks the task under the cursor as "undone"
-- Mark the task under the cursor as "undone"
-- ^mark Task as Undone
{
"<LocalLeader>tu",
"<Plug>(neorg.qol.todo-items.todo.task-undone)",
opts = { desc = "[neorg] Mark as Undone" },
},

-- Marks the task under the cursor as "pending"
-- Mark the task under the cursor as "pending"
-- ^mark Task as Pending
{
"<LocalLeader>tp",
"<Plug>(neorg.qol.todo-items.todo.task-pending)",
opts = { desc = "[neorg] Mark as Pending" },
},

-- Marks the task under the cursor as "done"
-- Mark the task under the cursor as "done"
-- ^mark Task as Done
{
"<LocalLeader>td",
"<Plug>(neorg.qol.todo-items.todo.task-done)",
opts = { desc = "[neorg] Mark as Done" },
},

-- Marks the task under the cursor as "on-hold"
-- Mark the task under the cursor as "on-hold"
-- ^mark Task as on Hold
{
"<LocalLeader>th",
"<Plug>(neorg.qol.todo-items.todo.task-on-hold)",
opts = { desc = "[neorg] Mark as On Hold" },
},

-- Marks the task under the cursor as "cancelled"
-- Mark the task under the cursor as "cancelled"
-- ^mark Task as Cancelled
{
"<LocalLeader>tc",
"<Plug>(neorg.qol.todo-items.todo.task-cancelled)",
opts = { desc = "[neorg] Mark as Cancelled" },
},

-- Marks the task under the cursor as "recurring"
-- Mark the task under the cursor as "recurring"
-- ^mark Task as Recurring
{
"<LocalLeader>tr",
"<Plug>(neorg.qol.todo-items.todo.task-recurring)",
opts = { desc = "[neorg] Mark as Recurring" },
},

-- Marks the task under the cursor as "important"
-- Mark the task under the cursor as "important"
-- ^mark Task as Important
{
"<LocalLeader>ti",
"<Plug>(neorg.qol.todo-items.todo.task-important)",
opts = { desc = "[neorg] Mark as Important" },
},

-- Marks the task under the cursor as "ambiguous"
-- Mark the task under the cursor as "ambiguous"
-- ^mark Task as ambiguous
{
"<LocalLeader>ta",
"<Plug>(neorg.qol.todo-items.todo.task-ambiguous)",
opts = { desc = "[neorg] Mark as Ambigous" },
},

-- Switches the task under the cursor between a select few states
-- Switch the task under the cursor between a select few states
{
"<C-Space>",
"<Plug>(neorg.qol.todo-items.todo.task-cycle)",
Expand All @@ -221,51 +226,67 @@ module.private = {

-- Hop to the destination of the link under the cursor
{ "<CR>", "<Plug>(neorg.esupports.hop.hop-link)", opts = { desc = "[neorg] Jump to Link" } },
-- TODO: Move these to the "vim" preset
-- { "gd", "<Plug>(neorg.esupports.hop.hop-link)", opts = { desc = "[neorg] Jump to Link" } },
-- { "gf", "<Plug>(neorg.esupports.hop.hop-link)", opts = { desc = "[neorg] Jump to Link" } },
-- { "gF", "<Plug>(neorg.esupports.hop.hop-link)", opts = { desc = "[neorg] Jump to Link" } },

-- Same as `<CR>`, except opens the destination in a vertical split
-- Same as `<CR>`, except open the destination in a vertical split
{
"<M-CR>",
"<Plug>(neorg.esupports.hop.hop-link.vsplit)",
opts = { desc = "[neorg] Jump to Link (Vertical Split)" },
},

-- Promote an object non-recursively.
{ ">.", "<Plug>(neorg.promo.promote)", opts = { desc = "[neorg] Promote Object (Non-Recursively)" } },
-- Demote an object non-recursively.
{ "<,", "<Plug>(neorg.promo.demote)", opts = { desc = "[neorg] Demote Object (Non-Recursively)" } },

-- Promote an object recursively.
{
">>",
"<Plug>(neorg.promo.promote.nested)",
opts = { desc = "[neorg] Promote Object (Recursively)" },
},
-- Demote an object recursively.
{ "<<", "<Plug>(neorg.promo.demote.nested)", opts = { desc = "[neorg] Demote Object (Recursively)" } },

-- Toggle a list from ordered <-> unordered
-- ^List Toggle
{
"<LocalLeader>lt",
"<Plug>(neorg.pivot.list.toggle)",
opts = { desc = "[neorg] Toggle (Un)ordered List" },
},

-- Invert all items in a list.
-- Unlike `<LocalLeader>lt`, inverting a list will respect mixed list
-- items, instead of snapping all list types to a single one.
-- ^List Invert
{
"<LocalLeader>li",
"<Plug>(neorg.pivot.list.invert)",
opts = { desc = "[neorg] Invert (Un)ordered List" },
},

-- Insert a link to a date at the given position.
-- ^Insert Date
{ "<LocalLeader>id", "<Plug>(neorg.tempus.insert-date)", opts = { desc = "[neorg] Insert Date" } },
},

i = {
-- Promote an object recursively.
{ "<C-t>", "<Plug>(neorg.promo.promote)", opts = { desc = "[neorg] Promote Object (Recursively)" } },
-- Demote an object recursively.
{ "<C-d>", "<Plug>(neorg.promo.demote)", opts = { desc = "[neorg] Demote Object (Recursively)" } },
-- Create an iteration of e.g. a list item.
{ "<M-CR>", "<Plug>(neorg.itero.next-iteration)", opts = { desc = "[neorg] Continue Object" } },
-- Insert a link to a date at the current cursor position.
-- ^Date
{ "<M-d>", "<Plug>(neorg.tempus.insert-date-insert-mode)", opts = { desc = "[neorg] Insert Date" } },
},

v = {
-- Promote objects in range.
{ ">", "<Plug>(neorg.promo.promote.range)", opts = { desc = "[neorg] Promote Objects in Range" } },
-- Demote objects in range.
{ "<", "<Plug>(neorg.promo.demote.range)", opts = { desc = "[neorg] Demote Objects in Range" } },
},
}
Expand Down

0 comments on commit a042515

Please sign in to comment.