Add autocmd for neorg files

This commit is contained in:
Fabrice Mouhartem 2023-12-24 16:55:49 +01:00
parent 0e8587b461
commit c506a7ea78

View File

@ -1,6 +1,15 @@
--vim.api.nvim_set_keymap('', 'à', '<Nop>', { noremap = true, silent = true }) --vim.api.nvim_set_keymap('', 'à', '<Nop>', { noremap = true, silent = true })
vim.g.maplocalleader=',' local neorgroup = vim.api.nvim_create_augroup("neorg", { clear = true })
vim.api.nvim_create_autocmd({"FileType"}, {
pattern = {"norg"},
group = neorgroup,
callback = function()
vim.g.maplocalleader=' '
vim.o.conceallevel=2 vim.o.conceallevel=2
vim.api.nvim_set_keymap("n", "<Leader>nr", ":Neorg return<CR>", {noremap = true, silent = true, desc = "[N]eorg [R]eturn"})
end,
})
vim.api.nvim_set_keymap("n", "<Leader>ni", ":Neorg index<CR>", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "<Leader>ni", ":Neorg index<CR>", {noremap = true, silent = true})
vim.api.nvim_set_keymap("n", "<Leader>nm", ":Neorg inject-metadata<CR>", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "<Leader>nm", ":Neorg inject-metadata<CR>", {noremap = true, silent = true})