add autocmd for disabling nvim-cmp

i hope this all goes well. studying isnt easy
This commit is contained in:
Lucas Barbieri 2024-01-12 16:59:29 -03:00
parent e88b2b26cb
commit f15b50ce58
2 changed files with 11 additions and 4 deletions

View File

@ -2,8 +2,7 @@ return {
"mattn/emmet-vim", "mattn/emmet-vim",
config = function() config = function()
local autocmd = vim.api.nvim_create_autocmd local autocmd = vim.api.nvim_create_autocmd
autocmd("FileType", { pattern = "html", command = [[EmmetInstall]] }) autocmd("FileType", { pattern = { "html", "css" }, command = [[EmmetInstall]] })
autocmd("FileType", { pattern = "css", command = [[EmmetInstall]] })
vim.keymap.set("n", "<leader>le", function() vim.keymap.set("n", "<leader>le", function()
vim.cmd(string.format("Emmet %s", vim.fn.input("Emmet: "))) vim.cmd(string.format("Emmet %s", vim.fn.input("Emmet: ")))

View File

@ -30,8 +30,16 @@ vim.opt.updatetime = 50
vim.opt.colorcolumn = "80" vim.opt.colorcolumn = "80"
vim.cmd [[highlight ColorColumn ctermbg=235 guibg=#262626]] vim.cmd [[highlight ColorColumn ctermbg=235 guibg=#262626]]
vim.api.nvim_create_autocmd({ "WinLeave" }, { pattern = "*", callback = function() vim.opt.colorcolumn = "0" end, }) local autocmd = vim.api.nvim_create_autocmd
vim.api.nvim_create_autocmd({ "WinEnter" }, { pattern = "*", callback = function() vim.opt.colorcolumn = "80" end, }) autocmd({ "WinLeave" }, { pattern = "*", callback = function() vim.opt.colorcolumn = "0" end, })
autocmd({ "WinEnter" }, { pattern = "*", callback = function() vim.opt.colorcolumn = "80" end, })
autocmd({ "BufReadPre", "BufEnter", "BufRead", "BufNewFile" },
{
pattern = { "*.neorg", "*.md" },
callback = function()
require("cmp").setup.buffer({ enabled = false })
end
})
vim.g.mapleader = " " vim.g.mapleader = " "