" Vim script to fix duplicate words in a .dic file vim: set ft=vim: " " Usage: Edit the .dic file and source this script. let deleted = 0 " Start below the word count. let lnum = 2 while lnum <= line('$') let word = getline(lnum) if word !~ '/' if search('^' . word . '/', 'w') != 0 let deleted += 1 exe lnum . "d" continue " don't increment lnum, it's already at the next word endif endif let lnum += 1 endwhile if deleted == 0 echomsg "No duplicate words found" elseif deleted == 1 echomsg "Deleted 1 duplicate word" else echomsg printf("Deleted %d duplicate words", deleted) endif
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
check_locales.vim | File | 463 B | 0644 |
|
cleanadd.vim | File | 934 B | 0644 |
|
en.ascii.spl | File | 554.71 KB | 0644 |
|
en.ascii.sug | File | 542.63 KB | 0644 |
|
en.latin1.spl | File | 556.75 KB | 0644 |
|
en.latin1.sug | File | 543.43 KB | 0644 |
|
en.utf-8.spl | File | 557.18 KB | 0644 |
|
en.utf-8.sug | File | 543.43 KB | 0644 |
|
fixdup.vim | File | 629 B | 0644 |
|
he.vim | File | 240 B | 0644 |
|
spell.vim | File | 118 B | 0644 |
|
yi.vim | File | 241 B | 0644 |
|