简体   繁体   中英

Correct cursor position in Vim

Consider this situation:

    foo
A   B

I just entered "foo" (notice the indent) and moved to the next line. The cursors is in position B. I'm done with editing and I hit Esc which brings my cursor to position A. How can I exit the insertion mode and keep the cursor at position B, or jump immedietly from A to B?

This vim's behavior is annoying when I'm editing something deep in a function, with few indents.

If you're at the end of the document, o will put you into insert mode at the correct indent level on the next line down. If you're on a row that contains nothing but a newline, cc will erase anything in the line and put you into insert mode at the correct indent level.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM