From d14dd1a040ea8cf73d8665ac3d1fd022069c3a87 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 21 Feb 2025 01:05:32 +0100 Subject: [PATCH] Disable spellcapcheck on non .md files --- nvim/lua/settings.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index 6672b74..dda3239 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -42,6 +42,16 @@ vim.opt.pumheight = 15 vim.opt.spelloptions = { "camel", "noplainbuffer" } vim.opt.spelllang = { "en", "cjk", } vim.opt.spell = true +vim.api.nvim_create_autocmd("FileType", { + desc = "Disable spellcapcheck", + group = vim.api.nvim_create_augroup("spell-cap-check", { clear = true }), + callback = function(evt) + if evt.file:match(".*%.md") or evt.file:match(".*%.ltex") then + return + end + vim.opt_local.spellcapcheck = "" + end, +}) -- Can't specify this in wordmotion's config due to race conditions vim.g.wordmotion_nomap = true