I give you an Example on how i do Lua Syntaxhighlightning for my own *.luado
files.
Before i have copied ( as super Q User: root.root ) /usr/share/nvim/runtime/syntax/lua.vim
to /usr/share/nvim/runtime/syntax/luado.vim
.
So i can change it independently from original lua.vim
.
It is not necessary to change luado.vim
for the Example below.
~/.config/nvim/lua/init.lua
required by ~/.config/nvim/init.vim
( At First and off course before: syntax on
)
--[[ Automatic Execution of Lua Oneliner if file extension *.luado
With Lua Syntaxhighlighting ]]
vim.api.nvim_create_autocmd({"BufEnter"},{
pattern = {"*.luado"},
command = "luado vim.api.nvim_command('setfiletype luado') load(line, 'koys_nvim_auto_luado')()"
})
Triggers at "BufEnter" and shows that "BufNewFile", "BufRead" not really needed.
( Every time before it is shown from Buffer ;-) )
Impression

Now lets change to next Buffer with :bn
to test3.luado

And back with :bp
to test2.luado (Output of set
)

(test2.luado will be shown after ENTER/RETURN)