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
    Aug 8 at 12:04
  • 1
    :h nvim_replace_termcodes()
    – Matt
    Aug 8 at 14:58

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, privacy policy and cookie policy

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