1

If I want to move a cursor one line down with Lua in Neovim I can use

:lua vim.cmd('normal j')

How do I move the screen down one line? For example, this does not work:

:lua vim.cmd('normal \<C-E>')

How to use modifier keys like Ctrl, Shift, Alt etc in such Lua commands?

2
  • @D.BenKnoble single and double quotes in Lua are pretty much the same
    – dimus
    Aug 8, 2021 at 12:04
  • 1
    :h nvim_replace_termcodes()
    – Matt
    Aug 8, 2021 at 14:58

1 Answer 1

0

Using @Matt suggestion, something like this seems to work:

  local down = vim.api.nvim_replace_termcodes('normal <C-E>', true, false, true)
  vim.cmd(down)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.