简体   繁体   中英

Vim: how to stay in visual mode after executing a command

Using vim, I'd like to make a selection of lines and then perform a series of operations on them. The problem is that with each op vim exits visual mode and the lines have to be selected again. Any ideas? Thank you.

  • You can use gv to reselect the last selection quickly.

  • You can also use | to chain multiple commands. (See link to Vim Wiki .)

As far as I know there is no way to stay in Visual mode.

If you're having issues with indentation (eg selecting two lines), indent them and then having to reselect to indent again, it is quicker to use the . command to repeat the last command without having to reselect anything.

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