1 " Vim script to fix duplicate words in a .dic file vim: set ft=vim:
3 " Usage: Edit the .dic file and source this script.
7 " Start below the word count.
9 while lnum <= line('$')
10 let word = getline(lnum)
12 if search('^' . word . '/', 'w') != 0
15 continue " don't increment lnum, it's already at the next word
22 echomsg "No duplicate words found"
24 echomsg "Deleted 1 duplicate word"
26 echomsg printf("Deleted %d duplicate words", deleted)