Vim pushes a block of code in and out

I am using mvim. I am trying to display keys so that I can visually select elements, then I could indent the code in or out. However, when performing external work, after each keystroke, another line is selected below. What is the fix.

" Ctrl-x - move the block of visually selected code one tab right and keep visual mode alive " Ctrl-z moves the data in opposite direction " Usage : shift v and select multiple lines. then Ctrl x multiple times and " then Ctrl z multiple times vmap <Cx> >gv vmap <Cz> <gv 
+7
vim macvim
source share
1 answer

Why do you have to think when you can already do this?

>> - increase the indent of the selected block

<< - decrease the indent of the selected block

This will result in loss of focus. If you want to continue the indentation, just enter . to repeat the last action. You can also enter g v to reselect your last choice.

Another option is to select and enter a number before the indentation, which is the same as repeating >> or << as many times as the number you entered.

+16
source share

All Articles