Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I am editing a C program using Vim. How do I jump to the beginning or end of a code block from within the block?

0
Posted

I am editing a C program using Vim. How do I jump to the beginning or end of a code block from within the block?

0

‘[{‘ command to jump to the beginning of the code block and ‘]} to jump to the end of the code block from inside the block. For more information, read :help [{ :help ]} :help various-motions 27.7. Is there a way to turn off the “//” comment auto-insertion behavior for C++ files? If I’m sitting on a line beginning with “//”, then I open a new line above or below it, Vim automatically inserts new “//” chars. You can modify the value of the ‘comments’ option to stop Vim from inserting the C++ comment character (“//”) automatically. For example: :set comments=sr:/*,mb:*,el:*/ For more information, read :help ‘comments’ :help format-comments 27.8. How do I add the comment character ‘#’ to a set of lines at the beginning of each line? First, select the first character in all the lines using visual block mode (CTRL-V). Press ‘I’ to start inserting characters at the beginning of the line. Enter the comment character and then stop the insert mode by pressing . Vim will automatically insert

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123