Bram Moolenaar | 28c258f | 2006-01-25 22:02:51 +0000 | [diff] [blame] | 1 | " Vim script to clean the ll.xxxxx.add files of commented out entries |
| 2 | " Author: Antonio Colombo, Bram Moolenaar |
| 3 | " Last Update: 2006 Jan 19 |
| 4 | |
| 5 | " Time in seconds after last time an ll.xxxxx.add file was updated |
| 6 | " Default is one hour. |
| 7 | if !exists("g:spell_clean_limit") |
| 8 | let g:spell_clean_limit = 60 * 60 |
| 9 | endif |
| 10 | |
| 11 | " Loop over all the runtime/spell/*.add files. |
| 12 | for s:fname in split(globpath(&rtp, "spell/*.add"), "\n") |
| 13 | if filewritable(s:fname) && localtime() - getftime(s:fname) > g:spell_clean_limit |
| 14 | silent exe "split " . escape(s:fname, ' \') |
| 15 | echo "Processing" s:fname |
| 16 | silent! g/^#/d |
| 17 | silent update |
| 18 | close |
| 19 | endif |
| 20 | endfor |
| 21 | |
| 22 | echo "Done" |