Timeline for Advance to next non-blank line only if current line is not blank
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 5, 2021 at 17:02 | comment | added | markling | Ah yes, that's one more piece of the puzzle... well, perhaps a piece from a different puzzle. I'm struggling here. Range syntax differs between user commands and functions. I can handle a range in a user command; or I can do an if or a builtin in a function. But I can't do an if or a builtin in a user command, or a range in a function. Agh!!! | |
Dec 5, 2021 at 16:35 | comment | added | D. Ben Knoble♦ |
@markling line numbers are an ex command, so :execute nextnonblank(line('.') + 1) would work, for example.
|
|
Dec 5, 2021 at 15:46 | history | edited | Maxim Kim | CC BY-SA 4.0 |
added 386 characters in body
|
Dec 5, 2021 at 15:04 | comment | added | markling | To actually move to the next non-blank line then, would require replacing the '"echo getline(nextline)" in your example, to something like ':ex j . getline(nextline) . gg' ? (I'm grasping at straws here ... I hope you can complete the exercise ... getting to that line!) | |
Dec 5, 2021 at 14:55 | comment | added | markling | Aha. Muchos thanks. So how would you do that? \ continuation chars? | pipes? It's beginning to look like it might be easier to use a function. I was hoping to avoid that. | |
Dec 5, 2021 at 14:44 | comment | added | Maxim Kim | @markling sure it can | |
Dec 5, 2021 at 14:31 | comment | added | markling | I see. That is miraculously nippy of you. Thank you. Can this if statement be used in a user command definition or mapping? | |
Dec 5, 2021 at 14:27 | history | answered | Maxim Kim | CC BY-SA 4.0 |