I want to know how to do some operations on highlighted lines (with v operator) like providing tab to selected line, comment those line, etc. using vi/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.
Most standard operations that require a motion also work in visual mode, so if you select something in one of the visual modes (v, shift-v or ctrl-v), you can indent a line with the
>key, comment those lines by pressing:s@^@# @(which will show:'<,'>s@^@# @on the command line as the visual range is entered automatically).Another way of commenting out blocks is to select them with the column visual select (ctrl-v) and press
Ito insert at the start of the line.There are also a couple of plugins here and here that help with commenting. If you want any more specific information, please can you make your question a bit more detailed as it’s difficult to tell what you really want at the moment.