diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-08-21 22:12:59 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-08-21 22:12:59 +0000 |
commit | cee5560a4b3e40792f29b483e5d980403c99ffa6 (patch) | |
tree | e73e22890c2e1a032705f3f1c2ca47c2c19095aa /runtime/spell/fixdup | |
parent | d12a1326031d82c0292718731c1ecbdf086cf00c (diff) |
updated for version 7.0133
Diffstat (limited to 'runtime/spell/fixdup')
-rw-r--r-- | runtime/spell/fixdup | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/runtime/spell/fixdup b/runtime/spell/fixdup new file mode 100644 index 0000000000..0dd532d5e6 --- /dev/null +++ b/runtime/spell/fixdup @@ -0,0 +1,27 @@ +" 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 |