updated for version 7.0096

This commit is contained in:
Bram Moolenaar
2005-06-28 23:32:02 +00:00
parent d7b31706f7
commit 24bbcfe8fe
17 changed files with 315 additions and 72 deletions

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0aa. Last change: 2005 Jun 27
*eval.txt* For Vim version 7.0aa. Last change: 2005 Jun 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1147,10 +1147,10 @@ v:beval_lnum The number of the line, over which the mouse pointer is. Only
valid while evaluating the 'balloonexpr' option.
*v:beval_text* *beval_text-variable*
v:beval_text The text under or after the mouse pointer. Usually a word as it is
useful for debugging a C program. 'iskeyword' applies, but a
dot and "->" before the position is included. When on a ']'
the text before it is used, including the matching '[' and
v:beval_text The text under or after the mouse pointer. Usually a word as
it is useful for debugging a C program. 'iskeyword' applies,
but a dot and "->" before the position is included. When on a
']' the text before it is used, including the matching '[' and
word before it. When on a Visual area within one line the
highlighted text is used.
Only valid while evaluating the 'balloonexpr' option.
@ -1607,6 +1607,7 @@ setreg( {n}, {v}[, {opt}]) Number set register to value and type
setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
simplify( {filename}) String simplify filename as much as possible
sort( {list} [, {func}]) List sort {list}, using {func} to compare
soundfold( {word}) String sound-fold {word}
spellbadword() String badly spelled word at cursor
spellsuggest({word} [, {max}]) List spelling suggestions
split( {expr} [, {pat} [, {keepempty}]])
@ -3776,6 +3777,15 @@ sort({list} [, {func}]) *sort()* *E702*
let sortedlist = sort(mylist, "MyCompare")
<
*soundfold()*
soundfold({word})
Return the sound-folded equivalent of {word}. Uses the first
language in 'spellang' for the current window that supports
soundfolding. When no sound folding is possible the {word}
is returned unmodified.
This can be used for making spelling suggestions. Note that
the method can be quite slow.
*spellbadword()*
spellbadword() Return the badly spelled word under or after the cursor.
The cursor is advanced to the start of the bad word.

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0aa. Last change: 2005 Jun 24
*options.txt* For Vim version 7.0aa. Last change: 2005 Jun 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -5686,17 +5686,55 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{not available when compiled without the |+syntax|
feature}
Method used for spelling suggestions |z?|. Can be one of these
values:
Methods used for spelling suggestions. Both for the |z?| command and
the |spellsuggest()| function. This is a comma-separated list of
items:
best Method that works best for English. Finds small
changes and uses some sound-a-like scoring.
double Uses two methods and mixes the results. The first
method is finding small changes, the other method
best Internal method that works best for English. Finds
changes like "fast" and uses a bit of sound-a-like
scoring to improve the ordering.
double Internal method that uses two methods and mixes the
results. The first method is "fast", the other method
computes how much the suggestion sounds like the bad
word. Can be slow and doesn't always give better
results.
fast Only check for small changes.
word. That only works when the language specifies
sound folding. Can be slow and doesn't always give
better results.
fast Internal method that only checks for simple changes:
character inserts/deletes/swaps. Works well for
simple typing mistakes.
file:{filename} Read file {filename}, which must have two columns,
separated by a slash. The first column contains the
bad word, the second column the suggested good word.
Example:
theribal/terrible ~
Use this for common mistakes that do not appear at the
top of the suggestion list with the internal methods.
Lines without a slash are ignored, use this for
comments.
The file is used for all languages.
expr:{expr} Evaluate expression {expr}. Use a function to avoid
trouble with spaces. |v:val| holds the badly spelled
word. The expression must evaluate to a List of
Lists, each with a suggestion and a score.
Example:
[['the', 33], ['that', 44]]
Set 'verbose' and use |z?| to see the scores that the
internal methods use. A lower score is better.
This may invoke |spellsuggest()| if you temporarily
set 'spellsuggest' to exclude the "expr:" part.
Errors are silently ignored, unless you set the
'verbose' option to a non-zero value.
Only one of "best", "double" or "fast" may be used. The others may
appear several times in any order. Example: >
:set sps=file:~/.vim/sugg,best,expr:MySuggest()
<
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'splitbelow'* *'sb'* *'nosplitbelow'* *'nosb'*

View File

