diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-07-05 21:48:14 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-07-05 21:48:14 +0000 |
commit | 53180ce2e7b496306012316ca220fea978576a8c (patch) | |
tree | e52d6164116de32e335dcaed29e9d947c9cc7249 | |
parent | dfb9ac00215670dedfd1fb7c1bb54195e9a929a5 (diff) |
updated for version 7.0103v7.0103
30 files changed, 1461 insertions, 774 deletions
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 43f72195a1..d1764affb5 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 7.0aa. Last change: 2005 Feb 14 +*cmdline.txt* For Vim version 7.0aa. Last change: 2005 Jul 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -726,7 +726,7 @@ Note: these are typed literally, they are not special keys! effective buffer number (for ":r file" it is the current buffer, the file being read is not in a buffer). <amatch> when executing autocommands, is replaced with the match for - which this autocommand was executed. It differs form + which this autocommand was executed. It differs from <afile> only when the file name isn't used to match with (for FileType and Syntax events). <sfile> when executing a ":source" command, is replaced with the diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index 5fc1dd82d5..79782c868a 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -1,4 +1,4 @@ -*spell.txt* For Vim version 7.0aa. Last change: 2005 Jul 04 +*spell.txt* For Vim version 7.0aa. Last change: 2005 Jul 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -79,20 +79,20 @@ zW Like "zw" but add the word to the internal word list *:spe* *:spellgood* :[count]spe[llgood] {word} - Add [word} as a good word to 'spellfile', like with + Add {word} as a good word to 'spellfile', like with "zg". Without count the first name is used, with a count of two the second entry, etc. -:spe[llgood]! {word} Add [word} as a good word to the internal word list, +:spe[llgood]! {word} Add {word} as a good word to the internal word list, like with "zG". *:spellw* *:spellwrong* :[count]spellw[rong] {word} - Add [word} as a wrong (bad) word to 'spellfile', as + Add {word} as a wrong (bad) word to 'spellfile', as with "zw". Without count the first name is used, with a count of two the second entry, etc. -:spellw[rong]! {word} Add [word} as a wrong (bad) word to the internal word +:spellw[rong]! {word} Add {word} as a wrong (bad) word to the internal word list. After adding a word to 'spellfile' with the above commands its associated diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 2660432d93..8272543350 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.0aa. Last change: 2005 Jun 03 +*syntax.txt* For Vim version 7.0aa. Last change: 2005 Jul 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3907,6 +3907,9 @@ SpecialKey Meta and special keys listed with ":map", also for text used *hl-SpellBad* SpellBad Word that is not recognized by the spellchecker. |spell| This will be combined with the highlighting used otherwise. + *hl-SpellCap* +SpellCap Word that should start with a capital. |spell| + This will be combined with the highlighting used otherwise. *hl-SpellLocal* SpellLocal Word that is recognized by the spellchecker as one that is used in another region. |spell| diff --git a/runtime/doc/tags b/runtime/doc/tags index f231debf85..b7f8aa7d19 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5148,6 +5148,7 @@ hebrew hebrew.txt /*hebrew* hebrew.txt hebrew.txt /*hebrew.txt* help various.txt /*help* help-context help.txt /*help-context* +help-tags tags 1 help-translated various.txt /*help-translated* help-xterm-window various.txt /*help-xterm-window* help.txt help.txt /*help.txt* @@ -5207,6 +5208,7 @@ hl-Search syntax.txt /*hl-Search* hl-SignColumn syntax.txt /*hl-SignColumn* hl-SpecialKey syntax.txt /*hl-SpecialKey* hl-SpellBad syntax.txt /*hl-SpellBad* +hl-SpellCap syntax.txt /*hl-SpellCap* hl-SpellLocal syntax.txt /*hl-SpellLocal* hl-SpellRare syntax.txt /*hl-SpellRare* hl-StatusLine syntax.txt /*hl-StatusLine* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 0dc952e34b..d290eea378 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.0aa. Last change: 2005 Jul 04 +*todo.txt* For Vim version 7.0aa. Last change: 2005 Jul 05 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/ftplugin/AppendMatchGroup.vim b/runtime/ftplugin/AppendMatchGroup.vim index da7994eda1..34e80b5f83 100644 --- a/runtime/ftplugin/AppendMatchGroup.vim +++ b/runtime/ftplugin/AppendMatchGroup.vim @@ -1,125 +1,125 @@ -" Vim filetype plugin file utility
-" Language: * (various)
-" Maintainer: Dave Silvia <dsilvia@mchsi.com>
-" Date: 6/30/2004
-
-" The start of match (b:SOM) default is:
-" '\<'
-" The end of match (b:EOM) default is:
-" '\>'
-"
-" If you want to use some other start/end of match, just assign the
-" value to the b:SOM|EOM variable in your filetype script.
-"
-" SEE: :h pattern.txt
-" :h pattern-searches
-" :h regular-expression
-" :h matchit
-
-let s:myName=expand("<sfile>:t")
-
-" matchit.vim not loaded -- don't do anyting
-if !exists("loaded_matchit")
- echomsg s:myName.": matchit.vim not loaded -- finishing without loading"
- finish
-endif
-
-" already been here -- don't redefine
-if exists("*AppendMatchGroup")
- finish
-endif
-
-" Function To Build b:match_words
-" The following function, 'AppendMatchGroup', helps to increase
-" readability of your filetype script if you choose to use matchit.
-" It also precludes many construction errors, reducing the
-" construction to simply invoking the function with the match words.
-" As an example, let's take the ubiquitous if/then/else/endif type
-" of construct. This is how the entry in your filetype script would look.
-"
-" " source the AppendMatchGroup function file
-" runtime ftplugin/AppendMatchGroup.vim
-"
-" " fill b:match_words
-" call AppendMatchGroup('if,then,else,endif')
-"
-" And the b:match_words constructed would look like:
-"
-" \<if\>:\<then\>:\<else\>:\<endif\>
-"
-" Use of AppendMatchGroup makes your filetype script is a little
-" less busy and a lot more readable. Additionally, it
-" checks three critical things:
-"
-" 1) Do you have at least 2 entries in your match group.
-"
-" 2) Does the buffer variable 'b:match_words' exist? if not, create it.
-"
-" 3) If the buffer variable 'b:match_words' does exist, is the last
-" character a ','? If not, add it before appending.
-"
-" You should now be able to match 'if/then/else/endif' in succession
-" in your source file, in just about any construction you may have
-" chosen for them.
-"
-" To add another group, simply call 'AppendMatchGroup again. E.G.:
-"
-" call AppendMatchGroup('while,do,endwhile')
-
-function AppendMatchGroup(mwordList)
- let List=a:mwordList
- let Comma=match(List,',')
- if Comma == -1 || Comma == strlen(List)-1
- echoerr "Must supply a comma separated list of at least 2 entries."
- echoerr "Supplied list: <".List.">"
- return
- endif
- let listEntryBegin=0
- let listEntryEnd=Comma
- let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin)
- let List=strpart(List,Comma+1)
- let Comma=match(List,',')
- " if listEntry is all spaces || List is empty || List is all spaces
- if (match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1)
- \ || List == '' || (match(List,'\s\+') == 0 && match(List,'\S\+') == -1)
- echoerr "Can't use all spaces for an entry <".listEntry.">"
- echoerr "Remaining supplied list: <".List.">"
- return
- endif
-
- if !exists("b:SOM")
- let b:SOM='\<'
- endif
- if !exists("b:EOM")
- let b:EOM='\>'
- endif
- if !exists("b:match_words")
- let b:match_words=''
- endif
- if b:match_words != '' && match(b:match_words,',$') == -1
- let b:match_words=b:match_words.','
- endif
- " okay, all set add first entry in this list
- let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':'
- while Comma != -1
- let listEntryEnd=Comma
- let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin)
- let List=strpart(List,Comma+1)
- let Comma=match(List,',')
- " if listEntry is all spaces
- if match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1
- echoerr "Can't use all spaces for an entry <".listEntry."> - skipping"
- echoerr "Remaining supplied list: <".List.">"
- continue
- endif
- let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':'
- endwhile
- let listEntry=List
- let b:match_words=b:match_words.b:SOM.listEntry.b:EOM
-endfunction
-
-" TODO: Write a wrapper to handle multiple groups in one function call.
-" Don't see a lot of utility in this as it would undoubtedly warrant
-" continuation lines in the filetype script and it would be a toss
-" up as to which is more readable: individual calls one to a line or
-" a single call with continuation lines. I vote for the former.
+" Vim filetype plugin file utility +" Language: * (various) +" Maintainer: Dave Silvia <dsilvia@mchsi.com> +" Date: 6/30/2004 + +" The start of match (b:SOM) default is: +" '\<' +" The end of match (b:EOM) default is: +" '\>' +" +" If you want to use some other start/end of match, just assign the +" value to the b:SOM|EOM variable in your filetype script. +" +" SEE: :h pattern.txt +" :h pattern-searches +" :h regular-expression +" :h matchit + +let s:myName=expand("<sfile>:t") + +" matchit.vim not loaded -- don't do anyting +if !exists("loaded_matchit") + echomsg s:myName.": matchit.vim not loaded -- finishing without loading" + finish +endif + +" already been here -- don't redefine +if exists("*AppendMatchGroup") + finish +endif + +" Function To Build b:match_words +" The following function, 'AppendMatchGroup', helps to increase +" readability of your filetype script if you choose to use matchit. +" It also precludes many construction errors, reducing the +" construction to simply invoking the function with the match words. +" As an example, let's take the ubiquitous if/then/else/endif type +" of construct. This is how the entry in your filetype script would look. +" +" " source the AppendMatchGroup function file +" runtime ftplugin/AppendMatchGroup.vim +" +" " fill b:match_words +" call AppendMatchGroup('if,then,else,endif') +" +" And the b:match_words constructed would look like: +" +" \<if\>:\<then\>:\<else\>:\<endif\> +" +" Use of AppendMatchGroup makes your filetype script is a little +" less busy and a lot more readable. Additionally, it +" checks three critical things: +" +" 1) Do you have at least 2 entries in your match group. +" +" 2) Does the buffer variable 'b:match_words' exist? if not, create it. +" +" 3) If the buffer variable 'b:match_words' does exist, is the last +" character a ','? If not, add it before appending. +" +" You should now be able to match 'if/then/else/endif' in succession +" in your source file, in just about any construction you may have +" chosen for them. +" +" To add another group, simply call 'AppendMatchGroup again. E.G.: +" +" call AppendMatchGroup('while,do,endwhile') + +function AppendMatchGroup(mwordList) + let List=a:mwordList + let Comma=match(List,',') + if Comma == -1 || Comma == strlen(List)-1 + echoerr "Must supply a comma separated list of at least 2 entries." + echoerr "Supplied list: <".List.">" + return + endif + let listEntryBegin=0 + let listEntryEnd=Comma + let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin) + let List=strpart(List,Comma+1) + let Comma=match(List,',') + " if listEntry is all spaces || List is empty || List is all spaces + if (match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1) + \ || List == '' || (match(List,'\s\+') == 0 && match(List,'\S\+') == -1) + echoerr "Can't use all spaces for an entry <".listEntry.">" + echoerr "Remaining supplied list: <".List.">" + return + endif + + if !exists("b:SOM") + let b:SOM='\<' + endif + if !exists("b:EOM") + let b:EOM='\>' + endif + if !exists("b:match_words") + let b:match_words='' + endif + if b:match_words != '' && match(b:match_words,',$') == -1 + let b:match_words=b:match_words.',' + endif + " okay, all set add first entry in this list + let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':' + while Comma != -1 + let listEntryEnd=Comma + let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin) + let List=strpart(List,Comma+1) + let Comma=match(List,',') + " if listEntry is all spaces + if match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1 + echoerr "Can't use all spaces for an entry <".listEntry."> - skipping" + echoerr "Remaining supplied list: <".List.">" + continue + endif + let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':' + endwhile + let listEntry=List + let b:match_words=b:match_words.b:SOM.listEntry.b:EOM +endfunction + +" TODO: Write a wrapper to handle multiple groups in one function call. +" Don't see a lot of utility in this as it would undoubtedly warrant +" continuation lines in the filetype script and it would be a toss +" up as to which is more readable: individual calls one to a line or +" a single call with continuation lines. I vote for the former. diff --git a/runtime/ftplugin/mupad.vim b/runtime/ftplugin/mupad.vim index 791b99aa10..ef3a4fe28f 100644 --- a/runtime/ftplugin/mupad.vim +++ b/runtime/ftplugin/mupad.vim @@ -1,30 +1,30 @@ -" Vim filetype plugin file
-" Language: MuPAD source files
-" Maintainer: Dave Silvia <dsilvia@mchsi.com>
-" Filenames: *.mu
-" Date: 6/30/2004
-
-if exists("b:did_ftplugin") | finish | endif
-let b:did_ftplugin = 1
-
-" Change the :browse e filter to primarily show MuPAD source files.
-if has("gui_win32")
- let b:browsefilter=
- \ "MuPAD source (*.mu)\t*.mu\n" .
- \ "All Files (*.*)\t*.*\n"
-endif
-
-" matchit.vim not loaded -- don't do anyting below
-if !exists("loaded_matchit")
- " echomsg "matchit.vim not loaded -- finishing"
- finish
-endif
-
-" source the AppendMatchGroup function file
-runtime ftplugin/AppendMatchGroup.vim
-
-" fill b:match_words for MuPAD
-call AppendMatchGroup('domain,end_domain')
-call AppendMatchGroup('proc,begin,end_proc')
-call AppendMatchGroup('if,then,elif,else,end_if')
-call AppendMatchGroup('\%(for\|while\|repeat\|case\),of,do,break,next,until,\%(end_for\|end_while\|end_repeat\|end_case\)')
+" Vim filetype plugin file +" Language: MuPAD source files +" Maintainer: Dave Silvia <dsilvia@mchsi.com> +" Filenames: *.mu +" Date: 6/30/2004 + +if exists("b:did_ftplugin") | finish | endif +let b:did_ftplugin = 1 + +" Change the :browse e filter to primarily show MuPAD source files. +if has("gui_win32") + let b:browsefilter= + \ "MuPAD source (*.mu)\t*.mu\n" . + \ "All Files (*.*)\t*.*\n" +endif + +" matchit.vim not loaded -- don't do anyting below +if !exists("loaded_matchit") + " echomsg "matchit.vim not loaded -- finishing" + finish +endif + +" source the AppendMatchGroup function file +runtime ftplugin/AppendMatchGroup.vim + +" fill b:match_words for MuPAD +call AppendMatchGroup('domain,end_domain') +call AppendMatchGroup('proc,begin,end_proc') +call AppendMatchGroup('if,then,elif,else,end_if') +call AppendMatchGroup('\%(for\|while\|repeat\|case\),of,do,break,next,until,\%(end_for\|end_while\|end_repeat\|end_case\)') diff --git a/runtime/indent/pascal.vim b/runtime/indent/pascal.vim index 7085287a0f..b1a652d0a9 100644 --- a/runtime/indent/pascal.vim +++ b/runtime/indent/pascal.vim @@ -1,173 +1,173 @@ -" Vim indent file
-" Language: Pascal
-" Maintainer: Neil Carter <n.carter@swansea.ac.uk>
-" Created: 2004 Jul 13
-" Last Change: 2005 Jun 15
-
-
-if exists("b:did_indent")
- finish
-endif
-let b:did_indent = 1
-
-setlocal indentexpr=GetPascalIndent(v:lnum)
-setlocal indentkeys&
-setlocal indentkeys+==end;,==const,==type,==var,==begin,==repeat,==until,==for
-setlocal indentkeys+==program,==function,==procedure,==object,==private
-setlocal indentkeys+==record,==if,==else,==case
-
-if exists("*GetPascalIndent")
- finish
-endif
-
-
-function! s:GetPrevNonCommentLineNum( line_num )
-
- " Skip lines starting with a comment
- let SKIP_LINES = '^\s*\(\((\*\)\|\(\*\ \)\|\(\*)\)\|{\|}\)'
-
- let nline = a:line_num
- while nline > 0
- let nline = prevnonblank(nline-1)
- if getline(nline) !~? SKIP_LINES
- break
- endif
- endwhile
-
- return nline
-endfunction
-
-
-function! GetPascalIndent( line_num )
- " Line 0 always goes at column 0
- if a:line_num == 0
- return 0
- endif
-
- let this_codeline = getline( a:line_num )
-
- " If in the middle of a three-part comment
- if this_codeline =~ '^\s*\*'
- return indent( a:line_num )
- endif
-
- let prev_codeline_num = s:GetPrevNonCommentLineNum( a:line_num )
- let prev_codeline = getline( prev_codeline_num )
- let indnt = indent( prev_codeline_num )
-
- " Compiler directives should always go in column zero.
- if this_codeline =~ '^\s*{\(\$IFDEF\|\$ELSE\|\$ENDIF\)'
- return 0
- endif
-
- " These items have nothing before or after (not even a comment), and
- " go on column 0. Make sure that the ^\s* is followed by \( to make
- " ORs work properly, and not include the start of line (this must
- " always appear).
- " The bracketed expression with the underline is a routine
- " separator. This is one case where we do indent comment lines.
- if this_codeline =~ '^\s*\((\*\ _\+\ \*)\|\<\(const\|var\)\>\)$'
- return 0
- endif
-
- " These items may have text after them, and go on column 0 (in most
- " cases). The problem is that "function" and "procedure" keywords
- " should be indented if within a class declaration.
- if this_codeline =~ '^\s*\<\(program\|type\|uses\|procedure\|function\)\>'
- return 0
- endif
-
- " BEGIN
- " If the begin does not come after "if", "for", or "else", then it
- " goes in column 0
- if this_codeline =~ '^\s*begin\>' && prev_codeline !~ '^\s*\<\(if\|for\|else\)\>'
- return 0
- endif
-
- " These keywords are indented once only.
- if this_codeline =~ '^\s*\<\(private\)\>'
- return &shiftwidth
- endif
-
- " If the PREVIOUS LINE contained these items, the current line is
- " always indented once.
- if prev_codeline =~ '^\s*\<\(type\|uses\)\>'
- return &shiftwidth
- endif
-
- " These keywords are indented once only. Possibly surrounded by
- " other chars.
- if this_codeline =~ '^.\+\<\(object\|record\)\>'
- return &shiftwidth
- endif
-
- " If the previous line was indenting...
- if prev_codeline =~ '^\s*\<\(for\|if\|case\|else\|end\ else\)\>'
- " then indent.
- let indnt = indnt + &shiftwidth
- " BUT... if this is the start of a multistatement block then we
- " need to align the begin with the previous line.
- if this_codeline =~ '^\s*begin\>'
- return indnt - &shiftwidth
- endif
-
- " We also need to keep the indentation level constant if the
- " whole if-then statement was on one line.
- if prev_codeline =~ '\<then\>.\+'
- let indnt = indnt - &shiftwidth
- endif
- endif
-
- " PREVIOUS-LINE BEGIN
- " If the previous line was an indenting keyword then indent once...
- if prev_codeline =~ '^\s*\<\(const\|var\|begin\|repeat\|private\)\>'
- " But only if this is another var in a list.
- if this_codeline !~ '^\s*var\>'
- return indnt + &shiftwidth
- endif
- endif
-
- " PREVIOUS-LINE BEGIN
- " Indent code after a case statement begin
- if prev_codeline =~ '\:\ begin\>'
- return indnt + &shiftwidth
- endif
-
- " These words may have text before them on the line (hence the .*)
- " but are followed by nothing. Always indent once only.
- if prev_codeline =~ '^\(.*\|\s*\)\<\(object\|record\)\>$'
- return indnt + &shiftwidth
- endif
-
- " If we just closed a bracket that started on a previous line, then
- " unindent. But don't return yet -- we need to check for further
- " unindentation (for end/until/else)
- if prev_codeline =~ '^[^(]*[^*])'
- let indnt = indnt - &shiftwidth
- endif
-
- " At the end of a block, we have to unindent both the current line
- " (the "end" for instance) and the newly-created line.
- if this_codeline =~ '^\s*\<\(end\|until\|else\)\>'
- return indnt - &shiftwidth
- endif
-
- " If we have opened a bracket and it continues over one line,
- " then indent once.
- "
- " RE = an opening bracket followed by any amount of anything other
- " than a closing bracket and then the end-of-line.
- "
- " If we didn't include the end of line, this RE would match even
- " closed brackets, since it would match everything up to the closing
- " bracket.
- "
- " This test isn't clever enough to handle brackets inside strings or
- " comments.
- if prev_codeline =~ '([^*]\=[^)]*$'
- return indnt + &shiftwidth
- endif
-
- return indnt
-endfunction
-
+" Vim indent file +" Language: Pascal +" Maintainer: Neil Carter <n.carter@swansea.ac.uk> +" Created: 2004 Jul 13 +" Last Change: 2005 Jul 05 + + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal indentexpr=GetPascalIndent(v:lnum) +setlocal indentkeys& +setlocal indentkeys+==end;,==const,==type,==var,==begin,==repeat,==until,==for +setlocal indentkeys+==program,==function,==procedure,==object,==private +setlocal indentkeys+==record,==if,==else,==case + +if exists("*GetPascalIndent") + finish +endif + + +function! s:GetPrevNonCommentLineNum( line_num ) + + " Skip lines starting with a comment + let SKIP_LINES = '^\s*\(\((\*\)\|\(\*\ \)\|\(\*)\)\|{\|}\)' + + let nline = a:line_num + while nline > 0 + let nline = prevnonblank(nline-1) + if getline(nline) !~? SKIP_LINES + break + endif + endwhile + + return nline +endfunction + + +function! GetPascalIndent( line_num ) + " Line 0 always goes at column 0 + if a:line_num == 0 + return 0 + endif + + let this_codeline = getline( a:line_num ) + + " If in the middle of a three-part comment + if this_codeline =~ '^\s*\*' + return indent( a:line_num ) + endif + + let prev_codeline_num = s:GetPrevNonCommentLineNum( a:line_num ) + let prev_codeline = getline( prev_codeline_num ) + let indnt = indent( prev_codeline_num ) + + " Compiler directives should always go in column zero. + if this_codeline =~ '^\s*{\(\$IFDEF\|\$ELSE\|\$ENDIF\)' + return 0 + endif + + " These items have nothing before or after (not even a comment), and + " go on column 0. Make sure that the ^\s* is followed by \( to make + " ORs work properly, and not include the start of line (this must + " always appear). + " The bracketed expression with the underline is a routine + " separator. This is one case where we do indent comment lines. + if this_codeline =~ '^\s*\((\*\ _\+\ \*)\|\<\(const\|var\)\>\)$' + return 0 + endif + + " These items may have text after them, and go on column 0 (in most + " cases). The problem is that "function" and "procedure" keywords + " should be indented if within a class declaration. + if this_codeline =~ '^\s*\<\(program\|type\|uses\|procedure\|function\)\>' + return 0 + endif + + " BEGIN + " If the begin does not come after "if", "for", or "else", then it + " goes in column 0 + if this_codeline =~ '^\s*begin\>' && prev_codeline !~ '^\s*\<\(if\|for\|else\)\>' + return 0 + endif + + " These keywords are indented once only. + if this_codeline =~ '^\s*\<\(private\)\>' + return &shiftwidth + endif + + " If the PREVIOUS LINE contained these items, the current line is + " always indented once. + if prev_codeline =~ '^\s*\<\(type\|uses\)\>' + return &shiftwidth + endif + + " These keywords are indented once only. Possibly surrounded by + " other chars. + if this_codeline =~ '^.\+\<\(object\|record\)\>' + return &shiftwidth + endif + + " If the previous line was indenting... + if prev_codeline =~ '^\s*\<\(for\|if\|case\|else\|end\ else\)\>' + " then indent. + let indnt = indnt + &shiftwidth + " BUT... if this is the start of a multistatement block then we + " need to align the begin with the previous line. + if this_codeline =~ '^\s*begin\>' + return indnt - &shiftwidth + endif + + " We also need to keep the indentation level constant if the + " whole if-then statement was on one line. + if prev_codeline =~ '\<then\>.\+' + let indnt = indnt - &shiftwidth + endif + endif + + " PREVIOUS-LINE BEGIN + " If the previous line was an indenting keyword then indent once... + if prev_codeline =~ '^\s*\<\(const\|var\|begin\|repeat\|private\)\>' + " But only if this is another var in a list. + if this_codeline !~ '^\s*var\>' + return indnt + &shiftwidth + endif + endif + + " PREVIOUS-LINE BEGIN + " Indent code after a case statement begin + if prev_codeline =~ '\:\ begin\>' + return indnt + &shiftwidth + endif + + " These words may have text before them on the line (hence the .*) + " but are followed by nothing. Always indent once only. + if prev_codeline =~ '^\(.*\|\s*\)\<\(object\|record\)\>$' + return indnt + &shiftwidth + endif + + " If we just closed a bracket that started on a previous line, then + " unindent. But don't return yet -- we need to check for further + " unindentation (for end/until/else) + if prev_codeline =~ '^[^(]*[^*])' + let indnt = indnt - &shiftwidth + endif + + " At the end of a block, we have to unindent both the current line + " (the "end" for instance) and the newly-created line. + if this_codeline =~ '^\s*\<\(end\|until\|else\)\>' + return indnt - &shiftwidth + endif + + " If we have opened a bracket and it continues over one line, + " then indent once. + " + " RE = an opening bracket followed by any amount of anything other + " than a closing bracket and then the end-of-line. + " + " If we didn't include the end of line, this RE would match even + " closed brackets, since it would match everything up to the closing + " bracket. + " + " This test isn't clever enough to handle brackets inside strings or + " comments. + if prev_codeline =~ '([^*]\=[^)]*$' + return indnt + &shiftwidth + endif + + return indnt +endfunction + diff --git a/runtime/keymap/canfr-win.vim b/runtime/keymap/canfr-win.vim index 7a405bf0be..1907fc5b46 100644 --- a/runtime/keymap/canfr-win.vim +++ b/runtime/keymap/canfr-win.vim @@ -1,91 +1,91 @@ -" Vim Keymap file for the normalized Canadian multilingual keyboard
-" CAN/CSA Z243.200-92 using the latin1 encoding.
-" This mapping is limited in scope, as it assumes that the AltGr
-" key works as it typically does in a Windows system with a multilingual
-" English keyboard. It probably won't work with the US keyboard on US
-" English versions of Windows, because those don't provide the AltGr keys.
-" The mapping was tested with Win2k and WinXP.
-
-" Maintainer: Eric Joanis <joanis@cs.toronto.edu>
-" Last Change: 2004 Jan 13
-
-" 2003 Dec 04
-" Initial Revision
-
-" 2004 Jan 13
-" Added the upper case accented characters, forgotten in the initial version.
-
-" All characters are given literally, conversion to another encoding (e.g.,
-" UTF-8) should work.
-scriptencoding latin1
-
-" Use this short name in the status line.
-let b:keymap_name = "canfr"
-
-loadkeymap
-< '
-> "
-/ é
-? É
-' è
-\" È
-\\ à
-| À
-[a â
-[e ê
-[i î
-[o ô
-[u û
-[A Â
-[E Ê
-[I Î
-[O Ô
-[U Û
-[[ ^
-{a ä
-{e ë
-{i ï
-{o ö
-{u ü
-{y ÿ
-{A Ä
-{E Ë
-{I Ï
-{O Ö
-{U Ü
-] ç
|