sponsor Vim development Vim logo Vim Book Ad

uniq.vim : Emulations of the 'uniq' utility in Vim script

 script karma  Rating 22/7, Downloaded by 1249  Comments, bugs, improvements  Vim wiki

created by
Steve Hall
 
script type
utility
 
description

This script provides several examples of the Unix "uniq" utility emulated entirely with Vim script, found during some brief research through the Vim list archives. Like the original uniq, each requires the selected lines "uniq-ed" to already be sorted so that duplicates are adjacent.

Note that there are generally two approches here. The first uses the getline() function to examine adjacent lines and is used by the first two examples. A second approach is illustrated by the last three examples which use a single global or substitution command to accomplish the same purpose.

We share this compilation in hopes that it might be helpful. The actual origins of each section are documented below. Use at your own risk!

 
install details

Please read the code to understand each example's usage. Drop into your plugin folders to have the various commands and functions available.

 

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
uniq.vim 0.1 2003-05-20 6.0 Steve Hall Initial upload
ip used for rating: 18.188.61.223

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