Skip to main content
1 of 6
Thunderbeef
  • 507
  • 4
  • 13

First of all, you most likely need to use chansend() function. I don't have term_sendkeys() in my neovim instance, so it's probably from some plugin. Also, the i is unnecessary, since this function can't put you into insert mode.

Now, regarding your problem. I managed to work around it like this:

  1. Open vim preemptively to not get error on load.
  2. While in terminal, start by writing echo -n '' >> ~/.vimrc, then put cursor between quotes and press control-v followed by Up, then enter to execute your command.
  3. Reload .vimrc with :e!, delete the last line with literal Up sequence, and p it wherever you want (in this case, into chansend function).

This seem to work correctly:

call chansend(b:terminal_job_id, '^[OA' . "\<cr>")

Do not try to copy code from here, though. You need to get actual literal Up sequence from your shell.

Thunderbeef
  • 507
  • 4
  • 13