-- get only the currently used buffer in the current window and set the options for it local winid = vim.api.nvim_get_current_win() local wo = vim.wo[winid][0] wo.spell = true vim.cmd.highlight({ "SpellBad", "gui=undercurl", "guifg=#DA6464" })