return { { 'junegunn/goyo.vim', cond = function() return vim.fn.has('gui_running') == 1 end, dependencies = { { 'junegunn/limelight.vim', }, }, keys = { { 'z', 'Goyo', desc = 'Goyo' }, }, config = function() local goyo_enter = function() vim.opt.showmode = false vim.opt.showcmd = false vim.opt.scrolloff = 999 vim.opt.laststatus = 0 local gl = require('galaxyline') local gls = gl.section gls.left = {} gls.mid = {} gls.right = {} vim.cmd('Limelight') vim.cmd('VimRToggleFullscreen') end local goyo_leave = function() local function script_path() local str = debug.getinfo(2, 'S').source:sub(2) return str:match('(.*/)') or './' end vim.opt.showmode = true vim.opt.showcmd = true vim.opt.scrolloff = 5 dofile(script_path() .. '../config/galaxyline.lua') vim.opt.laststatus = 2 vim.cmd('Limelight!') vim.cmd('VimRToggleFullscreen') end local goyo_augroup = vim.api.nvim_create_augroup('Goyo', { clear = true }) vim.api.nvim_create_autocmd('User', { pattern = 'GoyoEnter', group = goyo_augroup, callback = goyo_enter, }) vim.api.nvim_create_autocmd('User', { pattern = 'GoyoLeave', group = goyo_augroup, callback = goyo_leave, }) end, }, }