1

When editing a text file, p and I pastes what I copied and gets me to enter insert mode at the beginning of line.

But in terminal (executed by term bash) this not works.

p pastes somthing, but I or i enters insert mode at the end of line instead of the beginning.

How to get I works like in text file?

1 Answer 1

1

In Terminal mode Vim let the terminal manage the way input are managed. That is why hitting I merely switch from Normal mode to Terminal mode moves the cursor at the end of the line.

You could add the following mapping to mimic the behavior:

nnoremap <expr> I &bt≈='terminal' ? "I\<Home>" : 'I'

For the terminal buffer it maps I to I Home

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.