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
|
|
|
|
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
|
|
|
|
require('which-key').register {
|
|
|
|
['<leader>n'] = { name = '[N]eorg', _ = 'which_key_ignore' },
|
|
|
|
['<leader>m'] = { name = 'neorg [M]ode', _ = 'which_key_ignore' },
|
|
|
|
['<leader>l'] = { name = 'neorg [L]ist', _ = 'which_key_ignore' },
|
2024-03-25 10:29:22 +00:00
|
|
|
['<leader>ne'] = { name = '[N]eorg [E]xport', _ = 'which_key_ignore' },
|
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" })
|
2023-12-24 11:32:39 +00:00
|
|
|
|
|
|
|
local neorg = require('neorg')
|
|
|
|
|
|
|
|
neorg.setup {
|
|
|
|
load = {
|
|
|
|
["core.defaults"] = {},
|
|
|
|
["core.concealer"] = {
|
|
|
|
config = {
|
|
|
|
icon_preset = "diamond",
|
|
|
|
}
|
|
|
|
},
|
|
|
|
["core.dirman"] = {
|
|
|
|
config = {
|
|
|
|
workspaces = {
|
|
|
|
notes = "~/Sync/neorg",
|
|
|
|
},
|
|
|
|
default_workspace = "notes",
|
|
|
|
}
|
|
|
|
},
|
|
|
|
["core.export"] = {
|
|
|
|
config = {
|
|
|
|
export_dir = "<export-dir>/<language>",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
["core.esupports.metagen"] = {
|
|
|
|
config = {
|
|
|
|
type = "empty",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2023-12-24 16:00:11 +00:00
|
|
|
|
2023-12-24 11:32:39 +00:00
|
|
|
-- Use custom name for the author field in metadata instead of the system
|
|
|
|
-- username
|
|
|
|
neorg.utils.get_username = function()
|
|
|
|
return "Chouhartem"
|
|
|
|
end
|