Add augroup to autocommand
This commit is contained in:
parent
6254bfe4d0
commit
6d26e62cee
@ -1,6 +1,9 @@
|
||||
local markdown = vim.api.nvim_create_augroup("markdown", { clear = true })
|
||||
|
||||
-- Recognize .md as pandoc
|
||||
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"*.md", },
|
||||
group = markdown,
|
||||
callback = function()
|
||||
vim.o.filetype = 'pandoc'
|
||||
vim.o.spell = true
|
||||
@ -15,6 +18,7 @@ vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
-- French markdown files
|
||||
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"*-fr.md", },
|
||||
group = markdown,
|
||||
callback = function()
|
||||
vim.o.spelllang = 'fr'
|
||||
end
|
||||
@ -23,6 +27,7 @@ vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
-- Spell shortcuts
|
||||
vim.api.nvim_create_autocmd({"OptionSet"}, {
|
||||
pattern = { "spell" },
|
||||
group = markdown,
|
||||
callback = function()
|
||||
if vim.o.spell == true then
|
||||
vim.keymap.set("n", "<Leader>i", "mz[s1z=`z", {noremap = true, silent = true})
|
||||
|
Loading…
Reference in New Issue
Block a user