Skip to content

Latest commit

 

History

History
8 lines (6 loc) · 308 Bytes

add-a-comma-and-join-lines.md

File metadata and controls

8 lines (6 loc) · 308 Bytes

Add a comma at each entry and join lines

:%s/$/,/ | 1,$j
  • :%s/$/,/ substitutes (replaces) the end of each line ($) in the file (% specifies the range for the entire file) with a comma (,)
  • 1,$j joins all lines in the file from the first line (1) to the last line ($) into a single line