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?

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

1 Answer 1


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

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

Your Answer

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

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