One might have many blocks of text that are clearly delimited, but which need the order reversed, as in this example: ... html for first block, multiple lines ... ... html for second block, multiple lines ... ... html for third block, multiple lines ... To solve this problem, observe that the first block does not need to be moved. Go to the last line of the first block (in this case the ) then record a macro by typing: Now you should be able to run the macro with @a (and then @@ for each subsequent run) for each block you need to move. Note that this won't work for nested
| Attributes | Values |
|---|
| rdfs:label
| - Reversing order of blocks of text
|
| rdfs:comment
| - One might have many blocks of text that are clearly delimited, but which need the order reversed, as in this example: ... html for first block, multiple lines ... ... html for second block, multiple lines ... ... html for third block, multiple lines ... To solve this problem, observe that the first block does not need to be moved. Go to the last line of the first block (in this case the ) then record a macro by typing: Now you should be able to run the macro with @a (and then @@ for each subsequent run) for each block you need to move. Note that this won't work for nested
|
| Version
| |
| dbkwik:vim/property/wikiPageUsesTemplate
| |
| Previous
| |
| Author
| |
| Subpage
| |
| Complexity
| |
| Created
| |
| ID
| |
| NEXT
| |
| abstract
| - One might have many blocks of text that are clearly delimited, but which need the order reversed, as in this example: ... html for first block, multiple lines ... ... html for second block, multiple lines ... ... html for third block, multiple lines ... To solve this problem, observe that the first block does not need to be moved. Go to the last line of the first block (in this case the ) then record a macro by typing: ma (set mark 'a') qa (start recording a macro to register a) jV/<\/div><cr></cr> (select the next block – these commands work for this example) :m0<cr></cr> (move the block to the beginning of the file) 'a (return to mark 'a') q (finish recording macro) Now you should be able to run the macro with @a (and then @@ for each subsequent run) for each block you need to move. For the impatient, move to the last line of your block and type maqajV/<\/div><cr> :m0 <cr> 'aq@a@@@@@@@@ </cr> </cr>; keep doing @@ until the file is reordered appropriately. Note that this won't work for nested
|