11

I am very fond of Vim's :terminal, though whenever I use Ctrl-w (expecting to erase the last typed word at prompt), Vim captures the key press and enters pane navigation mode. So I end up having to esc and then perform multiple backspaces. This wastes precious milliseconds of life.

I tried Ctrl-Backspace (default behavior in many GUIs) and also nothing. What could be a workaround?

2
  • 2
    Does this answer your question? How to move the cursor out of the terminal
    – Mass
    Apr 3, 2020 at 19:58
  • 2
    Absolutely not. It is easy to Ctrl-W and get out of terminal. I want the opposite. I want to stay at the terminal and to have the last word erased as this would happen in any other terminal.
    – fde-capu
    Apr 3, 2020 at 23:11

2 Answers 2

6

To send the original keystroke, you can use <C-w>. (note the period).

That said, I too find it annoying to have to remember.

Useful reference: https://vimhelp.org/terminal.txt.html#terminal-typing

0
12

You can set 'termwinkey' to a sequence other than <C-W> to use a different keystroke to access the special sequences on the terminal.

For example:

set termwinkey=<C-X>

Or:

set termwinkey=<F1>

See also :help terminal-typing.

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.