I am aware of {and } to navigate between blocks of texts , however these jump to blank lines in between blocks of text.

When there are several blank lines in between 2 blocks of text these do not work symmetrically either.

How can I jump to the first character of the first line of the next/previous block of text , for example the 'B's in the following example:

enter image description here


You can use a search and include \ns to match end of lines. Two of them in a row would match a blank line. You can then use \s*\S to find the first non-blank character of a line (and ensure you're matching a line with a non-blank character) and use \zs to control the start of the match (match that first non-blank character only and none of the spaces.)


You might want to include a special case to match the first non-blank character of the buffer, which you can do with:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.