1
0

luadev.lua 409 B

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