you might be trying to write vimscript code in your lua file (init.lua).
Either write following to use vimscript: vim.cmd('set expandtab') vim.cmd('set tabstop=4')
or use lua: vim.opt.tabstop = 4 vim.opt.expandtab = true