dotfiles/home/private_dot_config/nvim/lua/config/autocmds.lua

43 lines
1.2 KiB
Lua
Raw Normal View History

2023-02-10 09:24:29 -06:00
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here
2023-05-16 15:52:02 -05:00
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "Knitfile" },
command = "set syntax=lua",
})
2023-09-08 10:39:13 -05:00
2023-10-09 12:34:34 -05:00
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
2024-06-13 13:22:15 -05:00
pattern = { "*.md" },
command = "set conceallevel=0",
2023-10-09 12:34:34 -05:00
})
-- make .roc files have the correct filetype
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.roc" },
command = "set filetype=roc",
})
2025-01-06 14:51:50 -06:00
-- if cspell config found then disable buitlin spell check
vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
pattern = "*",
callback = function()
-- this isn't exhuastive and won't work if config is contained in a package.json
local cspell_files = {
"cspell.json",
".cspell.json",
"cSpell.json",
".cSpell.json",
".cspell.config.json",
"cpsell.config.yaml",
".cpsell.config.yaml"
}
for _, file in ipairs(cspell_files) do
if vim.fn.findfile(file, ".;") ~= "" then
vim.opt_local.spell = false
break
end
end
end
})