How do you tab a block of code, to the right to the left, on Vim?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short Answer:
V select lines by ↓ and then >
and for 3 tabs:
V, 3 and then >
My favorite way is to select your block of code (with [V]isual line mode normally), then press > or If you want to tab more than once, 2> or 3> to repeat it.
If you didn’t tab enough (or tabbed too much) then type "gv" to reselect your selection and try again.
To move a block of code, select it with [V]isual line mode and then press "d". This is the "Cut" operation.
Then move your cursor to the place you want it to go, and press "p". This is the "Paste" operation.
You can also try auto-tabbing a block of code by selecting it with [V]isual line mode, and pressing "=".