rdfs:comment
| - It is easy to insert a list of ascending numbers, for example, this command inserts five lines after the current line: :put =range(11,15) The five lines are: 11 12 13 14 15 If wanted, the lines can be inserted after a particular line number, for example :123put =range(11,15) inserts them after line number 123, while :0put =range(11,15) inserts the lines at the start of the buffer, and :$put =range(11,15) inserts them after the last line. An equivalent command is :call append(123,range(11,15))) to insert the five lines after line number 123, for example.
|
abstract
| - It is easy to insert a list of ascending numbers, for example, this command inserts five lines after the current line: :put =range(11,15) The five lines are: 11 12 13 14 15 If wanted, the lines can be inserted after a particular line number, for example :123put =range(11,15) inserts them after line number 123, while :0put =range(11,15) inserts the lines at the start of the buffer, and :$put =range(11,15) inserts them after the last line. An equivalent command is :call append(123,range(11,15))) to insert the five lines after line number 123, for example. The list of numbers can be formatted. For example, the following inserts 150 lines, where each line contains a number displayed in four columns with leading zeros. :put =map(range(1,150), 'printf(''%04d'', v:val)') The results range from 0001 to 0150. The map() function replaces each value with the result of the expression, which must be given as a string (the double <i></i> presents a single apostrophe when inside an apostrophe-quoted string). In the expression, v:val represents each value from the list in the first argument. Here is another example, using a loop rather than map(): :for i in range(1,10) | put ='192.168.0.'.i | endfor Executing this command inserts the following after the current line: 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4 192.168.0.5 192.168.0.6 192.168.0.7 192.168.0.8 192.168.0.9 192.168.0.10
|