vim.keymap.set('n', 'r', '(Luadev-Run)', opts) vim.keymap.set('v', 'r', '(Luadev-Run)', opts) vim.defer_fn(function() -- set buffer to lua vim.bo.filetype = 'lua' vim.fn.append(0, '-- r to run a block of code') vim.fn.append(1, 'print("hello")') -- open output console vim.cmd('Luadev') end, 100)