luadev.lua 346 B

1234567891011
  1. vim.keymap.set('n', '<Leader>r', '<Plug>(Luadev-Run)', opts)
  2. vim.keymap.set('v', '<Leader>r', '<Plug>(Luadev-Run)', opts)
  3. vim.defer_fn(function()
  4. -- set buffer to lua
  5. vim.bo.filetype = 'lua'
  6. vim.fn.append(0, '-- <Leader>r to run a block of code')
  7. vim.fn.append(1, 'print("hello")')
  8. -- open output console
  9. vim.cmd('Luadev')
  10. end, 100)