mutton + cmdline + headings + new name of nvim

This commit is contained in:
2025-03-07 19:23:02 +03:00
parent ad70695803
commit 3ffda93c33
8 changed files with 88 additions and 88 deletions

30
lua/config/mutton.lua Normal file
View File

@ -0,0 +1,30 @@
-- Для Mutton
local normal_bg = vim.fn.synIDattr(vim.fn.hlID("Normal"), "bg")
vim.api.nvim_set_hl(0, "EndOfBuffer", { fg = normal_bg} ) -- overrides `~` character at the end of buffer
vim.api.nvim_set_hl(0, "VertSplit", { fg = normal_bg} ) -- overrides `~` character at the end of buffer
vim.api.nvim_set_hl(0, "WinSeparator", { fg = normal_bg })
local mutton = false
local function on_buf_read()
vim.defer_fn(function()
local buf_name = vim.api.nvim_buf_get_name(0) -- Получаем имя файла
if buf_name:match("%.md$") and mutton == false then -- Проверяем, заканчивается ли имя на ".md"
mutton = true
vim.cmd("MuttonToggle")
elseif buf_name:match("NvimTree_1$") then
elseif buf_name:match("%[%[Mutton%]%]$") then
elseif buf_name:match("/usr/bin/sh$") then
elseif mutton == true and not buf_name:match("%.md$") then
mutton = false
vim.cmd("MuttonToggle")
end
end, 100)
end
vim.api.nvim_create_autocmd("BufEnter", { callback = on_buf_read })