sponsor Vim development Vim logo Vim Book Ad

reorder.vim : Reorder the items in natural language lists

 script karma  Rating 6/3, Downloaded by 426  Comments, bugs, improvements  Vim wiki

created by
Ken Bloom
 
script type
utility
 
description
Supposing you have a list "foo, bar, and baz" in English where all of the elements are separated by commas and there's the word "and" or "or" before the last item in the list.

The attached Reorder plugin works as follows: Select the list you want to reorder in visual mode (like "foo, bar, and baz") then run :Reorder 3,2,1 (or :'<,'>Reorder 3,2,1 --- the line numbers are ignored for your convenience, since Vim puts them in anyway), and watch Vim reorder your list to "baz, bar, and foo".

Requires Ruby support, and the facets gem installed.
 
install details
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
reorder.vim 1.0 2009-04-02 7.0 Ken Bloom Initial upload
ip used for rating: 3.145.59.187

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github