I am trying to highlight multiple lines that match between two words which are present on two different lines.
1.Todo: used for the todo comments (ones that have "TODO: something" in them)
2.Comment: indicates a code comment.
3.Statement: a code statement like a for loop
4.Type: a user defined type generally
5.PreProc: a pre-processor statement like #include <stdio.h>
To highlight between todo and something on single line we use /todo.*something
but to highlight between todo and stdio(which is present on 5th line) is there any command.
Thanks.
If you want to select the entire line in a file, press V. Now when you press k or j to go up and down, vim will select the entire line above and below your cursor. Finally, you can select text in columns by pressing ctrl+v and moving up or down the block.
Manipulate multiple lines of text Press Shift+V to enter line mode. The words VISUAL LINE will appear at the bottom of the screen. Use navigation commands, such as the Arrow keys, to highlight multiple lines of text.
you can make use \_.
to include linebreaks. For the example todo ... stdio
, you can try:
/todo\_.\{-}stdio
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With