@ -1,4 +1,4 @@
*spell.txt* For Vim version 7.0aa. Last change: 2005 Jun 27
*spell.txt* For Vim version 7.0aa. Last change: 2005 Jun 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -87,13 +87,20 @@ Finding suggestions for bad words:
*z?*
z? For the word under/after the cursor suggest correctly
spelled words. This also works to find alternative
for words that are not highlighted as bad words.
for words that are not highlighted as bad words, e.g.,
when the word after it is bad.
The results are sorted on similarity to the word
under/after the cursor.
This may take a long time. Hit CTRL-C when you are
bored.
This does not work when there is a line break halfway
a bad word (e.g., "the the").
You can enter the number of your choice or press
<Enter> if you don't want to replace.
<Enter> if you don't want to replace. You can also
use the mouse to click on your choice (only works if
the mouse can be used in Normal mode and when there
are no line wraps!). Click on the first (header) line
to cancel.
If 'verbose' is non-zero a score will be displayed to
indicate the likeliness to the badly spelled word (the
higher the score the more different).
@ -101,19 +108,24 @@ z? For the word under/after the cursor suggest correctly
repeat the word replacement. This works like "ciw",
the good word and <Esc>.
*:spellr* *:spellrepall* *E752* *E753*
:spellr[epall] Repeat the replacement done by |z?| for all matches
with the replaced word in the current window.
The 'spellsuggest' option influences how the list of suggestions is generated
and sorted. See |'spellsuggest'|.
PERFORMANCE
Note that Vim does on-the-fly spell checking. To make this work fast the
word list is loaded in memory. Thus this uses a lot of memory (1 Mbyte or
more). There might also be a noticeable delay when the word list is loaded,
which happens when 'spell' is set and when 'spelllang' is set while 'spell'
was already set. Each word list is only loaded once, they are not deleted
when 'spelllang' is made empty or 'spell' is reset. When 'encoding' is set
all the word lists are reloaded, thus you may notice a delay then too.
Note that Vim does on-the-fly spell checking. To make this work fast the word
list is loaded in memory. Thus this uses a lot of memory (1 Mbyte or more).
There might also be a noticeable delay when the word list is loaded, which
happens when 'spell' is set and when 'spelllang' is set while 'spell' was
already set. To minimize the delay each word list is only loaded once, it
is not deleted when 'spelllang' is made empty or 'spell' is reset. When
'encoding' is set all the word lists are reloaded, thus you may notice a delay
then too.
REGIONS

View File

