From 18bf3656af3e5cb7bb6813c7dac0241d2e67cd4e Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Fri, 15 Jul 2022 06:54:29 +0100 Subject: [PATCH] Fix cmp for latex This stops cmp from using buffer complete in tex files. I find it is more of a hinderance than a help --- after/ftplugin/tex.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 after/ftplugin/tex.lua diff --git a/after/ftplugin/tex.lua b/after/ftplugin/tex.lua new file mode 100644 index 0000000..05d8670 --- /dev/null +++ b/after/ftplugin/tex.lua @@ -0,0 +1,22 @@ +-- stop suggesting buffer contents when writing prose +local ok,cmp = pcall(require,"cmp") +if not ok then + return +end + +local sources = cmp.get_config().sources + +for i = #sources, 1, -1 do + if sources[i].name == 'buffer' then + table.remove(sources,i) + end +end +cmp.setup.buffer({ sources = sources}) + +-- set syntax and spell + +vim.opt.spell = true +vim.opt.foldmarker = '(fold),(end)' +vim.opt.foldclose = 'all' +vim.opt.foldmethod = 'marker' +vim.opt.foldenable = true