nvim-config-kickstart/lua/neorg-configure.lua

73 lines
4.1 KiB
Lua
Raw Normal View History

2023-12-24 11:32:39 +00:00
--vim.api.nvim_set_keymap('', 'à', '<Nop>', { noremap = true, silent = true })
2023-12-24 15:55:49 +00:00
local neorgroup = vim.api.nvim_create_augroup("neorg", { clear = true })
2023-12-25 13:29:10 +00:00
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "norg" },
2023-12-24 15:55:49 +00:00
group = neorgroup,
callback = function()
2023-12-25 13:29:10 +00:00
vim.g.maplocalleader = ' '
vim.o.conceallevel = 2
2024-04-18 15:08:57 +00:00
vim.o.foldlevelstart = 99
2023-12-25 13:29:10 +00:00
vim.api.nvim_set_keymap("n", "<Leader>nr", ":Neorg return<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [R]eturn" })
2023-12-24 15:55:49 +00:00
end,
})
2023-12-24 11:32:39 +00:00
2024-02-29 12:03:33 +00:00
-- document existing key chains
2024-07-26 15:58:11 +00:00
require('which-key').add {
{ "<leader>l", group = "neorg [L]ist" },
{ "<leader>l_", hidden = true },
{ "<leader>m", group = "neorg [M]ode" },
{ "<leader>m_", hidden = true },
2024-09-11 09:00:12 +00:00
{ "<leader>t", group = "neorg [T]asks" },
2024-07-26 15:58:11 +00:00
{ "<leader>n", group = "[N]eorg" },
{ "<leader>n_", hidden = true },
{ "<leader>ne", group = "[N]eorg [E]xport" },
{ "<leader>ne_", hidden = true },
2024-02-29 12:03:33 +00:00
}
2023-12-25 13:29:10 +00:00
vim.api.nvim_set_keymap("n", "<Leader>ni", ":Neorg index<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [I]ndex" })
vim.api.nvim_set_keymap("n", "<Leader>nm", ":Neorg inject-metadata<CR>",
{ noremap = true, silent = true, desc = "[N]eorg insert [M]etadata" })
vim.api.nvim_set_keymap("n", "<Leader>nj", ":Neorg journal toc open<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [J]ournal" })
vim.api.nvim_set_keymap("n", "<Leader>nt", ":Neorg journal today<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [T]oday" })
vim.api.nvim_set_keymap("n", "<Leader>ns", ":Neorg journal tomorrow<CR>",
{ noremap = true, silent = true, desc = "Neorg tomorrow" })
vim.api.nvim_set_keymap("n", "<Leader>ny", ":Neorg journal yesterday<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [Y]esterday" })
2024-03-25 10:29:22 +00:00
vim.api.nvim_set_keymap("n", "<Leader>neo", ":e /tmp/neorg-export.md<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [E]xport [O]pen" })
vim.api.nvim_set_keymap("n", "<Leader>nee", ":Neorg export to-file /tmp/neorg-export.md<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [E]xport Predefined" })
vim.api.nvim_set_keymap("n", "<Leader>nef", ":Neorg export to-file ",
{ noremap = true, silent = true, desc = "[N]eorg [E]xport [F]ile" })
2024-11-11 08:48:41 +00:00
vim.api.nvim_set_keymap("n", "<Leader>nh", "<Plug>(neorg.telescope.search_headings)",
{ noremap = true, silent = true, desc = "[N]eorg search [H]eading" })
vim.api.nvim_set_keymap("n", "<Leader>nl", "<Plug>(neorg.telescope.find_linkable)",
{ noremap = true, silent = true, desc = "[N]eorg find [L]inkable" })
vim.api.nvim_set_keymap("n", "<Leader>nf", "<Plug>(neorg.telescope.find_norg_files)",
{ noremap = true, silent = true, desc = "[N]eorg find [F]ile" })
vim.api.nvim_set_keymap("n", "<Leader>nb", "<Plug>(neorg.telescope.backlinks.file_backlinks)",
{ noremap = true, silent = true, desc = "[N]eorg file [B]acklinks" })
vim.api.nvim_set_keymap("n", "<C-l>", "<Plug>(neorg.telescope.insert_link)",
{ noremap = true, silent = true, desc = "Neorg insert [L]ink" })
2024-09-11 09:00:12 +00:00
-- Tasks
vim.api.nvim_set_keymap("n", "<LocalLeader>td", "<Plug>(neorg.qol.todo-items.todo.task-done)",
2024-11-10 14:38:47 +00:00
{ noremap = true, silent = true, desc = "[T]ask [D]one" })
2024-09-11 09:00:12 +00:00
vim.api.nvim_set_keymap("n", "<LocalLeader>tu", "<Plug>(neorg.qol.todo-items.todo.task-undone)",
2024-11-10 14:38:47 +00:00
{ noremap = true, silent = true, desc = "[T]ask [U]ndone" })
2024-09-11 09:00:12 +00:00
vim.api.nvim_set_keymap("n", "<LocalLeader>tp", "<Plug>(neorg.qol.todo-items.todo.task-pending)",
2024-11-10 14:38:47 +00:00
{ noremap = true, silent = true, desc = "[T]ask [P]ending" })
2024-09-11 09:00:12 +00:00
vim.api.nvim_set_keymap("n", "<LocalLeader>th", "<Plug>(neorg.qol.todo-items.todo.task-on_hold)",
2024-11-10 14:38:47 +00:00
{ noremap = true, silent = true, desc = "[T]ask on [H]old" })
2024-09-11 09:00:12 +00:00
vim.api.nvim_set_keymap("n", "<LocalLeader>tc", "<Plug>(neorg.qol.todo-items.todo.task-cancelled)",
2024-11-10 14:38:47 +00:00
{ noremap = true, silent = true, desc = "[T]ask on [C]ancelled" })
2024-09-11 09:00:12 +00:00
vim.api.nvim_set_keymap("n", "<LocalLeader>tr", "<Plug>(neorg.qol.todo-items.todo.task-recurring)",
2024-11-10 14:38:47 +00:00
{ noremap = true, silent = true, desc = "[T]ask on [R]ecurring" })
2024-09-11 09:00:12 +00:00
vim.api.nvim_set_keymap("n", "<LocalLeader>ti", "<Plug>(neorg.qol.todo-items.todo.task-important)",
2024-11-10 14:38:47 +00:00
{ noremap = true, silent = true, desc = "[T]ask on [I]mportant" })