Selery: select every Nth line or item

A very simple plugin that I wrote to scratch an itch.

When reshaping a list of items or a CSV/TSV data file, sometimes I need to select every Nth line in a line block, or every Nth item from a set of selections.

selery allows you to do this easily. Details here:


When I wrote this plugin I thought it would be utterly useless to programmers.

Yet, I just used it for variable renaming in a shell script. Assume you have many Str_foobar names in your buffer (where foobar is not constant) and you want to change all of them to Foobar_str. With selery,

  1. Select all Str_foobar names with a regex (e.g, Str_\w+)
  2. Put all selections in lowercase
  3. Split by _
  4. Rotate pairwise
  5. Select every other string with :selery 2
  6. Put the first char in uppercase

Better (and more Kakounish) than a macro!


1 Like