junegunn / goyo.vim

:tulip: Distraction-free writing in Vim
MIT License
4.49k stars 115 forks source link

Fix to syntax highlighting breaking (in lua) #269

Open gaoDean opened 1 year ago

gaoDean commented 1 year ago

I dunno if this has been said before, but I'll just put it here: When GoyoLeave, check for filetype and source the syntax file (this can be converted to vimscript)

function au(evt, pat, cmd) -- (string|table), (string|table), (string)
    vim.api.nvim_create_autocmd(evt, { pattern = pat, command = cmd, })
end

au("User", "GoyoLeave", [[if &filetype == "markdown" | source /Users/deangao/.config/nvim/syntax/markdown.vim | endif]])
au("User", "GoyoLeave", [[if &filetype == "nroff" | source /Users/deangao/.config/nvim/syntax/nroff.vim | endif]])