27 lines
596 B
Lua
27 lines
596 B
Lua
local function augroup(name)
|
|
return vim.api.nvim_create_augroup("custom_ac_" .. name, { clear = true })
|
|
end
|
|
|
|
local goyo_enter = function()
|
|
vim.cmd("Limelight")
|
|
vim.cmd("PencilSoft")
|
|
require("lualine").hide()
|
|
end
|
|
|
|
vim.api.nvim_create_autocmd("User", {
|
|
pattern = "GoyoEnter",
|
|
callback = goyo_enter,
|
|
group = augroup("goyo_enter"),
|
|
})
|
|
|
|
local goyo_leave = function()
|
|
vim.cmd("Limelight!")
|
|
vim.cmd("NoPencil")
|
|
require("lualine").hide({ unhide = true })
|
|
end
|
|
|
|
vim.api.nvim_create_autocmd("User", {
|
|
pattern = "GoyoLeave",
|
|
callback = goyo_leave,
|
|
group = augroup("goyo_leave"),
|
|
})
|