About: Making a list of numbers   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

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.

AttributesValues
rdfs:label
  • Making a list of numbers
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.
Version
  • 6(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 917(xsd:integer)
Complexity
  • basic
Created
  • 2005(xsd:integer)
ID
  • 918(xsd:integer)
NEXT
  • 919(xsd:integer)
Rating
  • 6(xsd:integer)
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
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software