Compare commits

..

No commits in common. "d0cbb36a444e05fd147f2bdd6bd2572ef846c38b" and "4f45e8902530f7e49cb246e1e1140f915785a086" have entirely different histories.

View File

@ -1,4 +1,4 @@
--vim.keymap.set('', 'à', '<Nop>', { noremap = true, silent = true }) --vim.api.nvim_set_keymap('', 'à', '<Nop>', { noremap = true, silent = true })
local neorgroup = vim.api.nvim_create_augroup("neorg", { clear = true }) local neorgroup = vim.api.nvim_create_augroup("neorg", { clear = true })
vim.api.nvim_create_autocmd({ "FileType" }, { vim.api.nvim_create_autocmd({ "FileType" }, {
@ -8,41 +8,34 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
vim.o.conceallevel = 2 vim.o.conceallevel = 2
vim.o.foldlevelstart = 99 vim.o.foldlevelstart = 99
vim.keymap.set("n", "<Leader>nr", ":Neorg return<CR>", vim.api.nvim_set_keymap("n", "<Leader>nr", ":Neorg return<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [R]eturn" }) { noremap = true, silent = true, desc = "[N]eorg [R]eturn" })
-- Neorg Telescope -- Neorg Telescope
vim.keymap.set("n", "<Leader>nh", "<Plug>(neorg.telescope.search_headings)", vim.api.nvim_set_keymap("n", "<Leader>nh", "<Plug>(neorg.telescope.search_headings)",
{ noremap = true, silent = true, desc = "[N]eorg search [H]eading" }) { noremap = true, silent = true, desc = "[N]eorg search [H]eading" })
vim.keymap.set("n", "<Leader>nb", "<Plug>(neorg.telescope.backlinks.file_backlinks)", vim.api.nvim_set_keymap("n", "<Leader>nb", "<Plug>(neorg.telescope.backlinks.file_backlinks)",
{ noremap = true, silent = true, desc = "[N]eorg file [B]acklinks" }) { noremap = true, silent = true, desc = "[N]eorg file [B]acklinks" })
vim.keymap.set("n", "<C-l>", "<Plug>(neorg.telescope.insert_link)", vim.api.nvim_set_keymap("n", "<C-l>", "<Plug>(neorg.telescope.insert_link)",
{ noremap = true, silent = true, desc = "Neorg insert [L]ink" }) { noremap = true, silent = true, desc = "Neorg insert [L]ink" })
-- Tasks -- Tasks
vim.keymap.set("n", "<LocalLeader>td", "<Plug>(neorg.qol.todo-items.todo.task-done)", vim.api.nvim_set_keymap("n", "<LocalLeader>td", "<Plug>(neorg.qol.todo-items.todo.task-done)",
{ noremap = true, silent = true, desc = "[T]ask [D]one" }) { noremap = true, silent = true, desc = "[T]ask [D]one" })
vim.keymap.set("n", "<LocalLeader>tu", "<Plug>(neorg.qol.todo-items.todo.task-undone)", vim.api.nvim_set_keymap("n", "<LocalLeader>tu", "<Plug>(neorg.qol.todo-items.todo.task-undone)",
{ noremap = true, silent = true, desc = "[T]ask [U]ndone" }) { noremap = true, silent = true, desc = "[T]ask [U]ndone" })
vim.keymap.set("n", "<LocalLeader>tp", "<Plug>(neorg.qol.todo-items.todo.task-pending)", vim.api.nvim_set_keymap("n", "<LocalLeader>tp", "<Plug>(neorg.qol.todo-items.todo.task-pending)",
{ noremap = true, silent = true, desc = "[T]ask [P]ending" }) { noremap = true, silent = true, desc = "[T]ask [P]ending" })
vim.keymap.set("n", "<LocalLeader>th", "<Plug>(neorg.qol.todo-items.todo.task-on_hold)", vim.api.nvim_set_keymap("n", "<LocalLeader>th", "<Plug>(neorg.qol.todo-items.todo.task-on_hold)",
{ noremap = true, silent = true, desc = "[T]ask on [H]old" }) { noremap = true, silent = true, desc = "[T]ask on [H]old" })
vim.keymap.set("n", "<LocalLeader>tc", "<Plug>(neorg.qol.todo-items.todo.task-cancelled)", vim.api.nvim_set_keymap("n", "<LocalLeader>tc", "<Plug>(neorg.qol.todo-items.todo.task-cancelled)",
{ noremap = true, silent = true, desc = "[T]ask on [C]ancelled" }) { noremap = true, silent = true, desc = "[T]ask on [C]ancelled" })
vim.keymap.set("n", "<LocalLeader>tr", "<Plug>(neorg.qol.todo-items.todo.task-recurring)", vim.api.nvim_set_keymap("n", "<LocalLeader>tr", "<Plug>(neorg.qol.todo-items.todo.task-recurring)",
{ noremap = true, silent = true, desc = "[T]ask on [R]ecurring" }) { noremap = true, silent = true, desc = "[T]ask on [R]ecurring" })
vim.keymap.set("n", "<LocalLeader>ti", "<Plug>(neorg.qol.todo-items.todo.task-important)", vim.api.nvim_set_keymap("n", "<LocalLeader>ti", "<Plug>(neorg.qol.todo-items.todo.task-important)",
{ noremap = true, silent = true, desc = "[T]ask on [I]mportant" }) { noremap = true, silent = true, desc = "[T]ask on [I]mportant" })
end, end,
}) })
local function live_grep_neorg()
local neorg_root = '~/Sync/neorg' -- TODO: get it from neorg
require('telescope.builtin').live_grep {
cwd = neorg_root,
}
end
-- document existing key chains -- document existing key chains
require('which-key').add { require('which-key').add {
{ "<leader>l", group = "neorg [L]ist" }, { "<leader>l", group = "neorg [L]ist" },
@ -54,27 +47,25 @@ require('which-key').add {
{ "<leader>ne_", hidden = true }, { "<leader>ne_", hidden = true },
} }
vim.keymap.set("n", "<Leader>ni", ":Neorg index<CR>", vim.api.nvim_set_keymap("n", "<Leader>ni", ":Neorg index<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [I]ndex" }) { noremap = true, silent = true, desc = "[N]eorg [I]ndex" })
vim.keymap.set("n", "<Leader>nm", ":Neorg inject-metadata<CR>", vim.api.nvim_set_keymap("n", "<Leader>nm", ":Neorg inject-metadata<CR>",
{ noremap = true, silent = true, desc = "[N]eorg insert [M]etadata" }) { noremap = true, silent = true, desc = "[N]eorg insert [M]etadata" })
vim.keymap.set("n", "<Leader>nj", ":Neorg journal toc open<CR>", vim.api.nvim_set_keymap("n", "<Leader>nj", ":Neorg journal toc open<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [J]ournal" }) { noremap = true, silent = true, desc = "[N]eorg [J]ournal" })
vim.keymap.set("n", "<Leader>nt", ":Neorg journal today<CR>", vim.api.nvim_set_keymap("n", "<Leader>nt", ":Neorg journal today<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [T]oday" }) { noremap = true, silent = true, desc = "[N]eorg [T]oday" })
vim.keymap.set("n", "<Leader>ns", ":Neorg journal tomorrow<CR>", vim.api.nvim_set_keymap("n", "<Leader>ns", ":Neorg journal tomorrow<CR>",
{ noremap = true, silent = true, desc = "Neorg tomorrow" }) { noremap = true, silent = true, desc = "Neorg tomorrow" })
vim.keymap.set("n", "<Leader>ny", ":Neorg journal yesterday<CR>", vim.api.nvim_set_keymap("n", "<Leader>ny", ":Neorg journal yesterday<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [Y]esterday" }) { noremap = true, silent = true, desc = "[N]eorg [Y]esterday" })
vim.keymap.set("n", "<Leader>neo", ":e /tmp/neorg-export.md<CR>", 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" }) { noremap = true, silent = true, desc = "[N]eorg [E]xport [O]pen" })
vim.keymap.set("n", "<Leader>nee", ":Neorg export to-file /tmp/neorg-export.md<CR>", 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" }) { noremap = true, silent = true, desc = "[N]eorg [E]xport Predefined" })
vim.keymap.set("n", "<Leader>nef", ":Neorg export to-file ", vim.api.nvim_set_keymap("n", "<Leader>nef", ":Neorg export to-file ",
{ noremap = true, silent = true, desc = "[N]eorg [E]xport [F]ile" }) { noremap = true, silent = true, desc = "[N]eorg [E]xport [F]ile" })
vim.keymap.set("n", "<Leader>nl", "<Plug>(neorg.telescope.find_linkable)", vim.api.nvim_set_keymap("n", "<Leader>nl", "<Plug>(neorg.telescope.find_linkable)",
{ noremap = true, silent = true, desc = "[N]eorg find [L]inkable" }) { noremap = true, silent = true, desc = "[N]eorg find [L]inkable" })
vim.keymap.set("n", "<Leader>nf", "<Plug>(neorg.telescope.find_norg_files)", vim.api.nvim_set_keymap("n", "<Leader>nf", "<Plug>(neorg.telescope.find_norg_files)",
{ noremap = true, silent = true, desc = "[N]eorg find [F]ile" }) { noremap = true, silent = true, desc = "[N]eorg find [F]ile" })
vim.keymap.set("n", "<Leader>n/", live_grep_neorg,
{ noremap = true, silent = true, desc = "[N]eorg Live Grep" })