@ -1226,6 +1226,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
-y starting.txt /*-y*
. repeat.txt /*.*
.Xdefaults gui_x11.txt /*.Xdefaults*
.aff spell.txt /*.aff*
.dic spell.txt /*.dic*
.exrc starting.txt /*.exrc*
.gvimrc gui.txt /*.gvimrc*
.vimrc starting.txt /*.vimrc*
@ -2230,6 +2232,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:print various.txt /*:print*
:pro change.txt /*:pro*
:prof repeat.txt /*:prof*
:profd repeat.txt /*:profd*
:profdel repeat.txt /*:profdel*
:profile repeat.txt /*:profile*
:promptfind change.txt /*:promptfind*
:promptr change.txt /*:promptr*
@ -3817,6 +3821,7 @@ MiNT os_mint.txt /*MiNT*
Moolenaar intro.txt /*Moolenaar*
MorphOS os_amiga.txt /*MorphOS*
Motif gui_x11.txt /*Motif*
Myspell spell.txt /*Myspell*
MzScheme if_mzsch.txt /*MzScheme*
N pattern.txt /*N*
N% motion.txt /*N%*
@ -4994,6 +4999,7 @@ g_CTRL-] tagsrch.txt /*g_CTRL-]*
g` motion.txt /*g`*
g`a motion.txt /*g`a*
ga various.txt /*ga*
garbagecollect() eval.txt /*garbagecollect()*
gd pattern.txt /*gd*
ge motion.txt /*ge*
get() eval.txt /*get()*
@ -6276,6 +6282,7 @@ spell-affix-vim spell.txt /*spell-affix-vim*
spell-dic-format spell.txt /*spell-dic-format*
spell-file-format spell.txt /*spell-file-format*
spell-load spell.txt /*spell-load*
spell-midword spell.txt /*spell-midword*
spell-mkspell spell.txt /*spell-mkspell*
spell-quickstart spell.txt /*spell-quickstart*
spell-syntax spell.txt /*spell-syntax*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0aa. Last change: 2005 Jun 27
*todo.txt* For Vim version 7.0aa. Last change: 2005 Jun 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -100,23 +100,13 @@ PLANNED FOR VERSION 7.0:
- Add SPELLCHECKER, with support for many languages.
- Spell checking code todo's:
- Support user function to make suggestions:
:set spellsuggest=MySuggest,fast
Also support a list with common mistakes?
- For "z?" a "replace all" mechanism would be welcome.
- Add hl groups to 'spelllang'?
:set spelllang=en_us,en-rare/SpellRare,en-math/SpellMath
More complicated: Regions with different languages? E.g. comments
in English, strings in German (po file).
- Code for making suggestions:
- Hebrew: also use prefixes for suggestions. See message from
Kaminsky (June 20) for ideas.
- The sound-folding doesn't work for multi-byte characters. It's
very slow too.
- Simple and fast sound-a-like: mapping list for first char and rest
vowel as first char: *
remove other vowels
- Proofread and cleanup spell help.
- Proofread and cleanup spell help.
- Use "engspchk" from Charles Campbell for ideas (commands, rare words).
- Make "en-rare" spell file? Ask Charles Campbell.
- References: MySpell library (in OpenOffice.org).
@ -142,6 +132,10 @@ PLANNED FOR VERSION 7.0:
- The English dictionaries for different regions are not consistent in
their use of words with a dash.
Later:
- Add hl groups to 'spelllang'?
:set spelllang=en_us,en-rare/SpellRare,en-math/SpellMath
More complicated: Regions with different languages? E.g. comments
in English, strings in German (po file).
- Implement compound words when it works for Myspell. Current idea has
the problem that "foo/X" always allows "foofoo", there is no way to
specify a word can only be at the start or end, or that only certain
@ -2944,6 +2938,8 @@ Options:
8 Make ":mksession" store buffer-specific options for the specific buffer.
8 With ":mksession" always store the 'sessionoptions' option, even when
"options" isn't in it. (St-Amant)
7 ":with option=value | command": temporarily set an option value and
restore it after the command has executed.
7 Setting an option always sets "w_set_curswant", while this is only
required for a few options. Only do it for those options to avoid the
side effect.

49
runtime/indent/ld.vim Normal file
View File

@ -0,0 +1,49 @@
" Vim indent file
" Language: ld(1) script
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
" Latest Revision: 2005-06-28
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=GetLDIndent()
setlocal indentkeys=0{,0},!^F,o,O
if exists("*GetLDIndent")
finish
endif
function s:count_braces(lnum, count_open)
let n_open = 0
let n_close = 0
let line = getline(a:lnum)
let pattern = '[{}]'
let i = match(line, pattern)
while i != -1
if synIDattr(synID(a:lnum, i + 1, 0), 'name') !~ 'ld\%(Comment\|String\)'
if line[i] == '{'
let n_open += 1
elseif line[i] == '}'
if n_open > 0
let n_open -= 1
else
let n_close += 1
endif
endif
endif
let i = match(line, pattern, i + 1)
endwhile
return a:count_open ? n_open : n_close
endfunction
function GetLDIndent()
let pnum = prevnonblank(v:lnum - 1)
if pnum == 0
return 0
endif
return indent(pnum) + s:count_braces(pnum, 1) * &sw
\ - s:count_braces(v:lnum, 0) * &sw
endfunction

View File

@ -2,7 +2,7 @@
" You can also use this as a start for your own set of menus.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2005 Jun 11
" Last Change: 2005 Jun 28
" Note that ":an" (short for ":anoremenu") is often used to make a menu work
" in all modes and avoid side effects from mappings defined by the user.
@ -413,6 +413,8 @@ if has("spell")
an 40.335.120 &Tools.&Spelling.Spell\ Check\ &Off :set nospell<CR>
an 40.335.130 &Tools.&Spelling.To\ &Next\ error<Tab>]s ]s
an 40.335.130 &Tools.&Spelling.To\ &Pevious\ error<Tab>[s [s
an 40.335.140 &Tools.&Spelling.Suggest\ &Corrections<Tab>z? z?
an 40.335.150 &Tools.&Spelling.&Repeat\ correction<Tab>:spellrepall :spellrepall<CR>
an 40.335.200 &Tools.&Spelling.-SEP1- <Nop>
an 40.335.210 &Tools.&Spelling.Set\ language\ to\ "en" :set spl=en spell<CR>
an 40.335.220 &Tools.&Spelling.Set\ language\ to\ "en_au" :set spl=en_au spell<CR>