Mercurial > vim
comparison runtime/menu.vim @ 452:01af1008a8d8
updated for version 7.0120
author | vimboss |
---|---|
date | Sat, 30 Jul 2005 22:43:24 +0000 |
parents | 59b7b7e99c95 |
children | 6f8b578776ab |
comparison
equal
deleted
inserted
replaced
451:f6b8170c9c9b | 452:01af1008a8d8 |
---|---|
1 " Vim support file to define the default menus | 1 " Vim support file to define the default menus |
2 " You can also use this as a start for your own set of menus. | 2 " You can also use this as a start for your own set of menus. |
3 " | 3 " |
4 " Maintainer: Bram Moolenaar <Bram@vim.org> | 4 " Maintainer: Bram Moolenaar <Bram@vim.org> |
5 " Last Change: 2005 Jul 22 | 5 " Last Change: 2005 Jul 30 |
6 | 6 |
7 " Note that ":an" (short for ":anoremenu") is often used to make a menu work | 7 " Note that ":an" (short for ":anoremenu") is often used to make a menu work |
8 " in all modes and avoid side effects from mappings defined by the user. | 8 " in all modes and avoid side effects from mappings defined by the user. |
9 | 9 |
10 " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise | 10 " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise |
422 an 40.335.240 &Tools.&Spelling.Set\ language\ to\ "en_gb" :set spl=en_gb spell<CR> | 422 an 40.335.240 &Tools.&Spelling.Set\ language\ to\ "en_gb" :set spl=en_gb spell<CR> |
423 an 40.335.250 &Tools.&Spelling.Set\ language\ to\ "en_nz" :set spl=en_nz spell<CR> | 423 an 40.335.250 &Tools.&Spelling.Set\ language\ to\ "en_nz" :set spl=en_nz spell<CR> |
424 an 40.335.260 &Tools.&Spelling.Set\ language\ to\ "en_us" :set spl=en_us spell<CR> | 424 an 40.335.260 &Tools.&Spelling.Set\ language\ to\ "en_us" :set spl=en_us spell<CR> |
425 an <silent> 40.335.270 &Tools.&Spelling.&Find\ More\ Languages :call <SID>SpellLang()<CR> | 425 an <silent> 40.335.270 &Tools.&Spelling.&Find\ More\ Languages :call <SID>SpellLang()<CR> |
426 | 426 |
427 let s:undo_spellang = ['aun &Tools.&Spelling.&Find\ More\ Languages'] | |
427 func! s:SpellLang() | 428 func! s:SpellLang() |
428 silent! aun &Tools.&Spelling.&Find\ More\ Languages | 429 for cmd in s:undo_spellang |
430 exe "silent! " . cmd | |
431 endfor | |
432 let s:undo_spellang = [] | |
433 | |
429 if &enc == "iso-8859-15" | 434 if &enc == "iso-8859-15" |
430 let enc = "latin1" | 435 let enc = "latin1" |
431 else | 436 else |
432 let enc = &enc | 437 let enc = &enc |
433 endif | 438 endif |
439 | |
434 let found = 0 | 440 let found = 0 |
435 let s = globpath(&rtp, "spell/*." . enc . ".spl") | 441 let s = globpath(&rtp, "spell/*." . enc . ".spl") |
436 if s != "" | 442 if s != "" |
437 let n = 300 | 443 let n = 300 |
438 for f in split(s, "\n") | 444 for f in split(s, "\n") |
439 let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "") | 445 let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "") |
440 if nm != "en" | 446 if nm != "en" && nm !~ '/' |
441 exe 'an 40.335.' . n . ' &Tools.&Spelling.Set\ language\ to\ "' . nm . '" :set spl=' . nm . ' spell<CR>' | |
442 let found += 1 | 447 let found += 1 |
448 let menuname = '&Tools.&Spelling.Set\ language\ to\ "' . nm . '"' | |
449 exe 'an 40.335.' . n . ' ' . menuname . ' :set spl=' . nm . ' spell<CR>' | |
450 let s:undo_spellang += ['aun ' . menuname] | |
443 endif | 451 endif |
444 let n += 10 | 452 let n += 10 |
445 endfor | 453 endfor |
446 endif | 454 endif |
447 if found == 0 | 455 if found == 0 |
449 elseif found == 1 | 457 elseif found == 1 |
450 echomsg "Found spell file " . nm | 458 echomsg "Found spell file " . nm |
451 else | 459 else |
452 echomsg "Found " . found . " more spell files" | 460 echomsg "Found " . found . " more spell files" |
453 endif | 461 endif |
462 " Need to redo this when 'encoding' is changed. | |
463 augroup spellmenu | |
464 au! EncodingChanged * call <SID>SpellLang() | |
465 augroup END | |
454 endfun | 466 endfun |
455 | 467 |
456 endif | 468 endif |
457 | 469 |
458 " Tools.Fold Menu | 470 " Tools.Fold Menu |