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 require('lualine').hide() vim.cmd('Limelight') if vim.fn.exists('g:gui_vimr') == 1 then vim.cmd('VimRToggleFullscreen') end 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 require('lualine').hide({ unhide = true }) vim.opt.laststatus = 3 vim.cmd('Limelight!') if vim.fn.exists('g:gui_vimr') == 1 then vim.cmd('VimRToggleFullscreen') end 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, }, }