diff --git a/runtime/autoload/sqlcomplete.vim b/runtime/autoload/sqlcomplete.vim index f830965c41591f5768712958a4ec4c5e6c54e10a..9326c15bb3e5e105f31c289dd45e397284fd33d1 100644 --- a/runtime/autoload/sqlcomplete.vim +++ b/runtime/autoload/sqlcomplete.vim @@ -1,8 +1,8 @@ " Vim OMNI completion script for SQL " Language: SQL " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> -" Version: 14.0 -" Last Change: 2012 Dec 04 +" Version: 15.0 +" Last Change: 2013 May 13 " Homepage: http://www.vim.org/scripts/script.php?script_id=1572 " Usage: For detailed help " ":help sql.txt" @@ -11,6 +11,18 @@ " History " +" TODO +" - Jonas Enberg - if no table is found when using column completion +" look backwards to a FROM clause and find the first table +" and complete it. +" +" Version 15.0 (May 2013) +" - NF: Changed the SQL precached syntax items, omni_sql_precache_syntax_groups, +" to use regular expressions to pick up extended syntax group names. +" This requires an updated SyntaxComplete plugin version 13.0. +" If the required versions have not been installed, previous +" behaviour will not be impacted. +" " Version 14.0 (Dec 2012) " - BF: Added check for cpo " @@ -91,7 +103,7 @@ endif if exists('g:loaded_sql_completion') finish endif -let g:loaded_sql_completion = 130 +let g:loaded_sql_completion = 150 let s:keepcpo= &cpo set cpo&vim @@ -110,12 +122,14 @@ let s:syn_value = [] " Used in conjunction with the syntaxcomplete plugin let s:save_inc = "" let s:save_exc = "" -if exists('g:omni_syntax_group_include_sql') - let s:save_inc = g:omni_syntax_group_include_sql +if !exists('g:omni_syntax_group_include_sql') + let g:omni_syntax_group_include_sql = '' endif -if exists('g:omni_syntax_group_exclude_sql') - let s:save_exc = g:omni_syntax_group_exclude_sql +if !exists('g:omni_syntax_group_exclude_sql') + let g:omni_syntax_group_exclude_sql = '' endif +let s:save_inc = g:omni_syntax_group_include_sql +let s:save_exc = g:omni_syntax_group_exclude_sql " Used with the column list let s:save_prev_table = "" @@ -127,12 +141,12 @@ endif " Default syntax items to precache if !exists('g:omni_sql_precache_syntax_groups') let g:omni_sql_precache_syntax_groups = [ - \ 'syntax', - \ 'sqlKeyword', - \ 'sqlFunction', - \ 'sqlOption', - \ 'sqlType', - \ 'sqlStatement' + \ 'syntax\w*', + \ 'sqlKeyword\w*', + \ 'sqlFunction\w*', + \ 'sqlOption\w*', + \ 'sqlType\w*', + \ 'sqlStatement\w*' \ ] endif " Set ignorecase to the ftplugin standard @@ -621,19 +635,23 @@ function! s:SQLCGetSyntaxList(syn_group) " Return previously cached value let compl_list = s:syn_value[list_idx] else + let s:save_inc = g:omni_syntax_group_include_sql + let s:save_exc = g:omni_syntax_group_exclude_sql + let g:omni_syntax_group_include_sql = '' + let g:omni_syntax_group_exclude_sql = '' + " Request the syntax list items from the " syntax completion plugin if syn_group == 'syntax' " Handle this special case. This allows the user " to indicate they want all the syntax items available, " so do not specify a specific include list. - let g:omni_syntax_group_include_sql = '' + let syn_value = syntaxcomplete#OmniSyntaxList() else " The user has specified a specific syntax group let g:omni_syntax_group_include_sql = syn_group + let syn_value = syntaxcomplete#OmniSyntaxList(syn_group) endif - let g:omni_syntax_group_exclude_sql = '' - let syn_value = syntaxcomplete#OmniSyntaxList() let g:omni_syntax_group_include_sql = s:save_inc let g:omni_syntax_group_exclude_sql = s:save_exc " Cache these values for later use diff --git a/runtime/autoload/syntaxcomplete.vim b/runtime/autoload/syntaxcomplete.vim index e3ea0e2d81b2de816d27f3f972eb936671307009..a18c3c360c02dfe20da020c2f624cd7a0d6094e8 100644 --- a/runtime/autoload/syntaxcomplete.vim +++ b/runtime/autoload/syntaxcomplete.vim @@ -1,18 +1,34 @@ " Vim completion script " Language: All languages, uses existing syntax highlighting rules " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> -" Version: 11.0 -" Last Change: 2012 Dec 04 +" Version: 13.0 +" Last Change: 2013 May 14 " Usage: For detailed help, ":help ft-syntax-omni" " History " +" Version 13.0 +" - Extended the option omni_syntax_group_include_{filetype} +" to accept a comma separated list of regex's rather than +" string. For example, for the javascript filetype you could +" use: +" let g:omni_syntax_group_include_javascript = 'javascript\w\+,jquery\w\+' +" - Some syntax files (perl.vim) use the match // syntax as a mechanism +" to identify keywords. This update attempts to parse the +" match syntax and pull out syntax items which are at least +" 3 words or more. +" +" Version 12.0 +" - It is possible to have '-' as part of iskeyword, when +" checking for character ranges, tighten up the regex. +" E688: More targets than List items. +" " Version 11.0 -" Corrected which characters required escaping during +" - Corrected which characters required escaping during " substitution calls. " " Version 10.0 -" Cycle through all the character ranges specified in the +" - Cycle through all the character ranges specified in the " iskeyword option and build a list of valid word separators. " Prior to this change, only actual characters were used, " where for example ASCII "45" == "-". If "45" were used @@ -20,30 +36,30 @@ " This introduces a new option, since the character ranges " specified could be multibyte: " let g:omni_syntax_use_single_byte = 1 -" This by default will only allow single byte ASCII +" - This by default will only allow single byte ASCII " characters to be added and an additional check to ensure " the charater is printable (see documentation for isprint). " " Version 9.0 -" Add the check for cpo. +" - Add the check for cpo. " " Version 8.0 -" Updated SyntaxCSyntaxGroupItems() +" - Updated SyntaxCSyntaxGroupItems() " - Some additional syntax items were also allowed " on nextgroup= lines which were ignored by default. " Now these lines are processed independently. " " Version 7.0 -" Updated syntaxcomplete#OmniSyntaxList() +" - Updated syntaxcomplete#OmniSyntaxList() " - Looking up the syntax groups defined from a syntax file " looked for only 1 format of {filetype}GroupName, but some " syntax writers use this format as well: " {b:current_syntax}GroupName -" OmniSyntaxList() will now check for both if the first +" - OmniSyntaxList() will now check for both if the first " method does not find a match. " " Version 6.0 -" Added syntaxcomplete#OmniSyntaxList() +" - Added syntaxcomplete#OmniSyntaxList() " - Allows other plugins to use this for their own " purposes. " - It will return a List of all syntax items for the @@ -52,7 +68,7 @@ " sqlcomplete plugin to populate a Choose box. " " Version 5.0 -" Updated SyntaxCSyntaxGroupItems() +" - Updated SyntaxCSyntaxGroupItems() " - When processing a list of syntax groups, the final group " was missed in function SyntaxCSyntaxGroupItems. " @@ -70,7 +86,7 @@ endif if exists('g:loaded_syntax_completion') finish endif -let g:loaded_syntax_completion = 110 +let g:loaded_syntax_completion = 130 " Turn on support for line continuations when creating the script let s:cpo_save = &cpo @@ -113,7 +129,8 @@ endif " This script will build a completion list based on the syntax " elements defined by the files in $VIMRUNTIME/syntax. -let s:syn_remove_words = 'match,matchgroup=,contains,'. +" let s:syn_remove_words = 'match,matchgroup=,contains,'. +let s:syn_remove_words = 'matchgroup=,contains,'. \ 'links to,start=,end=' " \ 'links to,start=,end=,nextgroup=' @@ -275,9 +292,19 @@ function! OmniSyntaxList(...) " sqlType " sqlOperators " sqlKeyword ... - redir @l - silent! exec 'syntax list '.join(list_parms) - redir END + if !empty(list_parms) && empty(substitute(join(list_parms), '[a-zA-Z ]', '', 'g')) + " If list_parms only includes word characters, use it to limit + " the syntax elements. + " If using regex syntax list will fail to find those items, so + " simply grab the who syntax list. + redir @l + silent! exec 'syntax list '.join(list_parms) + redir END + else + redir @l + silent! exec 'syntax list' + redir END + endif let syntax_full = "\n".@l let @l = saveL @@ -311,82 +338,167 @@ function! OmniSyntaxList(...) endif endif - " Sometimes filetypes can be composite names, like c.doxygen - " Loop through each individual part looking for the syntax - " items specific to each individual filetype. + if empty(list_parms) + let list_parms = [&filetype.'\w\+'] + endif + let syn_list = '' - let ftindex = 0 - let ftindex = match(&filetype, '\w\+', ftindex) - - while ftindex > -1 - let ft_part_name = matchstr( &filetype, '\w\+', ftindex ) - - " Syntax rules can contain items for more than just the current - " filetype. They can contain additional items added by the user - " via autocmds or their vimrc. - " Some syntax files can be combined (html, php, jsp). - " We want only items that begin with the filetype we are interested in. - let next_group_regex = '\n' . - \ '\zs'.ft_part_name.'\w\+\ze'. - \ '\s\+xxx\s\+' - let index = 0 - let index = match(syntax_full, next_group_regex, index) - - if index == -1 && exists('b:current_syntax') && ft_part_name != b:current_syntax - " There appears to be two standards when writing syntax files. - " Either items begin as: - " syn keyword {filetype}Keyword values ... - " let b:current_syntax = "sql" - " let b:current_syntax = "sqlanywhere" - " Or - " syn keyword {syntax_filename}Keyword values ... - " let b:current_syntax = "mysql" - " So, we will make the format of finding the syntax group names - " a bit more flexible and look for both if the first fails to - " find a match. + let index = 0 + for group_regex in list_parms + " Sometimes filetypes can be composite names, like c.doxygen + " Loop through each individual part looking for the syntax + " items specific to each individual filetype. + " let ftindex = 0 + " let ftindex = match(syntax_full, group_regex, ftindex) + + " while ftindex > -1 + " let ft_part_name = matchstr( syntax_full, '\w\+', ftindex ) + + " Syntax rules can contain items for more than just the current + " filetype. They can contain additional items added by the user + " via autocmds or their vimrc. + " Some syntax files can be combined (html, php, jsp). + " We want only items that begin with the filetype we are interested in. let next_group_regex = '\n' . - \ '\zs'.b:current_syntax.'\w\+\ze'. + \ '\zs'.group_regex.'\ze'. \ '\s\+xxx\s\+' - let index = 0 let index = match(syntax_full, next_group_regex, index) - endif - - while index > -1 - let group_name = matchstr( syntax_full, '\w\+', index ) - let get_syn_list = 1 - for exclude_group_name in list_exclude_groups - if '\<'.exclude_group_name.'\>' =~ '\<'.group_name.'\>' - let get_syn_list = 0 - endif - endfor - - " This code is no longer needed in version 6.0 since we have - " augmented the syntax list command to only retrieve the syntax - " groups we are interested in. - " - " if get_syn_list == 1 - " if syntax_group_include_{filetype} != '' - " if '\<'.syntax_group_include_{filetype}.'\>' !~ '\<'.group_name.'\>' - " let get_syn_list = 0 - " endif - " endif - " endif - - if get_syn_list == 1 - " Pass in the full syntax listing, plus the group name we - " are interested in. - let extra_syn_list = s:SyntaxCSyntaxGroupItems(group_name, syntax_full) - let syn_list = syn_list . extra_syn_list . "\n" + " For the matched group name, strip off any of the regex special + " characters and see if we get a match with the current syntax + if index == -1 && exists('b:current_syntax') && substitute(group_regex, '[^a-zA-Z ]\+.*', '', 'g') !~ '^'.b:current_syntax + " There appears to be two standards when writing syntax files. + " Either items begin as: + " syn keyword {filetype}Keyword values ... + " let b:current_syntax = "sql" + " let b:current_syntax = "sqlanywhere" + " Or + " syn keyword {syntax_filename}Keyword values ... + " let b:current_syntax = "mysql" + " So, we will make the format of finding the syntax group names + " a bit more flexible and look for both if the first fails to + " find a match. + let next_group_regex = '\n' . + \ '\zs'.b:current_syntax.'\w\+\ze'. + \ '\s\+xxx\s\+' + let index = 0 + let index = match(syntax_full, next_group_regex, index) endif - let index = index + strlen(group_name) - let index = match(syntax_full, next_group_regex, index) - endwhile + while index > -1 + let group_name = matchstr( syntax_full, '\w\+', index ) - let ftindex = ftindex + len(ft_part_name) - let ftindex = match( &filetype, '\w\+', ftindex ) - endwhile + let get_syn_list = 1 + for exclude_group_name in list_exclude_groups + if '\<'.exclude_group_name.'\>' =~ '\<'.group_name.'\>' + let get_syn_list = 0 + endif + endfor + + " This code is no longer needed in version 6.0 since we have + " augmented the syntax list command to only retrieve the syntax + " groups we are interested in. + " + " if get_syn_list == 1 + " if syntax_group_include_{filetype} != '' + " if '\<'.syntax_group_include_{filetype}.'\>' !~ '\<'.group_name.'\>' + " let get_syn_list = 0 + " endif + " endif + " endif + + if get_syn_list == 1 + " Pass in the full syntax listing, plus the group name we + " are interested in. + let extra_syn_list = s:SyntaxCSyntaxGroupItems(group_name, syntax_full) + let syn_list = syn_list . extra_syn_list . "\n" + endif + + let index = index + strlen(group_name) + let index = match(syntax_full, next_group_regex, index) + endwhile + + " let ftindex = ftindex + len(ft_part_name) + " let ftindex = match( syntax_full, group_regex, ftindex ) + " endwhile + endfor + +" " Sometimes filetypes can be composite names, like c.doxygen +" " Loop through each individual part looking for the syntax +" " items specific to each individual filetype. +" let syn_list = '' +" let ftindex = 0 +" let ftindex = match(&filetype, '\w\+', ftindex) + +" while ftindex > -1 +" let ft_part_name = matchstr( &filetype, '\w\+', ftindex ) + +" " Syntax rules can contain items for more than just the current +" " filetype. They can contain additional items added by the user +" " via autocmds or their vimrc. +" " Some syntax files can be combined (html, php, jsp). +" " We want only items that begin with the filetype we are interested in. +" let next_group_regex = '\n' . +" \ '\zs'.ft_part_name.'\w\+\ze'. +" \ '\s\+xxx\s\+' +" let index = 0 +" let index = match(syntax_full, next_group_regex, index) + +" if index == -1 && exists('b:current_syntax') && ft_part_name != b:current_syntax +" " There appears to be two standards when writing syntax files. +" " Either items begin as: +" " syn keyword {filetype}Keyword values ... +" " let b:current_syntax = "sql" +" " let b:current_syntax = "sqlanywhere" +" " Or +" " syn keyword {syntax_filename}Keyword values ... +" " let b:current_syntax = "mysql" +" " So, we will make the format of finding the syntax group names +" " a bit more flexible and look for both if the first fails to +" " find a match. +" let next_group_regex = '\n' . +" \ '\zs'.b:current_syntax.'\w\+\ze'. +" \ '\s\+xxx\s\+' +" let index = 0 +" let index = match(syntax_full, next_group_regex, index) +" endif + +" while index > -1 +" let group_name = matchstr( syntax_full, '\w\+', index ) + +" let get_syn_list = 1 +" for exclude_group_name in list_exclude_groups +" if '\<'.exclude_group_name.'\>' =~ '\<'.group_name.'\>' +" let get_syn_list = 0 +" endif +" endfor + +" " This code is no longer needed in version 6.0 since we have +" " augmented the syntax list command to only retrieve the syntax +" " groups we are interested in. +" " +" " if get_syn_list == 1 +" " if syntax_group_include_{filetype} != '' +" " if '\<'.syntax_group_include_{filetype}.'\>' !~ '\<'.group_name.'\>' +" " let get_syn_list = 0 +" " endif +" " endif +" " endif + +" if get_syn_list == 1 +" " Pass in the full syntax listing, plus the group name we +" " are interested in. +" let extra_syn_list = s:SyntaxCSyntaxGroupItems(group_name, syntax_full) +" let syn_list = syn_list . extra_syn_list . "\n" +" endif + +" let index = index + strlen(group_name) +" let index = match(syntax_full, next_group_regex, index) +" endwhile + +" let ftindex = ftindex + len(ft_part_name) +" let ftindex = match( &filetype, '\w\+', ftindex ) +" endwhile " Convert the string to a List and sort it. let compl_list = sort(split(syn_list)) @@ -454,10 +566,65 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) \ , "\n", 'g' \ ) + " Attempt to deal with lines using the match syntax + " javaScriptDocTags xxx match /@\(param\|argument\|requires\|file\)\>/ + " Though it can use any types of regex, so this plugin will attempt + " to restrict it + " 1. Only use \( or \%( constructs remove all else + " 2 Remove and []s + " 3. Account for match //constructs + " \%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\? + " 4. Hope for the best + " + " + let syn_list_old = syn_list + while syn_list =~ '\<match\>\s\+\/' + if syn_list =~ 'perlElseIfError' + let syn_list = syn_list + endif + " Check if the match has words at least 3 characters long + if syn_list =~ '\<match \/\zs.\{-}\<\w\{3,}\>.\{-}\ze\\\@<!\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+' + " Remove everything after / and before the first \( + let syn_list = substitute( syn_list, '\<match \/\zs.\{-}\ze\\%\?(.\{-}\\\@<!\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '', 'g' ) + " Remove everything after \) and up to the ending / + let syn_list = substitute( syn_list, '\<match \/.\{-}\\)\zs.\{-}\ze\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '', 'g' ) + + " Remove any character classes + " let syn_list = substitute( syn_list, '\<match /\zs.\{-}\[[^]]*\].\{-}\ze\/ ', '', 'g' ) + let syn_list = substitute( syn_list, '\%(\<match \/[^/]\{-}\)\@<=\[[^]]*\]\ze.\{-}\\\@<!\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?', '', 'g' ) + " Remove any words < 3 characters + let syn_list = substitute( syn_list, '\%(\<match \/[^/]\{-}\)\@<=\<\w\{1,2}\>\ze.\{-}\\\@<!\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '', 'g' ) + " Remove all non-word characters + " let syn_list = substitute( syn_list, '\<match /\zs.\{-}\<\W\+\>.\{-}\ze\/ ', "", 'g' ) + " let syn_list = substitute( syn_list, '\%(\<match \/[^/]\{-}\)\@<=\W\+\ze.\{-}\/ ', ' ', 'g' ) + " Do this by using the outer substitue() call to gather all + " text between the match /.../ tags. + " The inner substitute() call operates on the text selected + " and replaces all non-word characters. + let syn_list = substitute( syn_list, '\<match \/\zs\(.\{-}\)\ze\\\@<!\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+' + \ , '\=substitute(submatch(1), "\\W\\+", " ", "g")' + \ , 'g' ) + " Remove the match / / syntax + let syn_list = substitute( syn_list, '\<match \/\(.\{-}\)\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '\1', 'g' ) + else + " No words long enough, remove the match + " Remove the match syntax + " let syn_list = substitute( syn_list, '\<match \/[^\/]*\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '', 'g' ) + let syn_list = substitute( syn_list, '\<match \/\%(.\{-}\)\?\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '', 'g' ) + endif + if syn_list =~ '\<match\>\s\+\/' + " Problem removing the match / / tags + let syn_list = '' + endif + endwhile + + " Now strip off the newline + blank space + contained. " Also include lines with nextgroup=@someName skip_key_words syntax_element + " \ syn_list, '\%(^\|\n\)\@<=\s*\<\(contained\|nextgroup=\)' + " \ syn_list, '\%(^\|\n\)\@<=\s*\<\(contained\|nextgroup=[@a-zA-Z,]*\)' let syn_list = substitute( - \ syn_list, '\%(^\|\n\)\@<=\s*\<\(contained\|nextgroup=\)' + \ syn_list, '\<\(contained\|nextgroup=[@a-zA-Z,]*\)' \ , "", 'g' \ ) @@ -497,7 +664,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) " If so, add it to the list. let accepted_chars = '' for item in split(&iskeyword, ',') - if item =~ '-' + if item =~ '\d-\d' " This is a character range (ie 47-58), " cycle through each character within the range let [b:start, b:end] = split(item, '-') diff --git a/runtime/compiler/msbuild.vim b/runtime/compiler/msbuild.vim new file mode 100644 index 0000000000000000000000000000000000000000..3652ca0e0412e01ca105bd31e8b858fa524e14d7 --- /dev/null +++ b/runtime/compiler/msbuild.vim @@ -0,0 +1,21 @@ +" Vim compiler file +" Compiler: Microsoft Visual Studio C# +" Maintainer: Chiel ten Brinke (ctje92@gmail.com) +" Last Change: 2013 May 13 + +if exists("current_compiler") + finish +endif +let current_compiler = "msbuild" +let s:keepcpo= &cpo +set cpo&vim + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +CompilerSet errorformat=\ %#%f(%l\\\,%c):\ %m +CompilerSet makeprg=msbuild\ /nologo\ /v:q\ /property:GenerateFullPaths=true + +let &cpo = s:keepcpo +unlet s:keepcpo diff --git a/runtime/compiler/xbuild.vim b/runtime/compiler/xbuild.vim new file mode 100644 index 0000000000000000000000000000000000000000..b508a4616ac6736cb6585cafff6ee7b6ca21e9e6 --- /dev/null +++ b/runtime/compiler/xbuild.vim @@ -0,0 +1,22 @@ +" Vim compiler file +" Compiler: Mono C# +" Maintainer: Chiel ten Brinke (ctje92@gmail.com) +" Last Change: 2013 May 13 + +if exists("current_compiler") + finish +endif + +let current_compiler = "xbuild" +let s:keepcpo= &cpo +set cpo&vim + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +CompilerSet errorformat=\ %#%f(%l\\\,%c):\ %m +CompilerSet makeprg=xbuild\ /nologo\ /v:q\ /property:GenerateFullPaths=true + +let &cpo = s:keepcpo +unlet s:keepcpo diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 0b747084d507469cfc3923f2eea78cf70fa3bc9c..2114ff444fbca3c42c9326417f5583bd389170e0 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.3. Last change: 2013 May 06 +*eval.txt* For Vim version 7.3. Last change: 2013 May 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1171,7 +1171,7 @@ b:changedtick The total number of changes to the current buffer. It is A variable name that is preceded with "w:" is local to the current window. It is deleted when the window is closed. - *tabpage-variable* *t:var* + *tabpage-variable* *t:var* *t:* A variable name that is preceded with "t:" is local to the current tab page, It is deleted when the tab page is closed. {not available when compiled without the |+windows| feature} diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt index b4ea5fd7b43736ddba533071a9a63901ef89dd8f..9aa711b1e03fd1a83c2938a3ad54c0a1c2d44823 100644 --- a/runtime/doc/ft_sql.txt +++ b/runtime/doc/ft_sql.txt @@ -1,4 +1,4 @@ -*ft_sql.txt* For Vim version 7.3. Last change: 2013 Apr 05 +*ft_sql.txt* For Vim version 7.3. Last change: 2013 May 15 by David Fishburn @@ -349,6 +349,7 @@ may not work properly on all platforms: > The static maps (which are based on the syntax highlight groups) follow this format: > imap <buffer> <C-C>k <C-\><C-O>:call sqlcomplete#Map('sqlKeyword')<CR><C-X><C-O> + imap <buffer> <C-C>k <C-\><C-O>:call sqlcomplete#Map('sqlKeyword\w*')<CR><C-X><C-O> This command breaks down as: > imap - Create an insert map @@ -369,6 +370,9 @@ This command breaks down as: > command while editing a SQL file. 'sqlKeyword' - Display the items for the sqlKeyword highlight group + 'sqlKeyword\w*' - A second option available with Vim 7.4 which + uses a regular expression to determine which + syntax groups to use )<CR> - Execute the :let command <C-X><C-O> - Trigger the standard omni completion key stroke. Passing in 'sqlKeyword' instructs the SQL diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index a2c949e34bc830850a7079ca8a6ceb02421dfb03..a94183f5b3ebcdb15b6cb133df685729001c9283 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -1,4 +1,4 @@ -*if_pyth.txt* For Vim version 7.3. Last change: 2013 May 06 +*if_pyth.txt* For Vim version 7.3. Last change: 2013 May 17 VIM REFERENCE MANUAL by Paul Moore diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 5456611d7898d7d6f045e4bab0e2f83247e7c802..6b8d445e47af4593ec61c21432d430a0b9006c80 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 7.3. Last change: 2013 May 06 +*index.txt* For Vim version 7.3. Last change: 2013 May 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1403,8 +1403,10 @@ tag command action ~ |:pwd| :pw[d] print current directory |:py3| :py3 execute Python 3 command |:python3| :python3 same as :py3 +|:py3do| :py3d[o] execute Python 3 command for each line |:py3file| :py3f[ile] execute Python 3 script file |:python| :py[thon] execute Python command +|:pydo| :pyd[o] execute Python command for each line |:pyfile| :pyf[ile] execute Python script file |:quit| :q[uit] quit current window (when one window quit Vim) |:quitall| :quita[ll] quit Vim diff --git a/runtime/doc/pi_paren.txt b/runtime/doc/pi_paren.txt index dfa2e71505c366b9cca508bd0ac5b3b1fef1967e..71727aa052ca4998c0fd0a124aaad332c9f1bd08 100644 --- a/runtime/doc/pi_paren.txt +++ b/runtime/doc/pi_paren.txt @@ -1,4 +1,4 @@ -*pi_paren.txt* For Vim version 7.3. Last change: 2008 Jun 16 +*pi_paren.txt* For Vim version 7.3. Last change: 2013 May 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -46,7 +46,10 @@ are: closed folds. - 'synmaxcol' times 2 bytes before or after the cursor to avoid a delay in a long line with syntax highlighting. - +- A timeout of 300 msec (60 msec in Insert mode). This can be changed with the + g:matchparen_timeout and g:matchparen_insert_timeout variables and their + buffer-local equivalents b:matchparen_timeout and + b:matchparen_insert_timeout. If you would like the |%| command to work better, the matchit plugin can be used, see |matchit-install|. This plugin also helps to skip matches in diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 842141f3c39ad1a4c22e36d10c617393a998b4eb..39c7839f425927d46f615fbc560c95a2965f0ffe 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1239,17 +1239,17 @@ to your startup file. ERLANG *erlang.vim* *ft-erlang-syntax* -The erlang highlighting supports Erlang (ERicsson LANGuage). -Erlang is case sensitive and default extension is ".erl". - -If you want to disable keywords highlighting, put in your .vimrc: > - :let erlang_keywords = 1 -If you want to disable built-in-functions highlighting, put in your -.vimrc file: > - :let erlang_functions = 1 -If you want to disable special characters highlighting, put in -your .vimrc: > - :let erlang_characters = 1 +Erlang is a functional programming language developed by Ericsson. Files with +the following extentions are recognized as Erlang files: erl, hrl, yaws. + +The BIFs (built-in functions) are highlighted by default. To disable this, +put the following line in your vimrc: > + + :let g:erlang_highlight_bifs = 0 + +To enable highlighting some special atoms, put this in your vimrc: > + + :let g:erlang_highlight_special_atoms = 1 FLEXWIKI *flexwiki.vim* *ft-flexwiki-syntax* diff --git a/runtime/doc/tags b/runtime/doc/tags index 2775e880f8306feed1811da616c04dd7a2f5f3b7..9af196ae468b45ee831d8c4ee0cb9c93e5740c96 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -2590,7 +2590,9 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :pwd editing.txt /*:pwd* :py if_pyth.txt /*:py* :py3 if_pyth.txt /*:py3* +:py3do if_pyth.txt /*:py3do* :py3file if_pyth.txt /*:py3file* +:pydo if_pyth.txt /*:pydo* :pyf if_pyth.txt /*:pyf* :pyfile if_pyth.txt /*:pyfile* :python if_pyth.txt /*:python* @@ -4258,6 +4260,7 @@ E86 windows.txt /*E86* E860 eval.txt /*E860* E861 eval.txt /*E861* E862 eval.txt /*E862* +E863 if_pyth.txt /*E863* E87 windows.txt /*E87* E88 windows.txt /*E88* E89 message.txt /*E89* @@ -7336,6 +7339,8 @@ python-options if_pyth.txt /*python-options* python-output if_pyth.txt /*python-output* python-pyeval if_pyth.txt /*python-pyeval* python-range if_pyth.txt /*python-range* +python-tabpage if_pyth.txt /*python-tabpage* +python-tabpages if_pyth.txt /*python-tabpages* python-vars if_pyth.txt /*python-vars* python-vim if_pyth.txt /*python-vim* python-vvars if_pyth.txt /*python-vvars* @@ -7851,6 +7856,7 @@ system-functions usr_41.txt /*system-functions* system-vimrc starting.txt /*system-vimrc* s~ change.txt /*s~* t motion.txt /*t* +t: eval.txt /*t:* t:var eval.txt /*t:var* t_#2 term.txt /*t_#2* t_#4 term.txt /*t_#4* diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index de0313cfdfe1821bfa7db5603c69f4b095ed465d..efeb0ffd6e7b37fb7f83dd996aebbedae15f5d3b 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -328,7 +328,7 @@ Note: Use the <> form if possible t_k8 <F8> function key 8 *<F8>* *t_k8* *'t_k8'* t_k9 <F9> function key 9 *<F9>* *t_k9* *'t_k9'* t_k; <F10> function key 10 *<F10>* *t_k;* *'t_k;'* - t_F1 <F11> function key 11 *<F11>* *t_F1* *'t_F1'* + t_F1 <F11> function key 11 *<F11>* *t_F1* *'t_F1'* t_F2 <F12> function key 12 *<F12>* *t_F2* *'t_F2'* t_F3 <F13> function key 13 *<F13>* *t_F3* *'t_F3'* t_F4 <F14> function key 14 *<F14>* *t_F4* *'t_F4'* @@ -358,9 +358,9 @@ Note: Use the <> form if possible t_kI <Insert> insert key *t_kI* *'t_kI'* t_kD <Del> delete key *t_kD* *'t_kD'* t_kb <BS> backspace key *t_kb* *'t_kb'* - t_kB <S-Tab> back-tab (shift-tab) *<S-Tab>* *t_kB* *'t_kB'* + t_kB <S-Tab> back-tab (shift-tab) *<S-Tab>* *t_kB* *'t_kB'* t_kh <Home> home key *t_kh* *'t_kh'* - t_#2 <S-Home> shifted home key *<S-Home>* *t_#2* *'t_#2'* + t_#2 <S-Home> shifted home key *<S-Home>* *t_#2* *'t_#2'* <xHome> alternate home key *<xHome>* t_@7 <End> end key *t_@7* *'t_@7'* t_*7 <S-End> shifted end key *<S-End>* *t_star7* *'t_star7'* @@ -373,8 +373,8 @@ Note: Use the <> form if possible t_K5 <kPageDown> keypad page-down key *t_K5* *'t_K5'* t_K6 <kPlus> keypad plus key *<kPlus>* *t_K6* *'t_K6'* t_K7 <kMinus> keypad minus key *<kMinus>* *t_K7* *'t_K7'* - t_K8 <kDivide> keypad divide *<kDivide>* *t_K8* *'t_K8'* - t_K9 <kMultiply> keypad multiply *<kMultiply>* *t_K9* *'t_K9'* + t_K8 <kDivide> keypad divide *<kDivide>* *t_K8* *'t_K8'* + t_K9 <kMultiply> keypad multiply *<kMultiply>* *t_K9* *'t_K9'* t_KA <kEnter> keypad enter key *<kEnter>* *t_KA* *'t_KA'* t_KB <kPoint> keypad decimal point *<kPoint>* *t_KB* *'t_KB'* t_KC <k0> keypad 0 *<k0>* *t_KC* *'t_KC'* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 2cfe63c0d7bea481d4b89d611f67432f213a4d60..8b417de1b52aae4bcc413dbf94b12bd45428fac8 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.3. Last change: 2013 May 06 +*todo.txt* For Vim version 7.3. Last change: 2013 May 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,6 +34,134 @@ not be repeated below, unless there is extra information. *known-bugs* -------------------- Known bugs and current work ----------------------- +--- Python interface + +Python SystemExit exception is not handled properly. Patch to catch the +exception and give an error. (Yasuhiro Matsumoto) +Does not work, tests fail. + +Patch to print the result of a :python command. (Maxim Philippov +<philippovmi@gmail.com>, 2012 Aug 16) Update Aug 17. +Patch no longer applies. + +":python os.chdir('/tmp')" makes short buffer names invalid. (Xavier de Gaye) +Check directory and call shorten_fnames()? Better: make os.chdir() +invoke the interal :cd implementation, that takes care of all side +effects. + +Mac: OS/X 10.4 with Python 2.5 installed: configure finds an extra argument +that breaks the build. (Brian Victor, 2008 Sep 1) + +Patch to access screen under Python. (Marko Mahni, 2010 Jul 18) + +Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) + +Win32: The Python interface only works with one version of Python, selected at +compile time. Can this be made to work with version 2.1 and 2.2 dynamically? + +Python: Be able to define a Python function that can be called directly from +Vim script. Requires converting the arguments and return value. + +--- runtime files + +Syntax file for protocol buffers. (Feng Xiao, 2013 May 9) +Has an ugly copyright notice. No conflict with Vim license? + +Patch for JavaScript syntax. (Kevin Locke, 2013 May 9) +Claudio didn't respond yet. + +--- Fast regexp engine + +Including NFA regexp code. Latest version probably is: +https://code.google.com/p/vim-soc2008-regexp/source/browse/trunk/vim72-re/src/regexp_nfa.c +Patch updated by Ken Takata. (May 13) + +To be able to run tests: +- set defaultre=old / nfa / auto +- In pattern use "\%#= to set the engine: 0 = automatic, 1 = old 2 = nfa + +Get example files for many languages. Compare syntax highlighting with old and +new regexp, find regexp constructs where NFA does not work correctly. +Idea for comparing output: use format.vim (ZyX, 2013 May 12) +MakeSynChk from Charles Campbell. (May 14) + +Performance tests: +- ~/vim/test/veryslow.js (file from Daniel Fetchinson) +- ~/vim/test/slowsearch +- ~/vim/test/rgb.vim +- ~/vim/text/FeiqCfg.xml (file from Netjune) +- ~/vim/text/edl.svg (also XML) +- search for a.*e*exn in the vim executable. Go to last line to use + 'hlsearch'. + +--- bug fixes + +Patch to avoid wrong error message for 1.0[0]. (Yasuhiro Matsumoto, 2013 May +1) + +Patch for if_lua. (Luis Carvalho, 2012 Aug 26, update Aug 29, another Aug 30, +then Sep 1, reminder Oct 14) + +Patch to check if 'foldexpr' sets did_emsg. (Christian Brabandt, 2013 Mar 20) + +Patch for 'backupcopy' default behavior for symlinks on Windows. (David Pope, +2012 Mar 21, update Mar 31) +With fix for memory leak: Ken Takata, 2012 Aug 24 +Another update Sep 24. +Also patch from Joerg Bornemann, 2013 Apr 30. + +Undo problem: line not removed as expected when using setline() from Insert +mode. (Israel Chauca, 2010 May 13, more in second msg) +Break undo when CTRL-R = changes the text? Or save more lines? +Patch by Christian Brabandt, 2012 Nov 16. + +Do allow real tags above the !_TAG entries. Undo older patch. Issue 90. + +Matches might be highlighted correctly. Inefficient patch by Christian +Brabandt, 2013 Feb 26. + +Patch to use bold/italic fonts when 'guifontewide' is set. (Ken Takata, 2013 +Mar 31) + +Problem with winfixheight and resizing. (Yukihiro Nakadaira, 2011 Sep 17) +Patch Sep 18. + +Patch for IME problems. Remove hacking code for old IM. (Yukihiro Nakadaira, +2012 Jul 20) + +Patch to fix finding toolbar bitmaps. Issue 129. + +Combining characters are not used when executing a register with :@w. +(William Fugh, 2013 Apr 5, more info from Ben Fritz) +Patch by Christian Brabandt, 2013 Apr 6. Second one. + +MS-Windows ACL support doesn't work well. Patch from Ken Takata, 2012 Aug 29. +Update Aug 31. +Another patch for MingW, 2012 Dec 29. + +Bug in completion menu. (Olivier Teuliere, 2013 Feb 15) +Patch by Christian Brabandt, Feb 16. + +'cursorline' is drawn incorrectly in diff mode. Patch by Christian Brabandt, +2012 Apr 2. + +--- slightly incompatible changes + +Patch to load ~/.vim/vimrc when ~/.vimrc isn't found. (Lech Lorens, 2013 Apr +13) + +It's probably a good idea to make a negative value for 'sts' use the value of +'sw'. Patch by So8res, Oct 3 2012 + +When a buffer-local mapping is used, but a global mapping starts with the same +characters, Vim currently waits for the next typed character to find out if +the global mapping matches. It is probably better to let the local mapping +win and not wait. (discussion with Andy Wokula, 2013 Jan 30) +Patch by Michael Henry, 2013 Jan 30, update Feb 15. + + +---- Fixes to be included before 7.4 above, less important stuff below ---- + Several syntax file match "^\s*" which may get underlined if that's in the highlight group. Add a "\zs" after it? @@ -48,8 +176,6 @@ GTK: problem with 'L' in 'guioptions' changing the window width. Javascript file where indent gets stuck on: GalaxyMaster, 2012 May 3. -Nederlandse vertaling tutor. (Rob Bishoff, 2013 Apr 24) - The CompleteDone autocommand needs some info passed to it: - The word that was selected (empty if abandoned complete) - Type of completion: tag, omnifunc, user func. @@ -65,9 +191,6 @@ Win32: When a directory name contains an exclamation mark, completion doesn't complete the contents of the directory. No escaping for the "!"? (Jan Stocker, 2012 Jan 5) -Patch to load ~/.vim/vimrc when ~/.vimrc isn't found. (Lech Lorens, 2013 Apr -13) - Problem caused by patch 7.3.638: window->open does not update window correctly. Issue 91. @@ -76,90 +199,41 @@ Patch to fix that 'cedit' is recognized after :normal. (Christian Brabandt, Patch to view coverage of the tests. (Nazri Ramliy, 2013 Feb 15) -Patch to make vim.bindeval() in Python work. (Yukihiro Nakadaira, 2013 Mar 25) - -Patch to avoid wrong error message for 1.0[0]. (Yasuhiro Matsumoto, 2013 May -1) - Patch to invert characters differently in GTK. (Yukihiro Nakadaira, 2013 May 5) -Patch for 'backupcopy' default behavior for symlinks on Windows. (David Pope, -2012 Mar 21, update Mar 31) -With fix for memory leak: Ken Takata, 2012 Aug 24 -Another update Sep 24. -Also patch from Joerg Bornemann, 2013 Apr 30. - -Do allow real tags above the !_TAG entries. Undo older patch. Issue 90. - Patch to add the bufferlist() function. (Yegappan Lakshmanan, 2013 May 5) +Patch to allow setting w:quickfix_title via setqflist() and setloclist() +functions. (Christian Brabandt, 2013 May 8, update May 11) + Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep 28) With tests: Oct 9. +Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14) +Second one. + Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec) Patch for IME handling, adds 'imactivatefunc' and 'imstatusfunc' option. (Yukihiro Nakadaira, 2012 Aug 16) Patch to improve IME handling. (Yasuhiro Matsumoto, 2012 Jul 18) -Undo problem: line not removed as expected when using setline() from Insert -mode. (Israel Chauca, 2010 May 13, more in second msg) -Break undo when CTRL-R = changes the text? Or save more lines? -Patch by Christian Brabandt, 2012 Nov 16. - Issue 54: document behavior of -complete, also expands arg. -Python patch 7: move more to if_py_boty. (ZyX 2013 Apr 26) -Python patch 8: add vim.window.number. (ZyX 2013 Apr 26) -Python patch 9: remove useless calls.. (ZyX 2013 Apr 26) -Python patch 10: window position. (ZyX 2013 Apr 26) -Python patch 11: reorder code in if_py_both (ZyX 2013 Apr 28) -Python patch 12: fix SEGVs (ZyX 2013 Apr 28) -Python patch 13: negative indices were failing (ZyX 2013 Apr 28) -Python patch 14: tests for previous fixes (ZyX 2013 Apr 28) -Python patch 15: make buflist a bufmap (ZyX 2013 Apr 28) incompatible? -Python patch 16: fix name of FunctionType (ZyX 2013 Apr 28) -Python patch 17: add iterators (ZyX 2013 Apr 28) -Python patch 18: Python 2.2 support (ZyX 2013 Apr 28) -Python patch 19: drop support for old Pythons (ZyX 2013 Apr 28) -Python patch 20: tests for vim.buffers (ZyX 2013 Apr 28, second one) -Python patch 20a: tests for vim.bufferlist (ZyX 2013 May 1) -Python patch 21: add vim.tabpages and vim.current.tabpage (ZyX 2013 May 1) -Python patch 22: make KeyErrors use PyErr_SetObject (ZyX 2013 May 1) -Python patch 23: transform and clean python exceptions (ZyX 2013 May 1) -Python patch 24: add ability to assign to more vim.current attributes (ZyX - 2013 May 1) -Python patch 25: make vim.error Exception subclass (ZyX 2013 May 1) -Python patch 26: check whether PyObject_IsTrue failed (ZyX 2013 May 1) -Python patch 27: add tests for various python interfaces (ZyX 2013 May 1) - -Matches might be highlighted correctly. Inefficient patch by Christian -Brabandt, 2013 Feb 26. - - Add regex for 'paragraphs' and 'sections': 'parare' and 'sectre'. Combine the two into a regex for searching. (Ned Konz) Patch by Christian Brabandt, 2013 Apr 20, unfinished. -Patch to use bold/italic fonts when 'guifontewide' is set. (Ken Takata, 2013 -Mar 31) - -Patch to fix finding toolbar bitmaps. Issue 129. - -Patch to handle Python SystemExit. (Yasuhiro Matsumoto, 2013 Apr 15) +Bug: findfile("any", "http://;") returns http://any. (Andrew Pimlott, 2013 May +7) Not sure if that can be fixed, but when using "file://" it should be +possible to check if the file exists. v:register is not directly reset to " after a delete command that specifies a register. It is reset after the next command. (Steve Vermeulen, 2013 Mar 16) 'ff' is wrong for one-line file without EOL. (Issue 77) -Patch for if_lua. (Luis Carvalho, 2012 Aug 26, update Aug 29, another Aug 30, -then Sep 1, reminder Oct 14) - -Patch to check if 'foldexpr' sets did_emsg. (Christian Brabandt, 2013 Mar 20) - -No completion for :xmap and :smap. (Yukihiro Nakadaira, 2013 May 5) - Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14) Needs a different check for CLEARTYPE_QUALITY. @@ -172,21 +246,8 @@ a reboot. MS-Windows: Crash opening very long file name starting with "\\". (Christian Brock, 2012 Jun 29) -It's probably a good idea to make a negative value for 'sts' use the value of -'sw'. Patch by So8res, Oct 3 2012 - -Test 79 fails on Windows only. (Michael Soyka, 2013 Apr 11). -What makes the test script mapping continue after an error? - patch to add "combine" flag to syntax commands. (so8res, 2012 Dec 6) -Combining characters are not used when executing a register with :@w. -(William Fugh, 2013 Apr 5, more info from Ben Fritz) -Patch by Christian Brabandt, 2013 Apr 6. Second one. - -Bug in completion menu. (Olivier Teuliere, 2013 Feb 15) -Patch by Christian Brabandt, Feb 16. - Syntax update problem in one buffer opened in two windows, bottom window is not correctly updated. (Paul Harris, 2012 Feb 27) @@ -201,7 +262,7 @@ Patch to make confirm() display colors. (Christian Brabandt, 2012 Nov 9) Patch to add functions for signs. (Christian Brabandt, 2013 Jan 27) Patch to use directX to draw text on Windows. Adds the 'renderoptions' -option. (Taro Muraoka, 2013 Jan 25, update 2013 Apr 3) +option. (Taro Muraoka, 2013 Jan 25, update 2013 Apr 3, May 14) Problem with refresh:always in completion. (Tyler Wade, 2013 Mar 17) @@ -227,10 +288,6 @@ Szamotulski, 2012 Nov 8) Crash in autocmd that unloads buffers in a BufUnload event. (Andrew Pimlott, 2012 Aug 11) Disallow :new when BufUnload is being handled? -MS-Windows ACL support doesn't work well. Patch from Ken Takata, 2012 Aug 29. -Update Aug 31. -Another patch for MingW, 2012 Dec 29. - MS-Windows resizing problems: - Windows window on screen positioning: Patch by Yukihiro Nakadaira, 2012 Jun 20. Uses getWindowRect() instead of GetWindowPlacement() @@ -240,7 +297,7 @@ MS-Windows resizing problems: 'iminsert' global value set when using ":setlocal iminsert"? (Wu, 2012 Jun 23) -Patch to append regesp to tag commands to make it possible to select one out +Patch to append regexp to tag commands to make it possible to select one out of many matches. (Cody Cutler, 2013 Mar 28) Help for 'b:undo_indent'. (Thilo Six, 2012 May 28) @@ -281,18 +338,9 @@ Patch to list user digraphs. (Christian Brabandt, 2012 Apr 14) Patch for input method status. (Hirohito Higashi, 2012 Apr 18) -Patch to print the result of a :python command. (Maxim Philippov -<philippovmi@gmail.com>, 2012 Aug 16) Update Aug 17. - Patch to use .png icons for the toolbar on MS-Windows. (Martin Gieseking, 2013 Apr 18) -Problem with winfixheight and resizing. (Yukihiro Nakadaira, 2011 Sep 17) -Patch Sep 18. - -Patch for IME problems. Remove hacking code for old IM. (Yukihiro Nakadaira, -2012 Jul 20) - Patch for has('unnamedplus') docs. (Tony Mechelynck, 2011 Sep 27) And one for gui_x11.txt. @@ -325,16 +373,11 @@ Nov 20) Patch to improve GUI find/replace dialog. (Christian Brabandt, 2012 May 26) Update Jun 2. -Patch to add ":py3do". (Lilydjwg, 2012 Apr 7) - `] moves to character after insert, instead of the last inserted character. (Yukihiro Nakadaira, 2011 Dec 9) Plugin for Modeleasy. (Massimiliano Tripoli, 2011 Nov 29) -Updated syntax file for ssh_config, maintainer doesn't respond. -(Leonard Ehrenfried, 2011 Sep 26) - BufWinLeave triggers too late when quitting last window in a tab page. (Lech Lorens, 2012 Feb 21) @@ -364,15 +407,9 @@ Syntax region with 'concealends' and a 'cchar' value, 'conceallevel' set to 2, only one of the two ends gets the cchar displayed. (Brett Stahlman, 2010 Aug 21, Ben Fritz, 2010 Sep 14) -'cursorline' is drawn incorrectly in diff mode. Patch by Christian Brabandt, -2012 Apr 2. - 'cursorline' works on a text line only. Add 'cursorscreenline' for highlighting the screen line. (Christian Brabandt, 2012 Mar 31) -Win32: Does building a 64 bit version with VC9 give warnings for int -conversions? (Mike Williams) - Win32: Patch to use task dialogs when available. (Sergiu Dotenco, 2011 Sep 17) New feature, requires testing. Made some remarks. @@ -452,12 +489,6 @@ string() can't parse back "inf" and "nan". Fix documentation or fix code? Make 'formatprg' global-local. (Sung Pae) -When a buffer-local mapping is used, but a global mapping starts with the same -characters, Vim currently waits for the next typed character to find out if -the global mapping matches. It is probably better to let the local mapping -win and not wait. (discussion with Andy Wokula, 2013 Jan 30) -Patch by Michael Henry, 2013 Jan 30, update Feb 15. - When doing "redir => s:foo" in a script and then "redir END" somewhere else (e.g. in a function) it can't find s:foo. @@ -584,9 +615,6 @@ the command line. (Ingo Karkat, 2011 Jan 25) Since patch 7.2.46 Yankring plugin has become very slow, eventually make Vim crash? (Raiwil, 2010 Nov 17) -Python: Adding line to buffer other than the current one doesn't work -correctly. (Rozbujnik, 2010 Dec 19) - Patch to add 'systemencoding', convert between 'encoding' and this for file names, shell commands and the like. (Kikuchan, 2010 Oct 14) Assume the system converts between the actual encoding of the filesystem to @@ -946,9 +974,6 @@ shellescape() depends on 'shellshash' for quoting. That doesn't work when Use a different option or let it depend on whether 'shell' looks like a unix-like shell? -Allow patches to add something to version.c, like with an official patch, so -that :version output shows which patches have been applied. - Bug: in Ex mode (after "Q") backslash before line break, when yanked into a register and executed, results in <Nul>: instead of line break. (Konrad Schwarz, 2010 Apr 16) @@ -1163,18 +1188,6 @@ Would be more consistent when an existing tab is re-used. (Tony Mechelynck) Add ":nofold". Range will apply without expanding to closed fold. -Including NFA regexp code: -Use "\%#= to set the engine: 0 = automatic, 1 = backtracking, 2 = new. -Useful in tests. -Performance tests: -- ~/vim/test/veryslow.js (file from Daniel Fetchinson) -- ~/vim/test/slowsearch -- ~/vim/test/rgb.vim -- ~/vim/text/FeiqCfg.xml (file from Netjune) -- ~/vim/text/edl.svg (also XML) -- search for a.*e*exn in the vim executable. Go to last line to use - 'hlsearch'. - Using Aap to build Vim: add remarks about how to set personal preferences. Example on http://www.calmar.ws/tmp/aap.html @@ -1407,9 +1420,6 @@ if_ruby.c. ":helpgrep" should use the directory from 'helpfile'. -Patch to dynamically load Python on Solaris. (Danek Duvall, 2009 Feb 16) -Needs more work. - The need_fileinfo flag is messy. Instead make the message right away and put it in keep_msg? @@ -1451,9 +1461,6 @@ When doing ":quit" the Netbeans "killed" event isn't sent. (Xavier de Gaye, 2008 Nov 10) call netbeans_file_closed() at the end of buf_freeall(), or in all places where buf_freeall() is called? -":python os.chdir('/tmp')" makes short buffer names invalid. (Xavier de Gaye) -Check directory and call shorten_fnames()? - aucmd_prepbuf() should also use a window in another tab page. When unloading a buffer in a BufHidden autocommand the hidden flag is reset? @@ -1489,9 +1496,6 @@ somehow? Or use a new function. Mac: Using gvim: netrw window disappears. (Nick Lo, 2006 Jun 21) -Mac: OS/X 10.4 with Python 2.5 installed: configure finds an extra argument -that breaks the build. (Brian Victor, 2008 Sep 1) - Add an option to specify the character to use when a double-width character is moved to the next line. Default '>', set to a space to blank it out. Check that char is single width when it's set (compare with 'listchars'). @@ -1778,7 +1782,6 @@ More patches: more friendly for the Vim distribution. New version received 2008 Jan 6. No maintenance in two years... -- Patch to access screen under Python. (Marko Mahni, 2010 Jul 18) - Patch to open dropped files in new tabs. (Michael Trim, 2010 Aug 3) Awaiting updated patches: @@ -2357,7 +2360,6 @@ Macintosh: 8 When doing Insert mode completion a mapping cannot recursively call edit(), because the completion information is global. Put everything in an allocated structure? -6 Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) 8 Command line completion: buffers "foo.txt" and "../b/foo.txt", completing ":buf foo<Tab>" doesn't find the second one. (George V. Reilly) 7 mb_off2cells() doesn't work correctly on the tail byte of a double-byte @@ -3654,9 +3656,6 @@ Tags: Win32 GUI: 8 Make debug mode work while starting up (vim -D). Open console window for the message and input? -7 The Python interface only works with one version of Python, selected at - compile time. Can this be made to work with version 2.1 and 2.2 - dynamically? 7 GvimExt: when there are several existing Vims, move the list to a submenu. (Mike McCollister) 8 When using "Edit with Vim" for one file it changes directory, when several @@ -4871,8 +4870,6 @@ Debug mode: Various improvements: -9 Python: be able to define a Python function that can be called directly - from Vim script. Requires converting the arguments and return value. 7 Add plugins for formatting? Should be able to make a choice depending on the language of a file (English/Korean/Japanese/etc.). Setting the 'langformat' option to "chinese" would load the @@ -4897,7 +4894,6 @@ Various improvements: 7 Allow a window not to have a statusline. Makes it possible to use a window as a buffer-tab selection. 8 Allow non-active windows to have a different statusline. (Yakov Lerner) -6 Python interface: add vim.message() function. (Michal Vitecek, 2002 Nov 5) 7 Support using ":vert" with User commands. Add expandable items <vert>. Do the same for ":browse" and ":confirm"? For ":silent" and ":debug" apply to the whole user command. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 065f1ddf5b1d11765fc1ab34a7dfea586a286b58..7ad9ed1921f5de3065ecbea5a51532b1be855815 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2013 Apr 08 +" Last Change: 2013 May 15 " Listen very carefully, I will say this only once if exists("did_load_filetypes") diff --git a/runtime/ftplugin/sql.vim b/runtime/ftplugin/sql.vim index 39028f318d2bacaf365df5078d6a959c9a0b3dd6..c2bc857947b9999d3df7e21f5b5c11c1cb4464cf 100644 --- a/runtime/ftplugin/sql.vim +++ b/runtime/ftplugin/sql.vim @@ -1,8 +1,8 @@ " SQL filetype plugin file " Language: SQL (Common for Oracle, Microsoft SQL Server, Sybase) -" Version: 10.0 +" Version: 11.0 " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> -" Last Change: 2012 Dec 04 +" Last Change: 2013 May 13 " Download: http://vim.sourceforge.net/script.php?script_id=454 " For more details please use: @@ -36,6 +36,10 @@ " " History " +" Version 11.0 (May 2013) +" +" NF: Updated to use SyntaxComplete's new regex support for syntax groups. +" " Version 10.0 (Dec 2012) " " NF: Changed all maps to use noremap instead of must map @@ -189,7 +193,7 @@ if !exists("*SQL_SetType") " Remove any cached SQL since a new sytax will have different " items and groups - if !exists('g:loaded_sql_completion') || 100 == g:loaded_sql_completion + if !exists('g:loaded_sql_completion') || g:loaded_sql_completion >= 100 call sqlcomplete#ResetCacheSyntax() endif @@ -458,6 +462,8 @@ if exists('&omnifunc') " OMNI function prior to setting up the SQL OMNI function let b:sql_compl_savefunc = &omnifunc + " Source it to determine it's version + runtime autoload/sqlcomplete.vim " This is used by the sqlcomplete.vim plugin " Source it for it's global functions runtime autoload/syntaxcomplete.vim @@ -466,14 +472,20 @@ if exists('&omnifunc') " Prevent the intellisense plugin from loading let b:sql_vis = 1 if !exists('g:omni_sql_no_default_maps') + let regex_extra = '' + if exists('g:loaded_syntax_completion') && exists('g:loaded_sql_completion') + if g:loaded_syntax_completion > 120 && g:loaded_sql_completion > 140 + let regex_extra = '\\w*' + endif + endif " Static maps which use populate the completion list " using Vim's syntax highlighting rules exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'a <C-\><C-O>:call sqlcomplete#Map("syntax")<CR><C-X><C-O>' - exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'k <C-\><C-O>:call sqlcomplete#Map("sqlKeyword")<CR><C-X><C-O>' - exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'f <C-\><C-O>:call sqlcomplete#Map("sqlFunction")<CR><C-X><C-O>' - exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'o <C-\><C-O>:call sqlcomplete#Map("sqlOption")<CR><C-X><C-O>' - exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'T <C-\><C-O>:call sqlcomplete#Map("sqlType")<CR><C-X><C-O>' - exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'s <C-\><C-O>:call sqlcomplete#Map("sqlStatement")<CR><C-X><C-O>' + exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'k <C-\><C-O>:call sqlcomplete#Map("sqlKeyword'.regex_extra.'")<CR><C-X><C-O>' + exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'f <C-\><C-O>:call sqlcomplete#Map("sqlFunction'.regex_extra.'")<CR><C-X><C-O>' + exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'o <C-\><C-O>:call sqlcomplete#Map("sqlOption'.regex_extra.'")<CR><C-X><C-O>' + exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'T <C-\><C-O>:call sqlcomplete#Map("sqlType'.regex_extra.'")<CR><C-X><C-O>' + exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'s <C-\><C-O>:call sqlcomplete#Map("sqlStatement'.regex_extra.'")<CR><C-X><C-O>' " Dynamic maps which use populate the completion list " using the dbext.vim plugin exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'t <C-\><C-O>:call sqlcomplete#Map("table")<CR><C-X><C-O>' @@ -510,4 +522,3 @@ let &cpo = s:save_cpo unlet s:save_cpo " vim:sw=4: - diff --git a/runtime/indent/erlang.vim b/runtime/indent/erlang.vim index 930f5d13254303c1c4da14af7ee14e96f4eea4df..416c40e9358f74bb2daf5f6a605b4eb3a1dfbf34 100644 --- a/runtime/indent/erlang.vim +++ b/runtime/indent/erlang.vim @@ -1,213 +1,1375 @@ " Vim indent file -" Language: Erlang +" Language: Erlang (http://www.erlang.org) " Author: Csaba Hoch <csaba.hoch@gmail.com> " Contributors: Edwin Fine <efine145_nospam01 at usa dot net> " Pawel 'kTT' Salata <rockplayer.pl@gmail.com> " Ricardo Catalinas Jiménez <jimenezrick@gmail.com> +" Last Update: 2013-Mar-05 " License: Vim license -" Version: 2011/09/06 +" URL: https://github.com/hcs42/vim-erlang + +" Note About Usage: +" This indentation script works best with the Erlang syntax file created by +" KreÄ…imir Marľić (Kresimir Marzic) and maintained by Csaba Hoch. + +" Notes About Implementation: +" +" - LTI = Line to indent. +" - The index of the first line is 1, but the index of the first column is 0. + + +" Initialization {{{1 +" ============== " Only load this indent file when no other was loaded -if exists("b:did_indent") - finish +" Vim 7 or later is needed +if exists("b:did_indent") || version < 700 + finish else - let b:did_indent = 1 + let b:did_indent = 1 endif setlocal indentexpr=ErlangIndent() -setlocal indentkeys+==after,=end,=catch,=),=],=} +setlocal indentkeys+=0=end,0=of,0=catch,0=after,0=when,0=),0=],0=},0=>> " Only define the functions once if exists("*ErlangIndent") - finish + finish endif -" The function goes through the whole line, analyses it and returns the -" indentation level. -" -" line: the line to be examined -" return: the indentation level of the examined line -function s:ErlangIndentAfterLine(line) - let linelen = strlen(a:line) " the length of the line - let i = 0 " the index of the current character in the line - let ind = 0 " how much should be the difference between the indentation of - " the current line and the indentation of the next line? - " e.g. +1: the indentation of the next line should be equal to - " the indentation of the current line plus one shiftwidth - let last_fun = 0 " the last token was a 'fun' - let last_receive = 0 " the last token was a 'receive'; needed for 'after' - let last_hash_sym = 0 " the last token was a '#' - - " Ignore comments - if a:line =~# '^\s*%' - return 0 - endif - - " Partial function head where the guard is missing - if a:line =~# "\\(^\\l[[:alnum:]_]*\\)\\|\\(^'[^']\\+'\\)(" && a:line !~# '->' - return 2 - endif - - " The missing guard from the split function head - if a:line =~# '^\s*when\s\+.*->' - return -1 - endif - - while 0<=i && i<linelen - " m: the next value of the i - if a:line[i] == '"' - let m = matchend(a:line,'"\%([^"\\]\|\\.\)*"',i) - let last_receive = 0 - elseif a:line[i] == "'" - let m = matchend(a:line,"'[^']*'",i) - let last_receive = 0 - elseif a:line[i] =~# "[a-z]" - let m = matchend(a:line,".[[:alnum:]_]*",i) - if last_fun - let ind = ind - 1 - let last_fun = 0 - let last_receive = 0 - elseif a:line[(i):(m-1)] =~# '^\%(case\|if\|try\)$' - let ind = ind + 1 - elseif a:line[(i):(m-1)] =~# '^receive$' - let ind = ind + 1 - let last_receive = 1 - elseif a:line[(i):(m-1)] =~# '^begin$' - let ind = ind + 2 - let last_receive = 0 - elseif a:line[(i):(m-1)] =~# '^end$' - let ind = ind - 2 - let last_receive = 0 - elseif a:line[(i):(m-1)] =~# '^after$' - if last_receive == 0 - let ind = ind - 1 - else - let ind = ind + 0 - endif - let last_receive = 0 - elseif a:line[(i):(m-1)] =~# '^fun$' - let ind = ind + 1 - let last_fun = 1 - let last_receive = 0 - endif - elseif a:line[i] =~# "[A-Z_]" - let m = matchend(a:line,".[[:alnum:]_]*",i) - let last_receive = 0 - elseif a:line[i] == '$' - let m = i+2 - let last_receive = 0 - elseif a:line[i] == "." && (i+1>=linelen || a:line[i+1]!~ "[0-9]") - let m = i+1 - if last_hash_sym - let last_hash_sym = 0 - else - let ind = ind - 1 - endif - let last_receive = 0 - elseif a:line[i] == '-' && (i+1<linelen && a:line[i+1]=='>') - let m = i+2 - let ind = ind + 1 - let last_receive = 0 - elseif a:line[i] == ';' && a:line[(i):(linelen)] !~# '.*->.*' - let m = i+1 - let ind = ind - 1 - let last_receive = 0 - elseif a:line[i] == '#' - let m = i+1 - let last_hash_sym = 1 - elseif a:line[i] =~# '[({[]' - let m = i+1 - let ind = ind + 1 - let last_fun = 0 - let last_receive = 0 - let last_hash_sym = 0 - elseif a:line[i] =~# '[)}\]]' - let m = i+1 - let ind = ind - 1 - let last_receive = 0 - else - let m = i+1 - endif +let s:cpo_save = &cpo +set cpo&vim + +" Logging library {{{1 +" =============== + +" Purpose: +" Logs the given string using the ErlangIndentLog function if it exists. +" Parameters: +" s: string +function! s:Log(s) + if exists("*ErlangIndentLog") + call ErlangIndentLog(a:s) + endif +endfunction + +" Line tokenizer library {{{1 +" ====================== + +" Indtokens are "indentation tokens". + +" Purpose: +" Calculate the new virtual column after the given segment of a line. +" Parameters: +" line: string +" first_index: integer -- the index of the first character of the segment +" last_index: integer -- the index of the last character of the segment +" vcol: integer -- the virtual column of the first character of the token +" tabstop: integer -- the value of the 'tabstop' option to be used +" Returns: +" vcol: integer +" Example: +" " index: 0 12 34567 +" " vcol: 0 45 89 +" s:CalcVCol("\t'\tx', b", 1, 4, 4) -> 10 +function! s:CalcVCol(line, first_index, last_index, vcol, tabstop) + + " We copy the relevent segment of the line, otherwise if the line were + " e.g. `"\t", term` then the else branch below would consume the `", term` + " part at once. + let line = a:line[a:first_index : a:last_index] + + let i = 0 + let last_index = a:last_index - a:first_index + let vcol = a:vcol + + while 0 <= i && i <= last_index + + if line[i] == "\t" + " Example (when tabstop == 4): + " + " vcol + tab -> next_vcol + " 0 + tab -> 4 + " 1 + tab -> 4 + " 2 + tab -> 4 + " 3 + tab -> 4 + " 4 + tab -> 8 + " + " next_i - i == the number of tabs + let next_i = matchend(line, '\t*', i + 1) + let vcol = (vcol / a:tabstop + (next_i - i)) * a:tabstop + call s:Log('new vcol after tab: '. vcol) + else + let next_i = matchend(line, '[^\t]*', i + 1) + let vcol += next_i - i + call s:Log('new vcol after other: '. vcol) + endif + let i = next_i + endwhile + + return vcol +endfunction + +" Purpose: +" Go through the whole line and return the tokens in the line. +" Parameters: +" line: string -- the line to be examined +" string_continuation: bool +" atom_continuation: bool +" Returns: +" indtokens = [indtoken] +" indtoken = [token, vcol, col] +" token = string (examples: 'begin', '<variable>', '}') +" vcol = integer (the virtual column of the first character of the token) +" col = integer +function! s:GetTokensFromLine(line, string_continuation, atom_continuation, + \tabstop) + + let linelen = strlen(a:line) " The length of the line + let i = 0 " The index of the current character in the line + let vcol = 0 " The virtual column of the current character + let indtokens = [] + + if a:string_continuation + let i = matchend(a:line, '^\%([^"\\]\|\\.\)*"', 0) + if i == -1 + call s:Log(' Whole line is string continuation -> ignore') + return [] + else + let vcol = s:CalcVCol(a:line, 0, i - 1, 0, a:tabstop) + call add(indtokens, ['<string_end>', vcol, i]) + endif + elseif a:atom_continuation + let i = matchend(a:line, "^\\%([^'\\\\]\\|\\\\.\\)*'", 0) + if i == -1 + call s:Log(' Whole line is quoted atom continuation -> ignore') + return [] + else + let vcol = s:CalcVCol(a:line, 0, i - 1, 0, a:tabstop) + call add(indtokens, ['<quoted_atom_end>', vcol, i]) + endif + endif + + while 0 <= i && i < linelen - let i = m - endwhile + let next_vcol = '' + + " Spaces + if a:line[i] == ' ' + let next_i = matchend(a:line, ' *', i + 1) + + " Tabs + elseif a:line[i] == "\t" + let next_i = matchend(a:line, '\t*', i + 1) + + " See example in s:CalcVCol + let next_vcol = (vcol / a:tabstop + (next_i - i)) * a:tabstop + + " Comment + elseif a:line[i] == '%' + let next_i = linelen + + " String token: "..." + elseif a:line[i] == '"' + let next_i = matchend(a:line, '\%([^"\\]\|\\.\)*"', i + 1) + if next_i == -1 + call add(indtokens, ['<string_start>', vcol, i]) + else + let next_vcol = s:CalcVCol(a:line, i, next_i - 1, vcol, a:tabstop) + call add(indtokens, ['<string>', vcol, i]) + endif + + " Quoted atom token: '...' + elseif a:line[i] == "'" + let next_i = matchend(a:line, "\\%([^'\\\\]\\|\\\\.\\)*'", i + 1) + if next_i == -1 + call add(indtokens, ['<quoted_atom_start>', vcol, i]) + else + let next_vcol = s:CalcVCol(a:line, i, next_i - 1, vcol, a:tabstop) + call add(indtokens, ['<quoted_atom>', vcol, i]) + endif + + " Keyword or atom or variable token or number + elseif a:line[i] =~# '[a-zA-Z_@0-9]' + let next_i = matchend(a:line, + \'[[:alnum:]_@:]*\%(\s*#\s*[[:alnum:]_@:]*\)\=', + \i + 1) + call add(indtokens, [a:line[(i):(next_i - 1)], vcol, i]) + + " Character token: $<char> (as in: $a) + elseif a:line[i] == '$' + call add(indtokens, ['$.', vcol, i]) + let next_i = i + 2 + + " Dot token: . + elseif a:line[i] == '.' + + let next_i = i + 1 + + if i + 1 == linelen || a:line[i + 1] =~# '[[:blank:]%]' + " End of clause token: . (as in: f() -> ok.) + call add(indtokens, ['<end_of_clause>', vcol, i]) + + else + " Possibilities: + " - Dot token in float: . (as in: 3.14) + " - Dot token in record: . (as in: #myrec.myfield) + call add(indtokens, ['.', vcol, i]) + endif + + " Equal sign + elseif a:line[i] == '=' + " This is handled separately so that "=<<" will be parsed as + " ['=', '<<'] instead of ['=<', '<']. Although Erlang parses it + " currently in the latter way, that may be fixed some day. + call add(indtokens, [a:line[i], vcol, i]) + let next_i = i + 1 + + " Three-character tokens + elseif i + 1 < linelen && + \ index(['=:=', '=/='], a:line[i : i + 1]) != -1 + call add(indtokens, [a:line[i : i + 1], vcol, i]) + let next_i = i + 2 + + " Two-character tokens + elseif i + 1 < linelen && + \ index(['->', '<<', '>>', '||', '==', '/=', '=<', '>=', '++', '--', + \ '::'], + \ a:line[i : i + 1]) != -1 + call add(indtokens, [a:line[i : i + 1], vcol, i]) + let next_i = i + 2 + + " Other character: , ; < > ( ) [ ] { } # + - * / : ? = ! | + else + call add(indtokens, [a:line[i], vcol, i]) + let next_i = i + 1 + + endif + + if next_vcol == '' + let vcol += next_i - i + else + let vcol = next_vcol + endif + + let i = next_i + + endwhile + + return indtokens - return ind endfunction -function s:FindPrevNonBlankNonComment(lnum) +" TODO: doc, handle "not found" case +function! s:GetIndtokenAtCol(indtokens, col) + let i = 0 + while i < len(a:indtokens) + if a:indtokens[i][2] == a:col + return [1, i] + elseif a:indtokens[i][2] > a:col + return [0, s:IndentError('No token at col ' . a:col . ', ' . + \'indtokens = ' . string(a:indtokens), + \'', '')] + endif + let i += 1 + endwhile + return [0, s:IndentError('No token at col ' . a:col . ', ' . + \'indtokens = ' . string(a:indtokens), + \'', '')] +endfunction + +" Stack library {{{1 +" ============= + +" Purpose: +" Push a token onto the parser's stack. +" Parameters: +" stack: [token] +" token: string +function! s:Push(stack, token) + call s:Log(' Stack Push: "' . a:token . '" into ' . string(a:stack)) + call insert(a:stack, a:token) +endfunction + +" Purpose: +" Pop a token from the parser's stack. +" Parameters: +" stack: [token] +" token: string +" Returns: +" token: string -- the removed element +function! s:Pop(stack) + let head = remove(a:stack, 0) + call s:Log(' Stack Pop: "' . head . '" from ' . string(a:stack)) + return head +endfunction + +" Library for accessing and storing tokenized lines {{{1 +" ================================================= + +" The Erlang token cache: an `lnum -> indtokens` dictionary that stores the +" tokenized lines. +let s:all_tokens = {} +let s:file_name = '' +let s:last_changedtick = -1 + +" Purpose: +" Clear the Erlang token cache if we have a different file or the file has +" been changed since the last indentation. +function! s:ClearTokenCacheIfNeeded() + let file_name = expand('%:p') + if file_name != s:file_name || + \ b:changedtick != s:last_changedtick + let s:file_name = file_name + let s:last_changedtick = b:changedtick + let s:all_tokens = {} + endif +endfunction + +" Purpose: +" Return the tokens of line `lnum`, if that line is not empty. If it is +" empty, find the first non-empty line in the given `direction` and return +" the tokens of that line. +" Parameters: +" lnum: integer +" direction: 'up' | 'down' +" Returns: +" result: [] -- the result is an empty list if we hit the beginning or end +" of the file +" | [lnum, indtokens] +" lnum: integer -- the index of the non-empty line that was found and +" tokenized +" indtokens: [indtoken] -- the tokens of line `lnum` +function! s:TokenizeLine(lnum, direction) + + call s:Log('Tokenizing starts from line ' . a:lnum) + if a:direction == 'up' let lnum = prevnonblank(a:lnum) + else " a:direction == 'down' + let lnum = nextnonblank(a:lnum) + endif + + " We hit the beginning or end of the file + if lnum == 0 + let indtokens = [] + call s:Log(' We hit the beginning or end of the file.') + + " The line has already been parsed + elseif has_key(s:all_tokens, lnum) + let indtokens = s:all_tokens[lnum] + call s:Log('Cached line ' . lnum . ': ' . getline(lnum)) + call s:Log(" Tokens in the line:\n - " . join(indtokens, "\n - ")) + + " The line should be parsed now + else + + " Parse the line let line = getline(lnum) - " Continue to search above if the current line begins with a '%' - while line =~# '^\s*%.*$' - let lnum = prevnonblank(lnum - 1) - if 0 == lnum - return 0 - endif - let line = getline(lnum) - endwhile - return lnum + let string_continuation = s:IsLineStringContinuation(lnum) + let atom_continuation = s:IsLineAtomContinuation(lnum) + let indtokens = s:GetTokensFromLine(line, string_continuation, + \atom_continuation, &tabstop) + let s:all_tokens[lnum] = indtokens + call s:Log('Tokenizing line ' . lnum . ': ' . line) + call s:Log(" Tokens in the line:\n - " . join(indtokens, "\n - ")) + + endif + + return [lnum, indtokens] endfunction -" The function returns the indentation level of the line adjusted to a mutiple -" of 'shiftwidth' option. +" Purpose: +" As a helper function for PrevIndToken and NextIndToken, the FindIndToken +" function finds the first line with at least one token in the given +" direction. +" Parameters: +" lnum: integer +" direction: 'up' | 'down' +" Returns: +" result: [] -- the result is an empty list if we hit the beginning or end +" of the file +" | indtoken +function! s:FindIndToken(lnum, dir) + let lnum = a:lnum + while 1 + let lnum += (a:dir == 'up' ? -1 : 1) + let [lnum, indtokens] = s:TokenizeLine(lnum, a:dir) + if lnum == 0 + " We hit the beginning or end of the file + return [] + elseif !empty(indtokens) + return indtokens[a:dir == 'up' ? -1 : 0] + endif + endwhile +endfunction + +" Purpose: +" Find the token that directly precedes the given token. +" Parameters: +" lnum: integer -- the line of the given token +" i: the index of the given token within line `lnum` +" Returns: +" result = [] -- the result is an empty list if the given token is the first +" token of the file +" | indtoken +function! s:PrevIndToken(lnum, i) + call s:Log(' PrevIndToken called: lnum=' . a:lnum . ', i =' . a:i) + + " If the current line has a previous token, return that + if a:i > 0 + return s:all_tokens[a:lnum][a:i - 1] + else + return s:FindIndToken(a:lnum, 'up') + endif +endfunction + +" Purpose: +" Find the token that directly succeeds the given token. +" Parameters: +" lnum: integer -- the line of the given token +" i: the index of the given token within line `lnum` +" Returns: +" result = [] -- the result is an empty list if the given token is the last +" token of the file +" | indtoken +function! s:NextIndToken(lnum, i) + call s:Log(' NextIndToken called: lnum=' . a:lnum . ', i =' . a:i) + + " If the current line has a next token, return that + if len(s:all_tokens[a:lnum]) > a:i + 1 + return s:all_tokens[a:lnum][a:i + 1] + else + return s:FindIndToken(a:lnum, 'down') + endif +endfunction + +" ErlangCalcIndent helper functions {{{1 +" ================================= + +" Purpose: +" This function is called when the parser encounters a syntax error. " -" lnum: line number -" return: the indentation level of the line -function s:GetLineIndent(lnum) - return (indent(a:lnum) / &sw) * &sw +" If we encounter a syntax error, we return +" g:erlang_unexpected_token_indent, which is -1 by default. This means that +" the indentation of the LTI will not be changed. +" Parameter: +" msg: string +" token: string +" stack: [token] +" Returns: +" indent: integer +function! s:IndentError(msg, token, stack) + call s:Log('Indent error: ' . a:msg . ' -> return') + call s:Log(' Token = ' . a:token . ', ' . + \' stack = ' . string(a:stack)) + return g:erlang_unexpected_token_indent endfunction -function ErlangIndent() - " Find a non-blank line above the current line - let lnum = prevnonblank(v:lnum - 1) +" Purpose: +" This function is called when the parser encounters an unexpected token, +" and the parser will return the number given back by UnexpectedToken. +" +" If we encounter an unexpected token, we return +" g:erlang_unexpected_token_indent, which is -1 by default. This means that +" the indentation of the LTI will not be changed. +" Parameter: +" token: string +" stack: [token] +" Returns: +" indent: integer +function! s:UnexpectedToken(token, stack) + call s:Log(' Unexpected token ' . a:token . ', stack = ' . + \string(a:stack) . ' -> return') + return g:erlang_unexpected_token_indent +endfunction - " Hit the start of the file, use zero indent - if lnum == 0 - return 0 - endif +if !exists('g:erlang_unexpected_token_indent') + let g:erlang_unexpected_token_indent = -1 +endif + +" Purpose: +" Return whether the given line starts with a string continuation. +" Parameter: +" lnum: integer +" Returns: +" result: bool +" Example: +" f() -> % IsLineStringContinuation = false +" "This is a % IsLineStringContinuation = false +" multiline % IsLineStringContinuation = true +" string". % IsLineStringContinuation = true +function! s:IsLineStringContinuation(lnum) + if has('syntax_items') + return synIDattr(synID(a:lnum, 1, 0), 'name') =~# '^erlangString' + else + return 0 + endif +endfunction + +" Purpose: +" Return whether the given line starts with an atom continuation. +" Parameter: +" lnum: integer +" Returns: +" result: bool +" Example: +" 'function with % IsLineAtomContinuation = true, but should be false +" weird name'() -> % IsLineAtomContinuation = true +" ok. % IsLineAtomContinuation = false +function! s:IsLineAtomContinuation(lnum) + if has('syntax_items') + return synIDattr(synID(a:lnum, 1, 0), 'name') =~# '^erlangQuotedAtom' + else + return 0 + endif +endfunction + +" Purpose: +" Return whether the 'catch' token (which should be the `i`th token in line +" `lnum`) is standalone or part of a try-catch block, based on the preceding +" token. +" Parameters: +" lnum: integer +" i: integer +" Return: +" is_standalone: bool +function! s:IsCatchStandalone(lnum, i) + call s:Log(' IsCatchStandalone called: lnum=' . a:lnum . ', i=' . a:i) + let prev_indtoken = s:PrevIndToken(a:lnum, a:i) - let prevline = getline(lnum) - let currline = getline(v:lnum) + " If we hit the beginning of the file, it is not a catch in a try block + if prev_indtoken == [] + return 1 + endif - let ind_after = s:ErlangIndentAfterLine(prevline) - if ind_after != 0 - let ind = s:GetLineIndent(lnum) + ind_after * &sw + let prev_token = prev_indtoken[0] + + if prev_token =~# '[A-Z_@0-9]' + let is_standalone = 0 + elseif prev_token =~# '[a-z]' + if index(['after', 'and', 'andalso', 'band', 'begin', 'bnot', 'bor', 'bsl', + \ 'bsr', 'bxor', 'case', 'catch', 'div', 'not', 'or', 'orelse', + \ 'rem', 'try', 'xor'], prev_token) != -1 + " If catch is after these keywords, it is standalone + let is_standalone = 1 else - let ind = indent(lnum) + ind_after * &sw + " If catch is after another keyword (e.g. 'end') or an atom, it is + " part of try-catch. + " + " Keywords: + " - may precede 'catch': end + " - may not precede 'catch': fun if of receive when + " - unused: cond let query + let is_standalone = 0 endif + elseif index([')', ']', '}', '<string>', '<string_end>', '<quoted_atom>', + \ '<quoted_atom_end>', '$.'], prev_token) != -1 + let is_standalone = 0 + else + " This 'else' branch includes the following tokens: + " -> == /= =< < >= > =:= =/= + - * / ++ -- :: < > ; ( [ { ? = ! . | + let is_standalone = 1 + endif + + call s:Log(' "catch" preceded by "' . prev_token . '" -> catch ' . + \(is_standalone ? 'is standalone' : 'belongs to try-catch')) + return is_standalone - " Special cases: - if prevline =~# '^\s*\%(after\|end\)\>' - let ind = ind + 2*&sw +endfunction + +" Purpose: +" This function is called when a begin-type element ('begin', 'case', +" '[', '<<', etc.) is found. It asks the caller to return if the stack +" Parameters: +" stack: [token] +" token: string +" curr_vcol: integer +" stored_vcol: integer +" sw: integer -- number of spaces to be used after the begin element as +" indentation +" Returns: +" result: [should_return, indent] +" should_return: bool -- if true, the caller should return `indent` to Vim +" indent -- integer +function! s:BeginElementFoundIfEmpty(stack, token, curr_vcol, stored_vcol, sw) + if empty(a:stack) + if a:stored_vcol == -1 + call s:Log(' "' . a:token . '" directly preceeds LTI -> return') + return [1, a:curr_vcol + a:sw] + else + call s:Log(' "' . a:token . + \'" token (whose expression includes LTI) found -> return') + return [1, a:stored_vcol] endif - if currline =~# '^\s*end\>' - let ind = ind - 2*&sw + else + return [0, 0] + endif +endfunction + +" Purpose: +" This function is called when a begin-type element ('begin', 'case', '[', +" '<<', etc.) is found, and in some cases when 'after' and 'when' is found. +" It asks the caller to return if the stack is already empty. +" Parameters: +" stack: [token] +" token: string +" curr_vcol: integer +" stored_vcol: integer +" end_token: end token that belongs to the begin element found (e.g. if the +" begin element is 'begin', the end token is 'end') +" sw: integer -- number of spaces to be used after the begin element as +" indentation +" Returns: +" result: [should_return, indent] +" should_return: bool -- if true, the caller should return `indent` to Vim +" indent -- integer +function! s:BeginElementFound(stack, token, curr_vcol, stored_vcol, end_token, sw) + + " Return 'return' if the stack is empty + let [ret, res] = s:BeginElementFoundIfEmpty(a:stack, a:token, a:curr_vcol, + \a:stored_vcol, a:sw) + if ret | return [ret, res] | endif + + if a:stack[0] == a:end_token + call s:Log(' "' . a:token . '" pops "' . a:end_token . '"') + call s:Pop(a:stack) + if !empty(a:stack) && a:stack[0] == 'align_to_begin_element' + call s:Pop(a:stack) + if empty(a:stack) + return [1, a:curr_vcol] + else + return [1, s:UnexpectedToken(a:token, a:stack)] + endif + else + return [0, 0] endif - if currline =~# '^\s*after\>' - let plnum = s:FindPrevNonBlankNonComment(v:lnum-1) - if getline(plnum) =~# '^[^%]*\<receive\>\s*\%(%.*\)\=$' - " If the 'receive' is not in the same line as the 'after' - let ind = ind - 1*&sw - else - let ind = ind - 2*&sw - endif + else + return [1, s:UnexpectedToken(a:token, a:stack)] + endif +endfunction + +" Purpose: +" This function is called when we hit the beginning of a file or an +" end-of-clause token -- i.e. when we found the beginning of the current +" clause. +" +" If the stack contains an '->' or 'when', this means that we can return +" now, since we were looking for the beginning of the clause. +" Parameters: +" stack: [token] +" token: string +" stored_vcol: integer +" Returns: +" result: [should_return, indent] +" should_return: bool -- if true, the caller should return `indent` to Vim +" indent -- integer +function! s:BeginningOfClauseFound(stack, token, stored_vcol) + if !empty(a:stack) && a:stack[0] == 'when' + call s:Log(' BeginningOfClauseFound: "when" found in stack') + call s:Pop(a:stack) + if empty(a:stack) + call s:Log(' Stack is ["when"], so LTI is in a guard -> return') + return [1, a:stored_vcol + &sw + 2] + else + return [1, s:UnexpectedToken(a:token, a:stack)] endif - if prevline =~# '^\s*[)}\]]' - let ind = ind + 1*&sw + elseif !empty(a:stack) && a:stack[0] == '->' + call s:Log(' BeginningOfClauseFound: "->" found in stack') + call s:Pop(a:stack) + if empty(a:stack) + call s:Log(' Stack is ["->"], so LTI is in function body -> return') + return [1, a:stored_vcol + &sw] + elseif a:stack[0] == ';' + call s:Pop(a:stack) + if empty(a:stack) + call s:Log(' Stack is ["->", ";"], so LTI is in a function head ' . + \'-> return') + return [0, a:stored_vcol] + else + return [1, s:UnexpectedToken(a:token, a:stack)] + endif + else + return [1, s:UnexpectedToken(a:token, a:stack)] endif - if currline =~# '^\s*[)}\]]' - let ind = ind - 1*&sw + else + return [0, 0] + endif +endfunction + +let g:erlang_indent_searchpair_timeout = 2000 + +" TODO +function! s:SearchPair(lnum, curr_col, start, middle, end) + call cursor(a:lnum, a:curr_col + 1) + let [lnum_new, col1_new] = + \searchpairpos(a:start, a:middle, a:end, 'bW', + \'synIDattr(synID(line("."), col("."), 0), "name") ' . + \'=~? "string\\|quotedatom\\|todo\\|comment\\|' . + \'erlangmodifier"', + \0, g:erlang_indent_searchpair_timeout) + return [lnum_new, col1_new - 1] +endfunction + +function! s:SearchEndPair(lnum, curr_col) + return s:SearchPair( + \ a:lnum, a:curr_col, + \ '\<\%(case\|try\|begin\|receive\|if\)\>\|' . + \ '\<fun\>\%(\s\|\n\|%.*$\)*(', + \ '', + \ '\<end\>') +endfunction + +" ErlangCalcIndent {{{1 +" ================ + +" Purpose: +" Calculate the indentation of the given line. +" Parameters: +" lnum: integer -- index of the line for which the indentation should be +" calculated +" stack: [token] -- initial stack +" Return: +" indent: integer -- if -1, that means "don't change the indentation"; +" otherwise it means "indent the line with `indent` +" number of spaces or equivalent tabs" +function! s:ErlangCalcIndent(lnum, stack) + let res = s:ErlangCalcIndent2(a:lnum, a:stack) + call s:Log("ErlangCalcIndent returned: " . res) + return res +endfunction + +function! s:ErlangCalcIndent2(lnum, stack) + + let lnum = a:lnum + let stored_vcol = -1 " Virtual column of the first character of the token that + " we currently think we might align to. + let mode = 'normal' + let stack = a:stack + let semicolon_abscol = '' + + " Walk through the lines of the buffer backwards (starting from the + " previous line) until we can decide how to indent the current line. + while 1 + + let [lnum, indtokens] = s:TokenizeLine(lnum, 'up') + + " Hit the start of the file + if lnum == 0 + let [ret, res] = s:BeginningOfClauseFound(stack, 'beginning_of_file', + \stored_vcol) + if ret | return res | endif + + return 0 endif - if prevline =~# '^\s*\%(catch\)\s*\%(%\|$\)' - let ind = ind + 1*&sw + + let i = len(indtokens) - 1 + let last_token_of_line = 1 + + while i >= 0 + + let [token, curr_vcol, curr_col] = indtokens[i] + call s:Log(' Analyzing the following token: ' . string(indtokens[i])) + + if len(stack) > 256 " TODO: magic number + return s:IndentError('Stack too long', token, stack) + endif + + if token == '<end_of_clause>' + let [ret, res] = s:BeginningOfClauseFound(stack, token, stored_vcol) + if ret | return res | endif + + if stored_vcol == -1 + call s:Log(' End of clause directly preceeds LTI -> return') + return 0 + else + call s:Log(' End of clause (but not end of line) -> return') + return stored_vcol + endif + + elseif stack == ['prev_term_plus'] + if token =~# '[a-zA-Z_@]' || + \ token == '<string>' || token == '<string_start>' || + \ token == '<quoted_atom>' || token == '<quoted_atom_start>' + call s:Log(' previous token found: curr_vcol + plus = ' . + \curr_vcol . " + " . plus) + return curr_vcol + plus + endif + + elseif token == 'begin' + let [ret, res] = s:BeginElementFound(stack, token, curr_vcol, + \stored_vcol, 'end', &sw) + if ret | return res | endif + + " case EXPR of BRANCHES end + " try EXPR catch BRANCHES end + " try EXPR after BODY end + " try EXPR catch BRANCHES after BODY end + " try EXPR of BRANCHES catch BRANCHES end + " try EXPR of BRANCHES after BODY end + " try EXPR of BRANCHES catch BRANCHES after BODY end + " receive BRANCHES end + " receive BRANCHES after BRANCHES end + + " This branch is not Emacs-compatible + elseif (index(['of', 'receive', 'after', 'if'], token) != -1 || + \ (token == 'catch' && !s:IsCatchStandalone(lnum, i))) && + \ !last_token_of_line && + \ (empty(stack) || stack == ['when'] || stack == ['->'] || + \ stack == ['->', ';']) + + " If we are after of/receive, but these are not the last + " tokens of the line, we want to indent like this: + " + " % stack == [] + " receive stored_vcol, + " LTI + " + " % stack == ['->', ';'] + " receive stored_vcol -> + " B; + " LTI + " + " % stack == ['->'] + " receive stored_vcol -> + " LTI + " + " % stack == ['when'] + " receive stored_vcol when + " LTI + + " stack = [] => LTI is a condition + " stack = ['->'] => LTI is a branch + " stack = ['->', ';'] => LTI is a condition + " stack = ['when'] => LTI is a guard + if empty(stack) || stack == ['->', ';'] + call s:Log(' LTI is in a condition after ' . + \'"of/receive/after/if/catch" -> return') + return stored_vcol + elseif stack == ['->'] + call s:Log(' LTI is in a branch after ' . + \'"of/receive/after/if/catch" -> return') + return stored_vcol + &sw + elseif stack == ['when'] + call s:Log(' LTI is in a guard after ' . + \'"of/receive/after/if/catch" -> return') + return stored_vcol + &sw + else + return s:UnexpectedToken(token, stack) + endif + + elseif index(['case', 'if', 'try', 'receive'], token) != -1 + + " stack = [] => LTI is a condition + " stack = ['->'] => LTI is a branch + " stack = ['->', ';'] => LTI is a condition + " stack = ['when'] => LTI is in a guard + if empty(stack) + " pass + elseif (token == 'case' && stack[0] == 'of') || + \ (token == 'if') || + \ (token == 'try' && (stack[0] == 'of' || + \ stack[0] == 'catch' || + \ stack[0] == 'after')) || + \ (token == 'receive') + + " From the indentation point of view, the keyword + " (of/catch/after/end) before the LTI is what counts, so + " when we reached these tokens, and the stack already had + " a catch/after/end, we didn't modify it. + " + " This way when we reach case/try/receive (i.e. now), + " there is at most one of/catch/after/end token in the + " stack. + if token == 'case' || token == 'try' || + \ (token == 'receive' && stack[0] == 'after') + call s:Pop(stack) + endif + + if empty(stack) + call s:Log(' LTI is in a condition; matching ' . + \'"case/if/try/receive" found') + let stored_vcol = curr_vcol + &sw + elseif stack[0] == 'align_to_begin_element' + call s:Pop(stack) + let stored_vcol = curr_vcol + elseif len(stack) > 1 && stack[0] == '->' && stack[1] == ';' + call s:Log(' LTI is in a condition; matching ' . + \'"case/if/try/receive" found') + call s:Pop(stack) + call s:Pop(stack) + let stored_vcol = curr_vcol + &sw + elseif stack[0] == '->' + call s:Log(' LTI is in a branch; matching ' . + \'"case/if/try/receive" found') + call s:Pop(stack) + let stored_vcol = curr_vcol + 2 * &sw + elseif stack[0] == 'when' + call s:Log(' LTI is in a guard; matching ' . + \'"case/if/try/receive" found') + call s:Pop(stack) + let stored_vcol = curr_vcol + 2 * &sw + 2 + endif + + endif + + let [ret, res] = s:BeginElementFound(stack, token, curr_vcol, + \stored_vcol, 'end', &sw) + if ret | return res | endif + + elseif token == 'fun' + let next_indtoken = s:NextIndToken(lnum, i) + call s:Log(' Next indtoken = ' . string(next_indtoken)) + + if !empty(next_indtoken) && next_indtoken[0] == '(' + " We have an anonymous function definition + " (e.g. "fun () -> ok end") + + " stack = [] => LTI is a condition + " stack = ['->'] => LTI is a branch + " stack = ['->', ';'] => LTI is a condition + " stack = ['when'] => LTI is in a guard + if empty(stack) + call s:Log(' LTI is in a condition; matching "fun" found') + let stored_vcol = curr_vcol + &sw + elseif len(stack) > 1 && stack[0] == '->' && stack[1] == ';' + call s:Log(' LTI is in a condition; matching "fun" found') + call s:Pop(stack) + call s:Pop(stack) + elseif stack[0] == '->' + call s:Log(' LTI is in a branch; matching "fun" found') + call s:Pop(stack) + let stored_vcol = curr_vcol + 2 * &sw + elseif stack[0] == 'when' + call s:Log(' LTI is in a guard; matching "fun" found') + call s:Pop(stack) + let stored_vcol = curr_vcol + 2 * &sw + 2 + endif + + let [ret, res] = s:BeginElementFound(stack, token, curr_vcol, + \stored_vcol, 'end', &sw) + if ret | return res | endif + else + " Pass: we have a function reference (e.g. "fun f/0") + endif + + elseif token == '[' + " Emacs compatibility + let [ret, res] = s:BeginElementFound(stack, token, curr_vcol, + \stored_vcol, ']', 1) + if ret | return res | endif + + elseif token == '<<' + " Emacs compatibility + let [ret, res] = s:BeginElementFound(stack, token, curr_vcol, + \stored_vcol, '>>', 2) + if ret | return res | endif + + elseif token == '(' || token == '{' + + let end_token = (token == '(' ? ')' : + \token == '{' ? '}' : 'error') + + if empty(stack) + " We found the opening paren whose block contains the LTI. + let mode = 'inside' + elseif stack[0] == end_token + call s:Log(' "' . token . '" pops "' . end_token . '"') + call s:Pop(stack) + + if !empty(stack) && stack[0] == 'align_to_begin_element' + " We found the opening paren whose closing paren + " starts LTI + let mode = 'align_to_begin_element' + else + " We found the opening pair for a closing paren that + " was already in the stack. + let mode = 'outside' + endif + else + return s:UnexpectedToken(token, stack) + endif + + if mode == 'inside' || mode == 'align_to_begin_element' + + if last_token_of_line && i != 0 + " Examples: {{{ + " + " mode == 'inside': + " + " my_func( + " LTI + " + " [Variable, { + " LTI + " + " mode == 'align_to_begin_element': + " + " my_func( + " Params + " ) % LTI + " + " [Variable, { + " Terms + " } % LTI + " }}} + let stack = ['prev_term_plus'] + let plus = (mode == 'inside' ? 2 : 1) + call s:Log(' "' . token . + \'" token found at end of line -> find previous token') + elseif mode == 'align_to_begin_element' + " Examples: {{{ + " + " mode == 'align_to_begin_element' && !last_token_of_line + " + " my_func(stored_vcol + " ) % LTI + " + " [Variable, {stored_vcol + " } % LTI + " + " mode == 'align_to_begin_element' && i == 0 + " + " ( + " stored_vcol + " ) % LTI + " + " { + " stored_vcol + " } % LTI + " }}} + call s:Log(' "' . token . '" token (whose closing token ' . + \'starts LTI) found -> return') + return curr_vcol + elseif stored_vcol == -1 + " Examples: {{{ + " + " mode == 'inside' && stored_vcol == -1 && !last_token_of_line + " + " my_func( + " LTI + " [Variable, { + " LTI + " + " mode == 'inside' && stored_vcol == -1 && i == 0 + " + " ( + " LTI + " + " { + " LTI + " }}} + call s:Log(' "' . token . + \'" token (which directly precedes LTI) found -> return') + return curr_vcol + 1 + else + " Examples: {{{ + " + " mode == 'inside' && stored_vcol != -1 && !last_token_of_line + " + " my_func(stored_vcol, + " LTI + " + " [Variable, {stored_vcol, + " LTI + " + " mode == 'inside' && stored_vcol != -1 && i == 0 + " + " (stored_vcol, + " LTI + " + " {stored_vcol, + " LTI + " }}} + call s:Log(' "' . token . + \'" token (whose block contains LTI) found -> return') + return stored_vcol + endif + endif + + elseif token == 'end' + let [lnum_new, col_new] = s:SearchEndPair(lnum, curr_col) + + if lnum_new == 0 + return s:IndentError('Matching token for "end" not found', + \token, stack) + else + if lnum_new != lnum + call s:Log(' Tokenize for "end" <<<<') + let [lnum, indtokens] = s:TokenizeLine(lnum_new, 'up') + call s:Log(' >>>> Tokenize for "end"') + endif + + let [success, i] = s:GetIndtokenAtCol(indtokens, col_new) + if !success | return i | endif + let [token, curr_vcol, curr_col] = indtokens[i] + call s:Log(' Match for "end" in line ' . lnum_new . ': ' . + \string(indtokens[i])) + endif + + elseif index([')', ']', '}'], token) != -1 + + call s:Push(stack, token) + + " We have to escape '[', because this string will be interpreted as a + " regexp + let open_paren = (token == ')' ? '(' : + \token == ']' ? '\[' : + \ '{') + + let [lnum_new, col_new] = s:SearchPair(lnum, curr_col, + \open_paren, '', token) + + if lnum_new == 0 + return s:IndentError('Matching token not found', + \token, stack) + else + if lnum_new != lnum + call s:Log(' Tokenize the opening paren <<<<') + let [lnum, indtokens] = s:TokenizeLine(lnum_new, 'up') + call s:Log(' >>>>') + endif + + let [success, i] = s:GetIndtokenAtCol(indtokens, col_new) + if !success | return i | endif + let [token, curr_vcol, curr_col] = indtokens[i] + call s:Log(' Match in line ' . lnum_new . ': ' . + \string(indtokens[i])) + + " Go back to the beginning of the loop and handle the opening paren + continue + endif + + elseif token == '>>' + call s:Push(stack, token) + + elseif token == ';' + + if empty(stack) + call s:Push(stack, ';') + elseif index([';', '->', 'when', 'end', 'after', 'catch'], + \stack[0]) != -1 + " Pass: + " + " - If the stack top is another ';', then one ';' is + " enough. + " - If the stack top is an '->' or a 'when', then we + " should keep that, because they signify the type of the + " LTI (branch, condition or guard). + " - From the indentation point of view, the keyword + " (of/catch/after/end) before the LTI is what counts, so + " if the stack already has a catch/after/end, we don't + " modify it. This way when we reach case/try/receive, + " there will be at most one of/catch/after/end token in + " the stack. + else + return s:UnexpectedToken(token, stack) + endif + + elseif token == '->' + + if empty(stack) && !last_token_of_line + call s:Log(' LTI is in expression after arrow -> return') + return stored_vcol + elseif empty(stack) || stack[0] == ';' || stack[0] == 'end' + " stack = [';'] -> LTI is either a branch or in a guard + " stack = ['->'] -> LTI is a condition + " stack = ['->', ';'] -> LTI is a branch + call s:Push(stack, '->') + elseif index(['->', 'when', 'end', 'after', 'catch'], stack[0]) != -1 + " Pass: + " + " - If the stack top is another '->', then one '->' is + " enough. + " - If the stack top is a 'when', then we should keep + " that, because this signifies that LTI is a in a guard. + " - From the indentation point of view, the keyword + " (of/catch/after/end) before the LTI is what counts, so + " if the stack already has a catch/after/end, we don't + " modify it. This way when we reach case/try/receive, + " there will be at most one of/catch/after/end token in + " the stack. + else + return s:UnexpectedToken(token, stack) + endif + + elseif token == 'when' + + " Pop all ';' from the top of the stack + while !empty(stack) && stack[0] == ';' + call s:Pop(stack) + endwhile + + if empty(stack) + if semicolon_abscol != '' + let stored_vcol = semicolon_abscol + endif + if !last_token_of_line + " Example: + " when A, + " LTI + let [ret, res] = s:BeginElementFoundIfEmpty(stack, token, curr_vcol, + \stored_vcol, &sw) + if ret | return res | endif + else + " Example: + " when + " LTI + call s:Push(stack, token) + endif + elseif index(['->', 'when', 'end', 'after', 'catch'], stack[0]) != -1 + " Pass: + " - If the stack top is another 'when', then one 'when' is + " enough. + " - If the stack top is an '->' or a 'when', then we + " should keep that, because they signify the type of the + " LTI (branch, condition or guard). + " - From the indentation point of view, the keyword + " (of/catch/after/end) before the LTI is what counts, so + " if the stack already has a catch/after/end, we don't + " modify it. This way when we reach case/try/receive, + " there will be at most one of/catch/after/end token in + " the stack. + else + return s:UnexpectedToken(token, stack) + endif + + elseif token == 'of' || token == 'after' || + \ (token == 'catch' && !s:IsCatchStandalone(lnum, i)) + + if token == 'after' + " If LTI is between an 'after' and the corresponding + " 'end', then let's return + let [ret, res] = s:BeginElementFoundIfEmpty(stack, token, curr_vcol, + \stored_vcol, &sw) + if ret | return res | endif + endif + + if empty(stack) || stack[0] == '->' || stack[0] == 'when' + call s:Push(stack, token) + elseif stack[0] == 'catch' || stack[0] == 'after' || stack[0] == 'end' + " Pass: From the indentation point of view, the keyword + " (of/catch/after/end) before the LTI is what counts, so + " if the stack already has a catch/after/end, we don't + " modify it. This way when we reach case/try/receive, + " there will be at most one of/catch/after/end token in + " the stack. + else + return s:UnexpectedToken(token, stack) + endif + + elseif token == '||' && empty(stack) && !last_token_of_line + + call s:Log(' LTI is in expression after "||" -> return') + return stored_vcol + + else + call s:Log(' Misc token, stack unchanged = ' . string(stack)) + + endif + + if empty(stack) || stack[0] == '->' || stack[0] == 'when' + let stored_vcol = curr_vcol + let semicolon_abscol = '' + call s:Log(' Misc token when the stack is empty or has "->" ' . + \'-> setting stored_vcol to ' . stored_vcol) + elseif stack[0] == ';' + let semicolon_abscol = curr_vcol + call s:Log(' Setting semicolon-stored_vcol to ' . stored_vcol) + endif + + let i -= 1 + call s:Log(' Token processed. stored_vcol=' . stored_vcol) + + let last_token_of_line = 0 + + endwhile " iteration on tokens in a line + + call s:Log(' Line analyzed. stored_vcol=' . stored_vcol) + + if empty(stack) && stored_vcol != -1 && + \ (!empty(indtokens) && indtokens[0][0] != '<string_end>' && + \ indtokens[0][0] != '<quoted_atom_end>') + call s:Log(' Empty stack at the beginning of the line -> return') + return stored_vcol endif - if currline =~# '^\s*\%(catch\)\s*\%(%\|$\)' - let ind = ind - 1*&sw + + let lnum -= 1 + + endwhile " iteration on lines + +endfunction + +" ErlangIndent function {{{1 +" ===================== + +function! ErlangIndent() + + call s:ClearTokenCacheIfNeeded() + + let currline = getline(v:lnum) + call s:Log('Indenting line ' . v:lnum . ': ' . currline) + + if s:IsLineStringContinuation(v:lnum) || s:IsLineAtomContinuation(v:lnum) + call s:Log('String or atom continuation found -> ' . + \'leaving indentation unchanged') + return -1 + endif + + let ml = matchlist(currline, + \'^\(\s*\)\(\%(end\|of\|catch\|after\)\>\|[)\]}]\|>>\)') + + " If the line has a special beginning, but not a standalone catch + if !empty(ml) && !(ml[2] == 'catch' && s:IsCatchStandalone(v:lnum, 0)) + + let curr_col = len(ml[1]) + + if ml[2] == 'end' + let [lnum, col] = s:SearchEndPair(v:lnum, curr_col) + + if lnum == 0 + return s:IndentError('Matching token for "end" not found', + \'end', []) + else + call s:Log(' Tokenize for "end" <<<<') + let [lnum, indtokens] = s:TokenizeLine(lnum, 'up') + call s:Log(' >>>> Tokenize for "end"') + + let [success, i] = s:GetIndtokenAtCol(indtokens, col) + if !success | return i | endif + let [token, curr_vcol, curr_col] = indtokens[i] + call s:Log(' Match for "end" in line ' . lnum . ': ' . + \string(indtokens[i])) + return curr_vcol + endif + + else + + call s:Log(" Line type = 'end'") + let new_col = s:ErlangCalcIndent(v:lnum - 1, + \[ml[2], 'align_to_begin_element']) endif + else + call s:Log(" Line type = 'normal'") - if ind<0 - let ind = 0 + let new_col = s:ErlangCalcIndent(v:lnum - 1, []) + if currline =~# '^\s*when\>' + let new_col += 2 endif - return ind + endif + + if new_col < -1 + call s:Log('WARNING: returning new_col == ' . new_col) + return g:erlang_unexpected_token_indent + endif + + return new_col + endfunction + +" Cleanup {{{1 +" ======= + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: sw=2 et fdm=marker diff --git a/runtime/indent/tex.vim b/runtime/indent/tex.vim index 8e2a5daa8c83a9a42aeb767a4d08ede3516cf13c..7e3a3510832eb6ef899928381d3ddaf73acae3ef 100644 --- a/runtime/indent/tex.vim +++ b/runtime/indent/tex.vim @@ -1,6 +1,6 @@ " Vim indent file " Language: LaTeX -" Maintainer: Zhou YiChao <broken.zhou AT gmail.com> +" Maintainer: YiChao Zhou <broken.zhou AT gmail.com> " Created: Sat, 16 Feb 2002 16:50:19 +0100 " Last Change: 2012 Mar 18 19:19:50 " Version: 0.7 @@ -46,6 +46,9 @@ " (*) Modify indentkeys. " 2012/03/18 by Zhou Yichao <broken.zhou AT gmail.com> " (*) Add &cpo +" 2013/05/02 by Zhou Yichao <broken.zhou AT gmail.com> +" (*) Fix problem about GetTeXIndent checker. Thank Albert Netymk +" for reporting this. " }}} " Document: {{{ @@ -106,10 +109,6 @@ " }}} " Only define the function once -if exists("*GetTeXIndent") - finish -endif - if exists("b:did_indent") finish endif @@ -158,7 +157,7 @@ exec 'setlocal indentkeys+=[,(,{,),},],\&' . substitute(g:tex_items, '^\|\(\\|\) let g:tex_items = '^\s*' . substitute(g:tex_items, '^\(\^\\s\*\)*', '', '') " }}} -function GetTeXIndent() " {{{ +function! GetTeXIndent() " {{{ " Find a non-blank line above the current line. let lnum = prevnonblank(v:lnum - 1) diff --git a/runtime/menu.vim b/runtime/menu.vim index 656212e41a735e5fe5518a2ed1a4519b2cddf7a4..f4ff9dce83e0c9392c735b6fef56ca5b9fc6a023 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -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: 2012 Dec 06 +" Last Change: 2013 May 17 " 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. @@ -308,8 +308,10 @@ fun! s:TextWidth() endif let n = inputdialog(g:menutrans_textwidth_dialog, &tw) if n != "" - " remove leading zeros to avoid it being used as an octal number - let &tw = substitute(n, "^0*", "", "") + " Remove leading zeros to avoid it being used as an octal number. + " But keep a zero by itself. + let tw = substitute(n, "^0*", "", "") + let &tw = tw == '' ? 0 : tw endif endfun diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index 2965ad147191a0059da557eb9a959a40ebf5cc9b..0fdfef164afb9b43a115fea5f66a03220215fde5 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -1,6 +1,6 @@ " Vim plugin for showing matching parens " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2013 Mar 19 +" Last Change: 2013 May 08 " Exit quickly when: " - this plugin was already loaded (or disabled) @@ -11,6 +11,13 @@ if exists("g:loaded_matchparen") || &cp || !exists("##CursorMoved") endif let g:loaded_matchparen = 1 +if !exists("g:matchparen_timeout") + let g:matchparen_timeout = 300 +endif +if !exists("g:matchparen_insert_timeout") + let g:matchparen_insert_timeout = 60 +endif + augroup matchparen " Replace all matchparen autocommands autocmd! CursorMoved,CursorMovedI,WinEnter * call s:Highlight_Matching_Pair() @@ -99,10 +106,15 @@ function! s:Highlight_Matching_Pair() let stopline = stoplinetop endif + " Limit the search time to 300 msec to avoid a hang on very long lines. + " This fails when a timeout is not supported. + if mode() == 'i' || mode() == 'R' + let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout + else + let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout + endif try - " Limit the search time to 300 msec to avoid a hang on very long lines. - " This fails when a timeout is not supported. - let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 300) + let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout) catch /E118/ " Can't use the timeout, restrict the stopline a bit more to avoid taking " a long time on closed folds and long lines. diff --git a/runtime/syntax/debchangelog.vim b/runtime/syntax/debchangelog.vim index 4e008d29a880155e01066d7a7b35485c8f068235..b1d7a313905e018403a4063b2bb4edfad506f79f 100644 --- a/runtime/syntax/debchangelog.vim +++ b/runtime/syntax/debchangelog.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> " Former Maintainers: Gerfried Fuchs <alfie@ist.org> " Wichert Akkerman <wakkerma@debian.org> -" Last Change: 2013 Jan 03 +" Last Change: 2013 May 05 " URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debchangelog.vim " Standard syntax initialization @@ -19,7 +19,7 @@ syn case ignore " Define some common expressions we can use later on syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\=" -syn match debchangelogTarget contained "\v %(frozen|unstable|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|%(squeeze)-%(backports%(-sloppy)=|volatile)|%(hardy|lucid|oneiric|precise|quantal|raring)%(-%(security|proposed|updates|backports|commercial|partner))=)+" +syn match debchangelogTarget contained "\v %(frozen|unstable|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile)|wheezy-backports|%(lucid|precise|quantal|raring|saucy)%(-%(security|proposed|updates|backports|commercial|partner))=)+" syn match debchangelogVersion contained "(.\{-})" syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim index 7c64471877d7e79db5f8ffa9471870891f13b6c9..f3dd2a5fc19fdf70c15a677549eb7bb4dfa55d2d 100644 --- a/runtime/syntax/debsources.vim +++ b/runtime/syntax/debsources.vim @@ -2,7 +2,7 @@ " Language: Debian sources.list " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> " Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl> -" Last Change: 2013 Jan 03 +" Last Change: 2013 May 05 " URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debsources.vim " Standard syntax initialization @@ -23,7 +23,7 @@ syn match debsourcesComment /#.*/ contains=@Spell " Match uri's syn match debsourcesUri +\(http://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\++ -syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\(squeeze\|wheezy\|\(old\)\=stable\|testing\|unstable\|sid\|rc-buggy\|experimental\|hardy\|lucid\|oneiric\|precise\|quantal\|raring\)\([-[:alnum:]_./]*\)+ +syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\(squeeze\|wheezy\|\(old\)\=stable\|testing\|unstable\|sid\|rc-buggy\|experimental\|lucid\|precise\|quantal\|raring\|saucy\)\([-[:alnum:]_./]*\)+ " Associate our matches and regions with pretty colours hi def link debsourcesLine Error diff --git a/runtime/syntax/erlang.vim b/runtime/syntax/erlang.vim index 28bc4a5d350069135f82225deb9975351f9e429f..f34a004df6d2a7a4b68c895dd4e204b13eb378ad 100644 --- a/runtime/syntax/erlang.vim +++ b/runtime/syntax/erlang.vim @@ -1,126 +1,175 @@ " Vim syntax file -" Language: Erlang -" Author: Oscar Hellström <oscar@oscarh.net> (http://oscar.hellstrom.st) -" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com> +" Language: Erlang (http://www.erlang.org) +" Maintainer: Csaba Hoch <csaba.hoch@gmail.com> +" Former Maintainer: KreÄ…imir Marľić (Kresimir Marzic) <kmarzic@fly.srk.fer.hr> +" Last Update: 2013-Mar-07 " License: Vim license -" Version: 2011/09/11 +" URL: https://github.com/hcs42/vim-erlang + +" Customization: +" +" There are two optional sets of highlighting: +" +" 1. The BIFs (built-in functions) are highlighted by default. To disable +" this, put the following line in your vimrc: +" +" let g:erlang_highlight_bifs = 0 +" +" 2. To enable highlighting some special atoms, put this in your vimrc: +" +" let g:erlang_highlight_special_atoms = 1 + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Case sensitive +syn case match -if exists("b:current_syntax") - finish -else - let b:current_syntax = "erlang" +if version >= 600 + setlocal iskeyword+=$,@-@ endif -if !exists("g:erlang_highlight_bif") - let g:erlang_highlight_bif = 1 +" Comments +syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo +syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)' contained +syn match erlangCommentAnnotation /`[^']*'/ contained +syn keyword erlangTodo TODO FIXME XXX contained + +" Numbers (minimum base is 2, maximum is 36.) +syn match erlangNumberInteger '\<\d\+\>' +syn match erlangNumberInteger '\<\%([2-9]\|[12]\d\|3[0-6]\)\+#[[:alnum:]]\+\>' +syn match erlangNumberFloat '\<\d\+\.\d\+\%([eE][+-]\=\d\+\)\=\>' + +" Strings, atoms, characters +syn region erlangString start=/"/ end=/"/ contains=erlangStringModifier +syn region erlangQuotedAtom start=/'/ end=/'/ contains=erlangQuotedAtomModifier +syn match erlangStringModifier '\~\a\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained +syn match erlangQuotedAtomModifier '\~\a\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained +syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)' + +" Operators +syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/' +syn keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse + +" Separators +syn match erlangSeparator '(\|)\|{\|}\|\[\|]\||\|||\|;\|,\|?\|#' +syn match erlangRightArrow '->' + +" Functions call +syn match erlangFCall '\<\%(\a[[:alnum:]@]*\s*\.\s*\)*\a[[:alnum:]@]*\s*:\s*\a[[:alnum:]@]*\>' + +" Constants and Directives +syn match erlangDirective '-\%(behaviour\|behavior\|compile\|define\|else\|endif\|export\|file\|ifdef\|ifndef\|import\|include_lib\|include\|module\|record\|undef\|author\|copyright\|doc\|vsn\|on_load\|export_type\)\>' + +" Keywords +syn keyword erlangKeyword after begin case catch cond end fun if let of query receive when try +syn keyword erlangExtra true false + + +if !exists("g:erlang_highlight_bifs") || g:erlang_highlight_bifs == 1 + + " build-in-functions (BIFs) + syn keyword erlangBIF abs alive apply atom_to_binary atom_to_list binary_part binary_to_atom binary_to_existing_atom binary_to_float binary_to_integer bitstring_to_list binary_to_list binary_to_term bit_size byte_size check_old_code check_process_code concat_binary date delete_module demonitor disconnect_node element erase error exit float float_to_binary float_to_list garbage_collect get get_keys group_leader halt hd integer_to_binary integer_to_list iolist_to_binary iolist_size is_alive is_atom is_binary is_bitstring is_boolean is_float is_function is_integer is_list is_number is_pid is_port is_process_alive is_record is_reference is_tuple length link list_to_atom list_to_binary list_to_bitstring list_to_existing_atom list_to_float list_to_integer list_to_pid list_to_tuple load_module make_ref max min module_loaded monitor monitor_node node nodes now open_port pid_to_list port_close port_command port_connect pre_loaded process_flag process_flag process_info process purge_module put register registered round self setelement size spawn spawn_link spawn_monitor spawn_opt split_binary statistics term_to_binary throw time tl trunc tuple_size tuple_to_list unlink unregister whereis + endif -" Erlang is case sensitive -syn case match -" Match groups -syn match erlangStringModifier /\\./ contained -syn match erlangStringModifier /\~\%(-\?[0-9*]\+\)\?\%(\.[0-9*]\+\..\?\)\?\%(c\|f\|e\|g\|s\|w\|p\|W\|P\|B\|X\|#\|b\|+\|n\|i\)/ contained -syn match erlangModifier /\$\\\?./ - -syn match erlangInteger /\<\%([0-9]\+#[0-9a-fA-F]\+\|[0-9]\+\)\>/ -syn match erlangFloat /\<[0-9]\+\.[0-9]\+\%(e-\?[0-9]\+\)\?\>/ - -syn keyword erlangTodo TODO FIXME XXX contained -syn match erlangComment /%.*$/ contains=@Spell,erlangTodo,erlangAnnotation -syn match erlangAnnotation /\%(%\s\)\@<=@\%(author\|clear\|copyright\|deprecated\|doc\|docfile\|end\|equiv\|headerfile\|hidden\|private\|reference\|see\|since\|spec\|throws\|title\|todo\|TODO\|type\|version\)/ contained -syn match erlangAnnotation /`[^']\+'/ contained - -syn keyword erlangKeyword band bor bnot bsl bsr bxor div rem xor -syn keyword erlangKeyword try catch begin receive after cond fun let query - -syn keyword erlangConditional case if of end -syn keyword erlangConditional not and or andalso orelse -syn keyword erlangConditional when - -syn keyword erlangBoolean true false - -syn keyword erlangGuard is_list is_alive is_atom is_binary is_bitstring is_boolean is_tuple is_number is_integer is_float is_function is_constant is_pid is_port is_reference is_record is_process_alive - -syn match erlangOperator /\/\|*\|+\|-\|++\|--/ -syn match erlangOperator /->\|<-\|||\||\|!\|=/ -syn match erlangOperator /=:=\|==\|\/=\|=\/=\|<\|>\|=<\|>=/ -syn keyword erlangOperator div rem - -syn region erlangString start=/"/ end=/"/ skip=/\\/ contains=@Spell,erlangStringModifier - -syn match erlangVariable /\<[A-Z_]\w*\>/ -syn match erlangAtom /\%(\%(^-\)\|#\)\@<!\<[a-z][A-Za-z0-9_]*\>\%(\s*[(:]\)\@!/ -syn match erlangAtom /\\\@<!'[^']*\\\@<!'/ - -syn match erlangRecord /#\w\+/ - -syn match erlangTuple /{\|}/ -syn match erlangList /\[\|\]/ - -syn match erlangAttribute /^-\%(vsn\|author\|copyright\|compile\|deprecated\|module\|export\|import\|behaviour\|behavior\|export_type\|ignore_xref\|on_load\)\s*(\@=/ -syn match erlangInclude /^-include\%(_lib\)\?\s*(\@=/ -syn match erlangRecordDef /^-record\s*(\@=/ -syn match erlangDefine /^-\%(define\|undef\)\s*(\@=/ -syn match erlangPreCondit /^-\%(ifdef\|ifndef\|else\|endif\)\%(\s*(\@=\)\?/ - -syn match erlangType /^-\%(spec\|type\)[( ]\@=/ - -syn match erlangMacro /\%(-define(\)\@<=\w\+/ -syn match erlangMacro /?\??\w\+/ - -syn match erlangBitType /\%(\/\|-\)\@<=\%(bits\|bitstring\|binary\|integer\|float\|unit\)\>/ -syn match erlangBitSize /:\@<=[0-9]\+/ - -syn match erlangBinary /<<\|>>/ - -" BIFs -syn match erlangBIF /\%([^:0-9A-Za-z_]\|\<erlang:\)\@<=\%(abs\|apply\|atom_to_binary\|atom_to_list\|binary_part\|binary_to_atom\|binary_to_existing_atom\|binary_to_list\|binary_to_term\|bit_size\|bitstring_to_list\|byte_size\|check_process_code\|date\|delete_module\|demonitor\|disconnect_node\|element\|erase\|exit\|float\|float_to_list\|garbage_collect\|get\|get_keys\|group_leader\|hd\|integer_to_list\|iolist_size\|iolist_to_binary\|is_alive\|is_atom\|is_binary\|is_bitstring\|is_boolean\|is_float\|is_function\|is_integer\|is_list\|is_number\|is_pid\|is_port\|is_process_alive\|is_record\|is_reference\|is_tuple\|length\|link\|list_to_atom\|list_to_binary\|list_to_bitstring\|list_to_existing_atom\|list_to_float\|list_to_integer\|list_to_pid\|list_to_tuple\|load_module\|make_ref\|max\|min\|module_loaded\|monitor\|monitor_node\|node\|nodes\|now\|open_port\|pid_to_list\|port_close\|port_command\|port_connect\|port_control\|pre_loaded\|processes\|process_flag\|process_info\|purge_module\|put\|register\|registered\|round\|self\|setelement\|size\|spawn\|spawn_link\|spawn_monitor\|spawn_opt\|split_binary\|statistics\|term_to_binary\|time\|tl\|trunc\|tuple_size\|tuple_to_list\|unlink\|unregister\|whereis\)\%((\|\/[0-9]\)\@=/ -syn match erlangBIF /\<\%(erlang:\)\@<=\%(append_element\|bump_reductions\|cancel_timer\|decode_packet\|display\|function_exported\|fun_info\|fun_to_list\|get_cookie\|get_stacktrace\|hash\|is_builtin\|loaded\|load_nif\|localtime\|localtime_to_universaltime\|make_tuple\|memory\|monitor_node\|phash\|port_call\|port_info\|ports\|port_to_list\|process_display\|read_timer\|ref_to_list\|resume_process\|send\|send_after\|send_nosuspend\|set_cookie\|start_timer\|suspend_process\|system_flag\|system_info\|system_monitor\|system_profile\|trace\|trace_delivered\|trace_info\|trace_pattern\|universaltime\|universaltime_to_localtime\|yield\)(\@=/ -syn match erlangGBIF /erlang\%(:\w\)\@=/ - -" Link Erlang stuff to Vim groups -hi link erlangTodo Todo -hi link erlangString String -hi link erlangNoSpellString String -hi link erlangModifier SpecialChar -hi link erlangStringModifier SpecialChar -hi link erlangComment Comment -hi link erlangAnnotation Special -hi link erlangVariable Identifier -hi link erlangInclude Include -hi link erlangRecordDef Keyword -hi link erlangAttribute Keyword -hi link erlangKeyword Keyword -hi link erlangMacro Macro -hi link erlangDefine Define -hi link erlangPreCondit PreCondit -hi link erlangPreProc PreProc -hi link erlangDelimiter Delimiter -hi link erlangBitDelimiter Normal -hi link erlangOperator Operator -hi link erlangConditional Conditional -hi link erlangGuard Conditional -hi link erlangBoolean Boolean -hi link erlangAtom Constant -hi link erlangRecord Structure -hi link erlangInteger Number -hi link erlangFloat Number -hi link erlangFloat Number -hi link erlangFloat Number -hi link erlangFloat Number -hi link erlangHex Number -hi link erlangFun Keyword -hi link erlangList Delimiter -hi link erlangTuple Delimiter -hi link erlangBinary Keyword -hi link erlangBitVariable Identifier -hi link erlangBitType Type -hi link erlangType Type -hi link erlangBitSize Number - -" Optional highlighting -if g:erlang_highlight_bif - hi link erlangBIF Keyword - hi link erlangGBIF Keyword +if exists("g:erlang_highlight_special_atoms") && g:erlang_highlight_special_atoms == 1 + + " Processes + syn keyword erlangProcess creation current_function dictionary + syn keyword erlangProcess group_leader heap_size high initial_call + syn keyword erlangProcess linked low memory_in_use message_queue + syn keyword erlangProcess net_kernel node normal priority + syn keyword erlangProcess reductions registered_name runnable + syn keyword erlangProcess running stack_trace status timer + syn keyword erlangProcess trap_exit waiting + + " Ports + syn keyword erlangPort command count_in count_out creation in + syn keyword erlangPort in_format linked node out owner packeting + + " Nodes + syn keyword erlangNode atom_tables communicating creation + syn keyword erlangNode current_gc current_reductions current_runtime + syn keyword erlangNode current_wall_clock distribution_port + syn keyword erlangNode entry_points error_handler friends + syn keyword erlangNode garbage_collection magic_cookie magic_cookies + syn keyword erlangNode module_table monitored_nodes name next_ref + syn keyword erlangNode ports preloaded processes reductions + syn keyword erlangNode ref_state registry runtime wall_clock + + " Reserved + syn keyword erlangReserved apply_lambda module_info module_lambdas + syn keyword erlangReserved record record_index record_info + + " Extras + syn keyword erlangExtra badarg nocookie + + " Signals + syn keyword erlangSignal badsig kill killed exit normal endif + +" Sync at the beginning of functions: if this is not used, multiline string +" are not always recognized +syn sync match erlangSync grouphere NONE "^[a-z]\s*(" + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists ("did_erlang_inits") + if version < 508 + let did_erlang_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + " erlang_characters + HiLink erlangComment Comment + HiLink erlangCommentAnnotation Special + HiLink erlangTodo Todo + HiLink erlangSeparator Normal + HiLink erlangOperator Operator + HiLink erlangRightArrow Operator + + HiLink erlangStartString String + HiLink erlangString String + HiLink erlangStringModifier Special + + HiLink erlangStartQuotedAtom Type + HiLink erlangQuotedAtom Type + HiLink erlangQuotedAtomModifier Special + + HiLink erlangNumberInteger Number + HiLink erlangNumberFloat Float + HiLink erlangNumberHex Number + + HiLink erlangModifier Special + + " erlang_functions + HiLink erlangFCall Function + HiLink erlangBIF Function + + " erlang_keywords + HiLink erlangDirective Type + HiLink erlangKeyword Keyword + HiLink erlangProcess Special + HiLink erlangPort Special + HiLink erlangNode Special + HiLink erlangReserved Statement + HiLink erlangExtra Statement + HiLink erlangSignal Statement + + delcommand HiLink +endif + + +let b:current_syntax = "erlang" + +" vim: sw=2 et diff --git a/runtime/syntax/sgmllnx.vim b/runtime/syntax/sgmllnx.vim index 99e6ea2afee5a17e75726baa813163b414a403b3..28224f601e1f0eb40efcd50b4607e02a26686ff7 100644 --- a/runtime/syntax/sgmllnx.vim +++ b/runtime/syntax/sgmllnx.vim @@ -1,8 +1,7 @@ " Vim syntax file " Language: SGML-linuxdoc (supported by old sgmltools-1.x) -" (for more information, visit www.sgmltools.org) " Maintainer: SungHyun Nam <goweol@gmail.com> -" Last Change: 2008 Sep 17 +" Last Change: 2013 May 13 " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded @@ -29,7 +28,7 @@ syn region sgmllnxSpecial oneline start="&" end=";" syn keyword sgmllnxTagName contained article author date toc title sect verb syn keyword sgmllnxTagName contained abstract tscreen p itemize item enum syn keyword sgmllnxTagName contained descrip quote htmlurl code ref -syn keyword sgmllnxTagName contained tt tag bf +syn keyword sgmllnxTagName contained tt tag bf it url syn match sgmllnxTagName contained "sect\d\+" " Comments diff --git a/runtime/syntax/sisu.vim b/runtime/syntax/sisu.vim index 4545ee8fa45bff91bd2778348b5661006e9412fe..23d73254eb12179542c3705b2de3607ecfc15a52 100644 --- a/runtime/syntax/sisu.vim +++ b/runtime/syntax/sisu.vim @@ -1,8 +1,8 @@ " SiSU Vim syntax file " SiSU Maintainer: Ralph Amissah <ralph@amissah.com> -" SiSU Markup: SiSU (sisu-3.1.0) -" Last Change: 2011-10-03 -" URL: <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD> +" SiSU Markup: SiSU (sisu-4.0.9) +" Last Change: 2013-02-22 +" URL (sisu-4.1.0): <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD> "(originally looked at Ruby Vim by Mirko Nasato) if version < 600 @@ -20,14 +20,9 @@ syn match sisu_error contains=sisu_link,sisu_error_wspace "<![^ei]\S\+!>" "% "Markers Identifiers: if !exists("sisu_no_identifiers") syn match sisu_mark_endnote "\~^" - syn match sisu_break contains=@NoSpell " \\\\\( \|$\)" - syn match sisu_break contains=@NoSpell "<br>\|<br />" - syn match sisu_control contains=@NoSpell "^<:p[bn]>\s*$" - "syn match sisu_control contains=@NoSpell "^<\(br\)\?:\(pg\|pgn\|pn\)>\s*$" - "syn match sisu_control contains=@NoSpell "^\[\(br\)\?:\(pg\|pgn\|pn\)\]\s*$" + syn match sisu_break contains=@NoSpell " \\\\\( \|$\)\|<br>\|<br />" + syn match sisu_control contains=@NoSpell "^\(-\\\\-\|=\\\\=\|-\.\.-\|<:p[bn]>\)\s*$" syn match sisu_control contains=@NoSpell "^<:\(bo\|---\)>\s*$" - "syn match sisu_control contains=@NoSpell "^<\(br\)\?:\(pr\|o\)>\s*$" - "syn match sisu_control contains=@NoSpell "^\[\(br\)\?:\(pr\|o\)\]\s*$" syn match sisu_marktail "[~-]#" syn match sisu_control "\"" syn match sisu_underline "\(^\| \)_[a-zA-Z0-9]\+_\([ .,]\|$\)" @@ -43,11 +38,12 @@ if !exists("sisu_no_identifiers") syn match sisu_sub_header_title "^\s\+:\(subtitle\|short\|edition\|language\|lang_char\|note\):\s" "group=sisu_header_content syn match sisu_sub_header_creator "^\s\+:\(author\|editor\|contributor\|illustrator\|photographer\|translator\|digitized_by\|prepared_by\|audio\|video\):\s" " &hon &institution syn match sisu_sub_header_rights "^\s\+:\(copyright\|text\|translation\|illustrations\|photographs\|preparation\|digitization\|audio\|video\|license\|all\):\s" " access_rights license - syn match sisu_sub_header_classify "^\s\+:\(topic_register\|coverage\|format\|identifier\|keywords\|relation\|subject\|type\|dewey\|loc\|oclc\|pg\|isbn\):\s" - syn match sisu_sub_header_date "^\s\+:\(added_to_site\|available\|created\|issued\|modified\|published\|valid\|translated\|original_publication\):\s" + syn match sisu_sub_header_classify "^\s\+:\(topic_register\|keywords\|subject\|dewey\|loc\):\s" + syn match sisu_sub_header_identifier "^\s\+:\(oclc\|isbn\):\s" + syn match sisu_sub_header_date "^\s\+:\(added_to_site\|available\|created\|issued\|modified\|published\|valid\|translated\|original_publication\):\s" syn match sisu_sub_header_original "^\s\+:\(publisher\|date\|language\|lang_char\|institution\|nationality\|source\):\s" - syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|language\|italics\|bold\|emphasis\|plaintext_wrap\|texpdf_font_mono\|texpdf_font\|skin\|stamp\|promo\|ad\|manpage\):\s" - syn match sisu_sub_header_notes "^\s\+:\(abstract\|comment\|description\|history\|prefix\|prefix_[ab]\|suffix\):\s" + syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|language\|italics\|bold\|emphasis\|substitute\|omit\|plaintext_wrap\|texpdf_font_mono\|texpdf_font\|stamp\|promo\|ad\|manpage\|home_button_text\|home_button_image\|cover_image\|footer\):\s" + syn match sisu_sub_header_notes "^\s\+:\(description\|abstract\|comment\|coverage\|relation\|source\|history\|type\|format\|prefix\|prefix_[ab]\|suffix\):\s" "% "semantic markers: (ignore) syn match sisu_sem_marker ";{\|};[a-z._]*[a-z]" @@ -85,6 +81,8 @@ syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_ syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_rights matchgroup=sisu_header start="^[@]rights:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " classify document syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_classify matchgroup=sisu_header start="^[@]classify:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" +" identifier document +syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_identifier matchgroup=sisu_header start="^[@]identifier:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " original language (depreciated) syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_original matchgroup=sisu_header start="^[@]original:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$" " notes @@ -219,6 +217,7 @@ hi def link sisu_sub_header_date Statement hi def link sisu_sub_header_publisher Statement hi def link sisu_sub_header_rights Statement hi def link sisu_sub_header_classify Statement +hi def link sisu_sub_header_identifier Statement hi def link sisu_sub_header_original Statement hi def link sisu_sub_header_links Statement hi def link sisu_sub_header_notes Statement diff --git a/runtime/syntax/sqlanywhere.vim b/runtime/syntax/sqlanywhere.vim index b0f93217a64ec0f51767b1aee5c85e1a82664e68..05b05c9f4f858cd780fb22c930e4e2e0eacac075 100644 --- a/runtime/syntax/sqlanywhere.vim +++ b/runtime/syntax/sqlanywhere.vim @@ -1,11 +1,11 @@ - " Vim syntax file " Language: SQL, Adaptive Server Anywhere " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> -" Last Change: 2012 Jan 23 -" Version: 12.0.1 +" Last Change: 2013 May 13 +" Version: 16.0.0 -" Description: Updated to Adaptive Server Anywhere 12.0.1 (including spatial data) +" Description: Updated to Adaptive Server Anywhere 16.0.0 +" Updated to Adaptive Server Anywhere 12.0.1 (including spatial data) " Updated to Adaptive Server Anywhere 11.0.1 " Updated to Adaptive Server Anywhere 10.0.1 " Updated to Adaptive Server Anywhere 9.0.2 @@ -27,33 +27,34 @@ syn case ignore syn keyword sqlSpecial false null true " common functions -syn keyword sqlFunction count sum avg min max debug_eng isnull -syn keyword sqlFunction greater lesser argn string ymd todate -syn keyword sqlFunction totimestamp date today now utc_now -syn keyword sqlFunction number identity years months weeks days -syn keyword sqlFunction hours minutes seconds second minute hour -syn keyword sqlFunction day month year dow date_format substr -syn keyword sqlFunction substring byte_substr length byte_length -syn keyword sqlFunction datalength ifnull evaluate list -syn keyword sqlFunction soundex similar difference like_start -syn keyword sqlFunction like_end regexp_compile -syn keyword sqlFunction regexp_compile_patindex remainder abs -syn keyword sqlFunction graphical_plan plan explanation ulplan -syn keyword sqlFunction graphical_ulplan long_ulplan -syn keyword sqlFunction short_ulplan rewrite watcomsql -syn keyword sqlFunction transactsql dialect estimate -syn keyword sqlFunction estimate_source index_estimate -syn keyword sqlFunction experience_estimate traceback wsql_state -syn keyword sqlFunction lang_message dateadd datediff datepart -syn keyword sqlFunction datename dayname monthname quarter -syn keyword sqlFunction tsequal hextoint inttohex rand textptr -syn keyword sqlFunction rowid grouping stddev variance rank -syn keyword sqlFunction dense_rank density percent_rank user_name -syn keyword sqlFunction user_id str stuff char_length nullif -syn keyword sqlFunction sortkey compare ts_index_statistics -syn keyword sqlFunction ts_table_statistics isdate isnumeric -syn keyword sqlFunction get_identity lookup newid uuidtostr -syn keyword sqlFunction strtouuid varexists +syn keyword sqlFunction abs argn avg bintohex bintostr +syn keyword sqlFunction byte_length byte_substr char_length +syn keyword sqlFunction compare count count_big datalength date +syn keyword sqlFunction date_format dateadd datediff datename +syn keyword sqlFunction datepart day dayname days debug_eng +syn keyword sqlFunction dense_rank density dialect difference +syn keyword sqlFunction dow estimate estimate_source evaluate +syn keyword sqlFunction experience_estimate explanation +syn keyword sqlFunction get_identity graphical_plan +syn keyword sqlFunction graphical_ulplan greater grouping +syn keyword sqlFunction hextobin hextoint hour hours identity +syn keyword sqlFunction ifnull index_estimate inttohex isdate +syn keyword sqlFunction isencrypted isnull isnumeric +syn keyword sqlFunction lang_message length lesser like_end +syn keyword sqlFunction like_start list long_ulplan lookup max +syn keyword sqlFunction min minute minutes month monthname +syn keyword sqlFunction months newid now nullif number +syn keyword sqlFunction percent_rank plan quarter rand rank +syn keyword sqlFunction regexp_compile regexp_compile_patindex +syn keyword sqlFunction remainder rewrite rowid second seconds +syn keyword sqlFunction short_ulplan similar sortkey soundex +syn keyword sqlFunction stddev stack_trace str string strtobin strtouuid stuff +syn keyword sqlFunction subpartition substr substring sum switchoffset sysdatetimeoffset +syn keyword sqlFunction textptr todate todatetimeoffset today totimestamp traceback transactsql +syn keyword sqlFunction ts_index_statistics ts_table_statistics +syn keyword sqlFunction tsequal ulplan user_id user_name utc_now +syn keyword sqlFunction uuidtostr varexists variance watcomsql +syn keyword sqlFunction weeks wsql_state year years ymd " 9.0.1 functions syn keyword sqlFunction acos asin atan atn2 cast ceiling convert cos cot @@ -473,31 +474,36 @@ syn keyword sqlFunction ST_ToPoint syn keyword sqlFunction ST_ToPolygon syn keyword sqlFunction ST_ToSurface +" Array functions 16.x +syn keyword sqlFunction array array_agg array_max_cardinality trim_array +syn keyword sqlFunction error_line error_message error_procedure +syn keyword sqlFunction error_sqlcode error_sqlstate error_stack_trace + " keywords -syn keyword sqlKeyword absolute accent action active add address admin aes_decrypt -syn keyword sqlKeyword after aggregate algorithm allow_dup_row allow allowed alter -syn keyword sqlKeyword and angular ansi_substring any as append apply -syn keyword sqlKeyword arbiter asc ascii ase -syn keyword sqlKeyword assign at atan2 atomic attended -syn keyword sqlKeyword audit auditing authorization axis +syn keyword sqlKeyword absolute accent access account action active activate add address admin +syn keyword sqlKeyword aes_decrypt after aggregate algorithm allow_dup_row allow allowed alter +syn keyword sqlKeyword always and angular ansi_substring any as append apply +syn keyword sqlKeyword arbiter array asc ascii ase +syn keyword sqlKeyword assign at atan2 atomic attended +syn keyword sqlKeyword audit auditing authentication authorization axis syn keyword sqlKeyword autoincrement autostop batch bcp before syn keyword sqlKeyword between bit_and bit_length bit_or bit_substr bit_xor syn keyword sqlKeyword blank blanks block syn keyword sqlKeyword both bottom unbounded breaker bufferpool syn keyword sqlKeyword build bulk by byte bytes cache calibrate calibration -syn keyword sqlKeyword cancel capability cascade cast -syn keyword sqlKeyword catalog ceil change changes char char_convert check checksum -syn keyword sqlKeyword class classes client cmp +syn keyword sqlKeyword cancel capability cardinality cascade cast +syn keyword sqlKeyword catalog catch ceil change changes char char_convert +syn keyword sqlKeyword check checkpointlog checksum class classes client cmp syn keyword sqlKeyword cluster clustered collation syn keyword sqlKeyword column columns -syn keyword sqlKeyword command comments committed comparisons +syn keyword sqlKeyword command comments committed commitid comparisons syn keyword sqlKeyword compatible component compressed compute computes syn keyword sqlKeyword concat configuration confirm conflict connection syn keyword sqlKeyword console consolidate consolidated -syn keyword sqlKeyword constraint constraints content +syn keyword sqlKeyword constraint constraints content syn keyword sqlKeyword convert coordinate coordinator copy count count_set_bits -syn keyword sqlKeyword crc createtime cross cube cume_dist +syn keyword sqlKeyword crc createtime critical cross cube cume_dist syn keyword sqlKeyword current cursor data data database syn keyword sqlKeyword current_timestamp current_user cycle syn keyword sqlKeyword databases datatype dba dbfile @@ -506,83 +512,86 @@ syn keyword sqlKeyword decrypted default defaults default_dbspace deferred syn keyword sqlKeyword definer definition syn keyword sqlKeyword delay deleting delimited dependencies desc syn keyword sqlKeyword description deterministic directory -syn keyword sqlKeyword disable disabled disallow distinct do domain download duplicate -syn keyword sqlKeyword dsetpass dttm dynamic each earth editproc ejb -syn keyword sqlKeyword elimination ellipsoid -syn keyword sqlKeyword else elseif empty enable encapsulated encrypted end -syn keyword sqlKeyword encoding endif engine environment erase error escape escapes event +syn keyword sqlKeyword disable disabled disallow distinct disksandbox disk_sandbox +syn keyword sqlKeyword dn do domain download duplicate +syn keyword sqlKeyword dsetpass dttm dynamic each earth editproc effective ejb +syn keyword sqlKeyword elimination ellipsoid else elseif +syn keyword sqlKeyword email empty enable encapsulated encrypted encryption end +syn keyword sqlKeyword encoding endif engine environment erase error errors escape escapes event syn keyword sqlKeyword event_parameter every exception exclude excluded exclusive exec syn keyword sqlKeyword existing exists expanded expiry express exprtype extended_property syn keyword sqlKeyword external externlogin factor failover false syn keyword sqlKeyword fastfirstrow feature fieldproc file files filler syn keyword sqlKeyword fillfactor final finish first first_keyword first_value syn keyword sqlKeyword flattening -syn keyword sqlKeyword following force foreign format forxml forxml_sep fp frame -syn keyword sqlKeyword free freepage french fresh full function +syn keyword sqlKeyword following force foreign format forjson forxml forxml_sep fp frame +syn keyword sqlKeyword free freepage french fresh full function syn keyword sqlKeyword gb generic get_bit go global grid syn keyword sqlKeyword group handler hash having header hexadecimal syn keyword sqlKeyword hidden high history hg hng hold holdlock host syn keyword sqlKeyword hours http_body http_session_timeout id identified identity ignore syn keyword sqlKeyword ignore_dup_key ignore_dup_row immediate syn keyword sqlKeyword in inactiv inactive inactivity included increment incremental -syn keyword sqlKeyword index index_enabled index_lparen indexonly info -syn keyword sqlKeyword inline inner inout insensitive inserting -syn keyword sqlKeyword instead integrated -syn keyword sqlKeyword internal intersection into introduced inverse invoker +syn keyword sqlKeyword index index_enabled index_lparen indexonly info information +syn keyword sqlKeyword inheritance inline inner inout insensitive inserting +syn keyword sqlKeyword instead +syn keyword sqlKeyword internal intersection into introduced inverse invoker syn keyword sqlKeyword iq is isolation syn keyword sqlKeyword jar java java_location java_main_userid java_vm_options -syn keyword sqlKeyword jconnect jdk join kb key keep kerberos language last +syn keyword sqlKeyword jconnect jdk join json kb key keys keep language last syn keyword sqlKeyword last_keyword last_value lateral latitude -syn keyword sqlKeyword ld left len linear lf ln level like -syn keyword sqlKeyword limit local location log +syn keyword sqlKeyword ld ldap left len linear lf ln level like +syn keyword sqlKeyword limit local location log syn keyword sqlKeyword logging logical login logscan long longitude low lru ls -syn keyword sqlKeyword main major manual mark -syn keyword sqlKeyword match matched materialized max maxvalue maximum mb measure membership -syn keyword sqlKeyword merge metadata methods minimum minor minutes minvalue mirror -syn keyword sqlKeyword mode modify monitor move mru multiplex -syn keyword sqlKeyword name named namespaces national native natural new next nextval +syn keyword sqlKeyword main major manage manual mark master +syn keyword sqlKeyword match matched materialized max maxvalue maximum mb measure median membership +syn keyword sqlKeyword merge metadata methods migrate minimum minor minutes minvalue mirror +syn keyword sqlKeyword mode modify monitor move mru multiplex +syn keyword sqlKeyword name named namespaces national native natural new next nextval syn keyword sqlKeyword ngram no noholdlock nolock nonclustered none normal not -syn keyword sqlKeyword notify null nullable_constant nulls -syn keyword sqlKeyword object oem_string of off offline offset olap +syn keyword sqlKeyword notify null nullable_constant nulls +syn keyword sqlKeyword object objects oem_string of off offline offset olap syn keyword sqlKeyword old on online only openstring operator syn keyword sqlKeyword optimization optimizer option -syn keyword sqlKeyword or order organization others out outer over +syn keyword sqlKeyword or order ordinality organization others out outer over owner syn keyword sqlKeyword package packetsize padding page pages -syn keyword sqlKeyword paglock parallel parameter parent part -syn keyword sqlKeyword partition partitions partner password path pctfree -syn keyword sqlKeyword perms plan planar policy polygon populate port postfilter preceding +syn keyword sqlKeyword paglock parallel parameter parent part partial +syn keyword sqlKeyword partition partitions partner password path pctfree +syn keyword sqlKeyword permissions perms plan planar policy polygon populate port postfilter preceding syn keyword sqlKeyword precisionprefetch prefilter prefix preserve preview previous -syn keyword sqlKeyword primary prior priority priqty private privileges procedure profile +syn keyword sqlKeyword primary prior priority priqty private privilege privileges procedure profile profiling syn keyword sqlKeyword property_is_cumulative property_is_numeric public publication publish publisher syn keyword sqlKeyword quiesce quote quotes range readclientfile readcommitted reader readfile readonly syn keyword sqlKeyword readpast readuncommitted readwrite rebuild syn keyword sqlKeyword received recompile recover recursive references syn keyword sqlKeyword referencing regex regexp regexp_substr relative relocate -syn keyword sqlKeyword rename repeatable repeatableread replicate +syn keyword sqlKeyword rename repeatable repeatableread replicate replication syn keyword sqlKeyword requests request_timeout required rereceive resend reserve reset syn keyword sqlKeyword resizing resolve resource respect restart -syn keyword sqlKeyword restrict result retain -syn keyword sqlKeyword returns reverse right role -syn keyword sqlKeyword rollup root row row_number rowlock rows +syn keyword sqlKeyword restrict result retain retries +syn keyword sqlKeyword returns reverse right role roles +syn keyword sqlKeyword rollup root row row_number rowlock rows rowtype syn keyword sqlKeyword sa_index_hash sa_internal_fk_verify sa_internal_termbreak syn keyword sqlKeyword sa_order_preserving_hash sa_order_preserving_hash_big sa_order_preserving_hash_prefix -syn keyword sqlKeyword scale schedule schema scope scripted scroll seconds secqty security +syn keyword sqlKeyword sa_file_free_pages sa_internal_type_from_catalog sa_internal_valid_hash +syn keyword sqlKeyword sa_internal_validate_value sa_json_element +syn keyword sqlKeyword scale schedule schema scope script scripted scroll search seconds secqty security syn keyword sqlKeyword semi send sensitive sent sequence serializable -syn keyword sqlKeyword server server session set_bit set_bits sets +syn keyword sqlKeyword server severity session set_bit set_bits sets syn keyword sqlKeyword shapefile share side simple since site size skip -syn keyword sqlKeyword snap snapshot soapheader soap_header +syn keyword sqlKeyword snap snapshot soapheader soap_header syn keyword sqlKeyword spatial split some sorted_data syn keyword sqlKeyword sql sqlcode sqlid sqlflagger sqlstate sqrt square -syn keyword sqlKeyword stacker stale statement statistics status stddev_pop stddev_samp +syn keyword sqlKeyword stacker stale state statement statistics status stddev_pop stddev_samp syn keyword sqlKeyword stemmer stogroup stoplist storage store syn keyword sqlKeyword strip stripesizekb striping subpages subscribe subscription -syn keyword sqlKeyword subtransaction suser_id suser_name synchronization +syn keyword sqlKeyword subtransaction suser_id suser_name suspend synchronization syn keyword sqlKeyword syntax_error table tables tablock -syn keyword sqlKeyword tablockx tb temp template temporary term then ties -syn keyword sqlKeyword timezone timeout to to_char to_nchar tolerance top -syn keyword sqlKeyword traced_plan tracing -syn keyword sqlKeyword transfer transform transaction transactional treat tries -syn keyword sqlKeyword true tsequal type tune uncommitted unconditionally +syn keyword sqlKeyword tablockx target tb temp template temporary term then ties +syn keyword sqlKeyword timezone timeout tls to to_char to_nchar tolerance top +syn keyword sqlKeyword trace traced_plan tracing +syn keyword sqlKeyword transfer transform transaction transactional treat tries +syn keyword sqlKeyword true try tsequal type tune uncommitted unconditionally syn keyword sqlKeyword unenforced unicode unique unistr unit unknown unlimited unload syn keyword sqlKeyword unpartition unquiesce updatetime updating updlock upgrade upload syn keyword sqlKeyword upper usage use user @@ -593,14 +602,14 @@ syn keyword sqlKeyword verify versions view virtual wait syn keyword sqlKeyword warning wd web when where with with_auto syn keyword sqlKeyword with_auto with_cube with_rollup without syn keyword sqlKeyword with_lparen within word work workload write writefile -syn keyword sqlKeyword writeclientfile writer writers writeserver xlock -syn keyword sqlKeyword zeros zone -" XML +syn keyword sqlKeyword writeclientfile writer writers writeserver xlock +syn keyword sqlKeyword war xml zeros zone +" XML syn keyword sqlKeyword raw auto elements explicit " HTTP support syn keyword sqlKeyword authorization secure url service next_soap_header " HTTP 9.0.2 new procedure keywords -syn keyword sqlKeyword namespace certificate clientport proxy +syn keyword sqlKeyword namespace certificate certificates clientport proxy trusted_certificates_file " OLAP support 9.0.0 syn keyword sqlKeyword covar_pop covar_samp corr regr_slope regr_intercept syn keyword sqlKeyword regr_count regr_r2 regr_avgx regr_avgy @@ -610,6 +619,10 @@ syn keyword sqlKeyword regr_sxx regr_syy regr_sxy syn keyword sqlKeyword character dec options proc reference syn keyword sqlKeyword subtrans tran syn keyword +" Login Mode Options +syn keyword sqlKeywordLogin standard integrated kerberos LDAPUA +syn keyword sqlKeywordLogin cloudadmin mixed + " Spatial Predicates syn keyword sqlKeyword ST_Contains syn keyword sqlKeyword ST_ContainsFilter @@ -692,9 +705,9 @@ syn keyword sqlKeyword ST_LinearUnHash syn keyword sqlOperator in any some all between exists syn keyword sqlOperator like escape not is and or syn keyword sqlOperator minus -syn keyword sqlOperator prior distinct +syn keyword sqlOperator prior distinct unnest -syn keyword sqlStatement allocate alter attach backup begin break call case +syn keyword sqlStatement allocate alter attach backup begin break call case catch syn keyword sqlStatement checkpoint clear close comment commit configure connect syn keyword sqlStatement continue create deallocate declare delete describe syn keyword sqlStatement detach disconnect drop except execute exit explain fetch @@ -705,7 +718,7 @@ syn keyword sqlStatement prepare print put raiserror read readtext refresh relea syn keyword sqlStatement remote remove reorganize resignal restore resume syn keyword sqlStatement return revoke rollback save savepoint select syn keyword sqlStatement set setuser signal start stop synchronize -syn keyword sqlStatement system trigger truncate union unload update +syn keyword sqlStatement system trigger truncate try union unload update syn keyword sqlStatement validate waitfor whenever while window writetext @@ -715,7 +728,7 @@ syn keyword sqlType float int integer numeric syn keyword sqlType smallint tinyint real syn keyword sqlType money smallmoney syn keyword sqlType date datetime datetimeoffset smalldatetime time timestamp -syn keyword sqlType binary image varbinary uniqueidentifier +syn keyword sqlType binary image varray varbinary uniqueidentifier syn keyword sqlType unsigned " Spatial types syn keyword sqlType st_geometry st_point st_curve st_surface st_geomcollection @@ -736,8 +749,10 @@ syn keyword sqlOption Ansi_update_constraints syn keyword sqlOption Ansinull syn keyword sqlOption Auditing syn keyword sqlOption Auditing_options +syn keyword sqlOption Auto_commit_on_create_local_temp_index syn keyword sqlOption Background_priority syn keyword sqlOption Blocking +syn keyword sqlOption Blocking_others_timeout syn keyword sqlOption Blocking_timeout syn keyword sqlOption Chained syn keyword sqlOption Checkpoint_time @@ -754,6 +769,7 @@ syn keyword sqlOption Cooperative_commits syn keyword sqlOption Database_authentication syn keyword sqlOption Date_format syn keyword sqlOption Date_order +syn keyword sqlOption db_publisher syn keyword sqlOption Debug_messages syn keyword sqlOption Dedicated_task syn keyword sqlOption Default_dbspace @@ -764,14 +780,18 @@ syn keyword sqlOption Divide_by_zero_error syn keyword sqlOption Escape_character syn keyword sqlOption Exclude_operators syn keyword sqlOption Extended_join_syntax +syn keyword sqlOption Extern_login_credentials syn keyword sqlOption Fire_triggers syn keyword sqlOption First_day_of_week syn keyword sqlOption For_xml_null_treatment syn keyword sqlOption Force_view_creation syn keyword sqlOption Global_database_id syn keyword sqlOption Http_session_timeout +syn keyword sqlOption Http_connection_pool_basesize +syn keyword sqlOption Http_connection_pool_timeout syn keyword sqlOption Integrated_server_name syn keyword sqlOption Isolation_level +syn keyword sqlOption Java_class_path syn keyword sqlOption Java_location syn keyword sqlOption Java_main_userid syn keyword sqlOption Java_vm_options @@ -790,6 +810,7 @@ syn keyword sqlOption Max_recursive_iterations syn keyword sqlOption Max_statement_count syn keyword sqlOption Max_temp_space syn keyword sqlOption Min_password_length +syn keyword sqlOption Min_role_admins syn keyword sqlOption Nearest_century syn keyword sqlOption Non_keywords syn keyword sqlOption Odbc_describe_binary_as_varbinary @@ -807,6 +828,7 @@ syn keyword sqlOption Prefetch syn keyword sqlOption Preserve_source_format syn keyword sqlOption Prevent_article_pkey_update syn keyword sqlOption Priority +syn keyword sqlOption Progress_messages syn keyword sqlOption Query_mem_timeout syn keyword sqlOption Quoted_identifier syn keyword sqlOption Read_past_deleted @@ -814,6 +836,7 @@ syn keyword sqlOption Recovery_time syn keyword sqlOption Remote_idle_timeout syn keyword sqlOption Replicate_all syn keyword sqlOption Request_timeout +syn keyword sqlOption Reserved_keywords syn keyword sqlOption Return_date_time_as_string syn keyword sqlOption Rollback_on_deadlock syn keyword sqlOption Row_counts @@ -823,6 +846,12 @@ syn keyword sqlOption Sort_collation syn keyword sqlOption Sql_flagger_error_level syn keyword sqlOption Sql_flagger_warning_level syn keyword sqlOption String_rtruncation +syn keyword sqlOption st_geometry_asbinary_format +syn keyword sqlOption st_geometry_astext_format +syn keyword sqlOption st_geometry_asxml_format +syn keyword sqlOption st_geometry_describe_type +syn keyword sqlOption st_geometry_interpolation +syn keyword sqlOption st_geometry_on_invalid syn keyword sqlOption Subsume_row_locks syn keyword sqlOption Suppress_tds_debugging syn keyword sqlOption Synchronize_mirror_on_commit @@ -831,6 +860,7 @@ syn keyword sqlOption Temp_space_limit_check syn keyword sqlOption Time_format syn keyword sqlOption Time_zone_adjustment syn keyword sqlOption Timestamp_format +syn keyword sqlOption Timestamp_with_time_zone_format syn keyword sqlOption Truncate_timestamp_values syn keyword sqlOption Tsql_outer_joins syn keyword sqlOption Tsql_variables @@ -842,6 +872,7 @@ syn keyword sqlOption Uuid_has_hyphens syn keyword sqlOption Verify_password_function syn keyword sqlOption Wait_for_commit syn keyword sqlOption Webservice_namespace_host +syn keyword sqlOption Webservice_sessionid_name " Strings and characters: syn region sqlString start=+"+ end=+"+ contains=@Spell @@ -859,32 +890,18 @@ syn sync ccomment sqlComment syn sync ccomment sqlDashComment syn sync ccomment sqlSlashComment -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sql_syn_inits") - if version < 508 - let did_sql_syn_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi link <args> - endif - - HiLink sqlDashComment Comment - HiLink sqlSlashComment Comment - HiLink sqlMultiComment Comment - HiLink sqlNumber Number - HiLink sqlOperator Operator - HiLink sqlSpecial Special - HiLink sqlKeyword Keyword - HiLink sqlStatement Statement - HiLink sqlString String - HiLink sqlType Type - HiLink sqlFunction Function - HiLink sqlOption PreProc - - delcommand HiLink -endif +hi def link sqlDashComment Comment +hi def link sqlSlashComment Comment +hi def link sqlMultiComment Comment +hi def link sqlNumber Number +hi def link sqlOperator Operator +hi def link sqlSpecial Special +hi def link sqlKeyword Keyword +hi def link sqlStatement Statement +hi def link sqlString String +hi def link sqlType Type +hi def link sqlFunction Function +hi def link sqlOption PreProc let b:current_syntax = "sqlanywhere" diff --git a/runtime/tools/ccfilter_README.txt b/runtime/tools/ccfilter_README.txt index ff658c92fad5f92d2f10dbe8e98f706ad749cb42..3c12a8c89b3cba3d0b955b657af8486212d8a82b 100644 --- a/runtime/tools/ccfilter_README.txt +++ b/runtime/tools/ccfilter_README.txt @@ -11,7 +11,7 @@ so you would normally compile it with one of the following: cc -D_IRIX ccfilter.c -o ccfilter cc -D_SOLARIS ccfilter.c -o ccfilter cc -D_HPUX ccfilter.c -o ccfilter -You can then copy ccfilter to it's target destination (i.e: /usr/local/bin). +You can then copy ccfilter to its target destination (i.e: /usr/local/bin). The man page ccfilter.1 has to be copied to somewhere in your MANPATH, under a man1 directory (i.e: /usr/local/man/man1). diff --git a/runtime/tutor/tutor.zh.utf-8 b/runtime/tutor/tutor.zh.utf-8 new file mode 100644 index 0000000000000000000000000000000000000000..21d702051db4d90e835cfb55a1469c25912c5e61 --- /dev/null +++ b/runtime/tutor/tutor.zh.utf-8 @@ -0,0 +1,852 @@ +=============================================================================== += æ¡ è¿Ž é–± 讀 《 V I M æ•™ 程 》 ── 版本 1.5 = +=============================================================================== + vim 是一個具有很多命令的功能éžå¸¸å¼·å¤§çš„編輯器。é™äºŽç¯‡å¹…ï¼Œåœ¨æœ¬æ•™ç¨‹ç•¶ä¸ + ä¸å°±è©³ç´°ä»‹ç´¹äº†ã€‚本教程的è¨è¨ˆç›®æ¨™æ˜¯è¬›è¿°ä¸€äº›å¿…è¦çš„基本命令,而掌æ¡å¥½é€™ + äº›å‘½ä»¤ï¼Œæ‚¨å°±èƒ½å¤ å¾ˆå®¹æ˜“å°‡vim當作一個通用的è¬èƒ½ç·¨è¼¯å™¨ä¾†ä½¿ç”¨äº†ã€‚ + + 完æˆæœ¬æ•™ç¨‹çš„內容大約需è¦25-30分é˜ï¼Œå–決于您訓練的時間。 + + æ¯ä¸€ç¯€çš„命令æ“作將會更改本文。推薦您復制本文的一個副本,然後在副本上 + 進行訓練(如果您是通éŽ"vimtutor"來啟動教程的,那麼本文就已經是副本了)。 + + 切記一點︰本教程的è¨è¨ˆæ€è·¯æ˜¯åœ¨ä½¿ç”¨ä¸é€²è¡Œå¸ç¿’的。也就是說,您需è¦é€šéŽ + 執行命令來å¸ç¿’它們本身的æ£ç¢ºç”¨æ³•ã€‚如果您åªæ˜¯é–±è®€è€Œä¸æ“作,那麼您å¯èƒ½ + 會很快éºå¿˜é€™äº›å‘½ä»¤çš„ï¼ + + 好了,ç¾åœ¨è«‹ç¢ºå®šæ‚¨çš„Shift-Lock(大å°å¯«éŽ–定éµ)還沒有按下,然後按éµç›¤ä¸Š + çš„å—æ¯éµ j è¶³å¤ å¤šçš„æ¬¡æ•¸ä¾†ç§»å‹•å…‰æ¨™ï¼Œç›´åˆ°ç¬¬ä¸€ç¯€çš„å…§å®¹èƒ½å¤ å®Œå…¨å……æ»¿å±å¹•ã€‚ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第一講第一節︰移動光標 + + + ※※ è¦ç§»å‹•å…‰æ¨™ï¼Œè«‹ä¾ç…§èªªæ˜Žåˆ†åˆ¥æŒ‰ä¸‹ hã€jã€kã€l éµã€‚ ※※ + + ^ + k æ示︰ h çš„éµä½äºŽå·¦é‚Šï¼Œæ¯æ¬¡æŒ‰ä¸‹å°±æœƒå‘左移動。 + < h l > l çš„éµä½äºŽå³é‚Šï¼Œæ¯æ¬¡æŒ‰ä¸‹å°±æœƒå‘å³ç§»å‹•ã€‚ + j j éµçœ‹èµ·ä¾†å¾ˆè±¡ä¸€æ”¯å°–端方å‘æœä¸‹çš„ç®é 。 + v + + 1. 請隨æ„在å±å¹•å…§ç§»å‹•å…‰æ¨™ï¼Œç›´è‡³æ‚¨è¦ºå¾—舒æœç‚ºæ¢ã€‚ + + 2. 按下下行éµ(j),直到出ç¾å…‰æ¨™é‡å¾©ä¸‹è¡Œã€‚ + +---> ç¾åœ¨æ‚¨æ‡‰è©²å·²ç¶“å¸æœƒå¦‚何移動到下一講å§ã€‚ + + 3. ç¾åœ¨è«‹ä½¿ç”¨ä¸‹è¡Œéµï¼Œå°‡å…‰æ¨™ç§»å‹•åˆ°ç¬¬äºŒè¬›ã€‚ + +æ示︰如果您ä¸æ•¢ç¢ºå®šæ‚¨æ‰€æŒ‰ä¸‹çš„å—æ¯ï¼Œè«‹æŒ‰ä¸‹<ESC>éµå›žåˆ°æ£å¸¸(Normal)模å¼ã€‚ + 然後å†æ¬¡å¾žéµç›¤è¼¸å…¥æ‚¨æƒ³è¦çš„命令。 + +æ示︰光標éµæ‡‰ç•¶ä¹Ÿèƒ½æ£å¸¸å·¥ä½œçš„。但是使用hjkléµï¼Œåœ¨ç¿’æ…£ä¹‹å¾Œæ‚¨å°±èƒ½å¤ å¿«é€Ÿ + 地在å±å¹•å…§å››è™•ç§»å‹•å…‰æ¨™äº†ã€‚ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第一講第二節︰VIM的進入和退出 + + + !! 特別æ示︰敬請閱讀完整本一節的內容,然後æ‰èƒ½åŸ·è¡Œä»¥ä¸‹æ‰€è¬›è§£çš„命令。 + + 1. 請按<ESC>éµ(這是為了確ä¿æ‚¨è™•åœ¨æ£å¸¸æ¨¡å¼)。 + + 2. 然後輸入︰ :q! <回車> + +---> 這種方å¼çš„退出編輯器絕ä¸æœƒä¿å˜æ‚¨é€²å…¥ç·¨è¼¯å™¨ä»¥ä¾†æ‰€åšçš„改動。 + 如果您想ä¿å˜æ›´æ”¹å†é€€å‡ºï¼Œè«‹è¼¸å…¥ï¸° + :wq <回車> + + 3. 如果您看到了命令行æç¤ºç¬¦ï¼Œè«‹è¼¸å…¥èƒ½å¤ å¸¶æ‚¨å›žåˆ°æœ¬æ•™ç¨‹çš„å‘½ä»¤ï¼Œé‚£å°±æ˜¯ï¸° + + vimtutor <回車> + + 通常情æ³ä¸‹æ‚¨ä¹Ÿå¯ä»¥ç”¨é€™ç¨®æ–¹å¼ï¸° + + vim tutor <回車> + +---> 這裡的 'vim' 表示進入vim編輯器,而 'tutor'則是您準備è¦ç·¨è¼¯çš„文件。 + + 4. 如果您自信已經牢牢記ä½äº†é€™äº›æ¥é©Ÿçš„話,請從æ¥é©Ÿ1執行到æ¥é©Ÿ3退出,然 + 後å†æ¬¡é€²å…¥ç·¨è¼¯å™¨ã€‚接著將光標移動到第一講第三節來繼續我們的教程講解。 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第一講第三節︰文本編輯之刪除 + + + ** 在æ£å¸¸(Normal)模å¼ä¸‹ï¼Œå¯ä»¥æŒ‰ä¸‹ x éµä¾†åˆªé™¤å…‰æ¨™æ‰€åœ¨ä½ç½®çš„å—符。** + + 1. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的那一行。 + + 2. 為了修æ£è¼¸å…¥éŒ¯èª¤ï¼Œè«‹å°‡å…‰æ¨™ç§»è‡³æº–備刪除的å—符的ä½ç½®è™•ã€‚ + + 3. 然後按下 x éµå°‡éŒ¯èª¤å—符刪除掉。 + + 4. é‡å¾©æ¥é©Ÿ2到æ¥é©Ÿ4,直到å¥åä¿®æ£ç‚ºæ¢ã€‚ + +---> The ccow jumpedd ovverr thhe mooon. + + 5. 好了,該行已經修æ£äº†ï¼Œä¸‹ä¸€ç¯€å…§å®¹æ˜¯ç¬¬ä¸€è¬›ç¬¬å››ç¯€ã€‚ + +特別æ示︰在您ç€è¦½æœ¬æ•™ç¨‹æ™‚,ä¸è¦å¼·è¡Œè¨˜æ†¶ã€‚記ä½ä¸€é»žï¸°åœ¨ä½¿ç”¨ä¸å¸ç¿’。 + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第一講第四節︰文本編輯之æ’å…¥ + + + ** 在æ£å¸¸æ¨¡å¼ä¸‹ï¼Œå¯ä»¥æŒ‰ä¸‹ i éµä¾†æ’入文本。** + + 1. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的第一行。 + + 2. 為了使得第一行內容雷åŒäºŽç¬¬äºŒè¡Œï¼Œè«‹å°‡å…‰æ¨™ç§»è‡³æ–‡æœ¬ç¬¬ä¸€å€‹å—符準備æ’å…¥ + çš„ä½ç½®ã€‚ + + 3. 然後按下 i éµï¼ŒæŽ¥è‘—輸入必è¦çš„文本å—符。 + + 4. 所有文本都修æ£å®Œç•¢ï¼Œè«‹æŒ‰ä¸‹ <ESC> éµè¿”回æ£å¸¸æ¨¡å¼ã€‚ + é‡å¾©æ¥é©Ÿ2至æ¥é©Ÿ4以便修æ£å¥å。 + +---> There is text misng this . +---> There is some text missing from this line. + + 5. 如果您å°æ–‡æœ¬æ’å…¥æ“作已經很滿æ„,請接著閱讀下é¢çš„å°çµã€‚ + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第一講å°çµ + + + 1. 光標在å±å¹•æ–‡æœ¬ä¸çš„移動既å¯ä»¥ç”¨ç®é éµï¼Œä¹Ÿå¯ä»¥ä½¿ç”¨ hjkl å—æ¯éµã€‚ + h (左移) j (下行) k (上行) l (å³ç§») + + 2. 欲進入vim編輯器(從命令行æ示符),請輸入︰vim 文件å <回車> + + 3. 欲退出vim編輯器,請輸入以下命令放棄所有修改︰ + + <ESC> :q! <回車> + + 或者輸入以下命令ä¿å˜æ‰€æœ‰ä¿®æ”¹ï¸° + + <ESC> :wq <回車> + + 4. 在æ£å¸¸æ¨¡å¼ä¸‹åˆªé™¤å…‰æ¨™æ‰€åœ¨ä½ç½®çš„å—符,請按︰ x + + 5. 在æ£å¸¸æ¨¡å¼ä¸‹è¦åœ¨å…‰æ¨™æ‰€åœ¨ä½ç½®é–‹å§‹æ’入文本,請按︰ + + i 輸入必è¦æ–‡æœ¬ <ESC> + +特別æ示︰按下 <ESC> éµæœƒå¸¶æ‚¨å›žåˆ°æ£å¸¸æ¨¡å¼æˆ–者å–消一個ä¸æœŸæœ›æˆ–è€…éƒ¨åˆ†å®Œæˆ +的命令。 + +好了,第一講到æ¤çµæŸã€‚下é¢æŽ¥ä¸‹ä¾†ç¹¼çºŒç¬¬äºŒè¬›çš„內容。 + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第二講第一節︰刪除類命令 + + + ** 輸入 dw å¯ä»¥å¾žå…‰æ¨™è™•åˆªé™¤è‡³ä¸€å€‹å–®å—/單詞的末尾。** + + 1. 請按下 <ESC> éµç¢ºä¿æ‚¨è™•äºŽæ£å¸¸æ¨¡å¼ã€‚ + + 2. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的那一行。 + + 3. 請將光標移至準備è¦åˆªé™¤çš„單詞的開始。 + + 4. 接著輸入 dw 刪除掉該單詞。 + + 特別æ示︰您所輸入的 dw 會在您輸入的åŒæ™‚出ç¾åœ¨å±å¹•çš„最後一行。如果您輸 + 入有誤,請按下 <ESC> éµå–消,然後é‡æ–°å†ä¾†ã€‚ + +---> There are a some words fun that don't belong paper in this sentence. + + 5. é‡å¾©æ¥é©Ÿ3至æ¥é©Ÿ4,直至å¥åä¿®æ£å®Œç•¢ã€‚接著繼續第二講第二節內容。 + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第二講第二節︰其他刪除類命令 + + + ** 輸入 d$ 從當å‰å…‰æ¨™åˆªé™¤åˆ°è¡Œæœ«ã€‚** + + 1. 請按下 <ESC> éµç¢ºä¿æ‚¨è™•äºŽæ£å¸¸æ¨¡å¼ã€‚ + + 2. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的那一行。 + + 3. 請將光標移動到該行的尾部(也就是在第一個點號‘.’後é¢)。 + + 4. 然後輸入 d$ 從光標處刪至當å‰è¡Œå°¾éƒ¨ã€‚ + +---> Somebody typed the end of this line twice. end of this line twice. + + + 5. 請繼續å¸ç¿’第二講第三節就知é“是怎麼回事了。 + + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第二講第三節︰關于命令和å°è±¡ + + + 刪除命令 d çš„æ ¼å¼å¦‚下︰ + + [number] d object 或者 d [number] object + + å…¶æ„如下︰ + number - 代表執行命令的次數(å¯é¸é …,缺çœè¨ç½®ç‚º 1 )。 + d - 代表刪除。 + object - 代表命令所è¦æ“作的å°è±¡(下é¢æœ‰ç›¸é—œä»‹ç´¹)。 + + 一個簡çŸçš„å°è±¡åˆ—表︰ + w - 從當å‰å…‰æ¨™ç•¶å‰ä½ç½®ç›´åˆ°å–®å—/å–®è©žæœ«å°¾ï¼ŒåŒ…æ‹¬ç©ºæ ¼ã€‚ + e - 從當å‰å…‰æ¨™ç•¶å‰ä½ç½®ç›´åˆ°å–®å—/單詞末尾,但是 *ä¸* åŒ…æ‹¬ç©ºæ ¼ã€‚ + $ - 從當å‰å…‰æ¨™ç•¶å‰ä½ç½®ç›´åˆ°ç•¶å‰è¡Œæœ«ã€‚ + +特別æ示︰ + å°äºŽå‹‡äºŽæŽ¢ç´¢è€…,請在æ£å¸¸æ¨¡å¼ä¸‹é¢åƒ…按代表相應å°è±¡çš„éµè€Œä¸ä½¿ç”¨å‘½ä»¤ï¼Œå‰‡ + 將看到光標的移動æ£å¦‚上é¢çš„å°è±¡åˆ—表所代表的一樣。 + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第二講第四節︰å°è±¡å‘½ä»¤çš„ç‰¹æ®Šæƒ…æ³ + + + ** 輸入 dd å¯ä»¥åˆªé™¤æ•´ä¸€å€‹ç•¶å‰è¡Œã€‚ ** + + é‘’äºŽæ•´è¡Œåˆªé™¤çš„é«˜é »åº¦ï¼ŒVIM çš„è¨è¨ˆè€…決定è¦ç°¡åŒ–整行刪除,僅需è¦åœ¨åŒä¸€è¡Œä¸Š + 擊打兩次 d å°±å¯ä»¥åˆªé™¤æŽ‰å…‰æ¨™æ‰€åœ¨çš„整行了。 + + 1. 請將光標移動到本節ä¸ä¸‹é¢çš„çŸå¥æ®µè½ä¸çš„第二行。 + 2. 輸入 dd 刪除該行。 + 3. 然後移動到第四行。 + 4. 接著輸入 2dd (還記得å‰é¢è¬›éŽçš„ number-command-object 嗎?) 刪除兩行。 + + 1) Roses are red, + 2) Mud is fun, + 3) Violets are blue, + 4) I have a car, + 5) Clocks tell time, + 6) Sugar is sweet + 7) And so are you. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第二講第五節︰撤消類命令 + + + ** 輸入 u 來撤消最後執行的命令,輸入 U 來修æ£æ•´è¡Œã€‚** + + 1. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的那一行,並將其置于第一個錯誤 + 處。 + 2. 輸入 x 刪除第一個ä¸æƒ³ä¿ç•™çš„å—æ¯ã€‚ + 3. 然後輸入 u 撤消最後執行的(一次)命令。 + 4. 這次è¦ä½¿ç”¨ x ä¿®æ£æœ¬è¡Œçš„所有錯誤。 + 5. ç¾åœ¨è¼¸å…¥ä¸€å€‹å¤§å¯«çš„ U ,æ¢å¾©åˆ°è©²è¡Œçš„原始狀態。 + 6. 接著多次輸入 u 以撤消 U 以åŠæ›´å‰çš„命令。 + 7. 然後多次輸入 CTRL-R (先按下 CTRL éµä¸æ”¾é–‹ï¼ŒæŽ¥è‘—輸入 R éµ) ,這樣就 + å¯ä»¥åŸ·è¡Œæ¢å¾©å‘½ä»¤ï¼Œä¹Ÿå°±æ˜¯æ’¤æ¶ˆæŽ‰æ’¤æ¶ˆå‘½ä»¤ã€‚ + +---> Fiix the errors oon thhis line and reeplace them witth undo. + + 8. 這些都是éžå¸¸æœ‰ç”¨çš„命令。下é¢æ˜¯ç¬¬äºŒè¬›çš„å°çµäº†ã€‚ + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第二講å°çµ + + + 1. 欲從當å‰å…‰æ¨™åˆªé™¤è‡³å–®å—/單詞末尾,請輸入︰dw + + 2. 欲從當å‰å…‰æ¨™åˆªé™¤è‡³ç•¶å‰è¡Œæœ«å°¾ï¼Œè«‹è¼¸å…¥ï¸°d$ + + 3. 欲刪除整行,請輸入︰dd + + 4. 在æ£å¸¸æ¨¡å¼ä¸‹ä¸€å€‹å‘½ä»¤çš„æ ¼å¼æ˜¯ï¸° + + [number] command object 或者 command [number] object + å…¶æ„是︰ + number - 代表的是命令執行的次數 + command - 代表è¦åšçš„事情,比如 d 代表刪除 + object - 代表è¦æ“作的å°è±¡ï¼Œæ¯”如 w 代表單å—/單詞,$ 代表到行末ç‰ç‰ã€‚ + $ (to the end of line), etc. + + 5. 欲撤消以å‰çš„æ“作,請輸入︰u (å°å¯«çš„u) + 欲撤消在一行ä¸æ‰€åšçš„改動,請輸入︰U (大寫的U) + 欲撤消以å‰çš„撤消命令,æ¢å¾©ä»¥å‰çš„æ“作çµæžœï¼Œè«‹è¼¸å…¥ï¸°CTRL-R + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第三講第一節︰置入類命令 + + + ** 輸入 p 將最後一次刪除的內容置入光標之後 ** + + 1. 請將光標移動到本節ä¸ä¸‹é¢ç¤ºèŒƒæ®µè½çš„首行。 + + 2. 輸入 dd 將該行刪除,這樣會將該行ä¿å˜åˆ°vimçš„ç·©æ²–å€ä¸ã€‚ + + 3. 接著將光標移動到準備置入的ä½ç½®çš„上方。記ä½ï¸°æ˜¯ä¸Šæ–¹å“¦ã€‚ + + 4. 然後在æ£å¸¸æ¨¡å¼ä¸‹(<ESC>éµé€²å…¥),輸入 p 將該行粘貼置入。 + + 5. é‡å¾©æ¥é©Ÿ2至æ¥é©Ÿ4,將所有的行ä¾åºæ”¾ç½®åˆ°æ£ç¢ºçš„ä½ç½®ä¸Šã€‚ + + d) Can you learn too? + b) Violets are blue, + c) Intelligence is learned, + a) Roses are red, + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第三講第二節︰替æ›é¡žå‘½ä»¤ + + + ** 輸入 r 和一個å—符替æ›å…‰æ¨™æ‰€åœ¨ä½ç½®çš„å—符。** + + 1. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的第一行。 + + 2. 請移動光標到第一個錯誤的é©ç•¶ä½ç½®ã€‚ + + 3. 接著輸入 r ,這樣就能將錯誤替æ›æŽ‰äº†ã€‚ + + 4. é‡å¾©æ¥é©Ÿ2å’Œæ¥é©Ÿ3,直到第一行已經修改完畢。 + +---> Whan this lime was tuoed in, someone presswd some wrojg keys! +---> When this line was typed in, someone pressed some wrong keys! + + 5. 然後我們繼續å¸æ ¡ç¬¬ä¸‰è¬›ç¬¬ä¸‰ç¯€ã€‚ + +特別æ示︰切記您è¦åœ¨ä½¿ç”¨ä¸å¸ç¿’,而ä¸æ˜¯åœ¨è¨˜æ†¶ä¸å¸ç¿’。 + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第三講第三節︰更改類命令 + + + ** è¦æ”¹è®Šä¸€å€‹å–®å—/單詞的部分或者全部,請輸入 cw ** + + 1. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的第一行。 + + 2. 接著把光標放在單詞 lubw çš„å—æ¯ u çš„ä½ç½®é‚£è£¡ã€‚ + + 3. 然後輸入 cw å°±å¯ä»¥ä¿®æ£è©²å–®è©žäº†(在本例這裡是輸入 ine 。) + + 4. 最後按 <ESC> éµï¼Œç„¶å¾Œå…‰æ¨™å®šä½åˆ°ä¸‹ä¸€å€‹éŒ¯èª¤ç¬¬ä¸€å€‹æº–備更改的å—æ¯è™•ã€‚ + + 5. é‡å¾©æ¥é©Ÿ3å’Œæ¥é©Ÿ4,直到第一個å¥å完全雷åŒç¬¬äºŒå€‹å¥å。 + +---> This lubw has a few wptfd that mrrf changing usf the change command. +---> This line has a few words that need changing using the change command. + +æç¤ºï¸°è«‹æ³¨æ„ cw 命令ä¸åƒ…僅是替æ›äº†ä¸€å€‹å–®è©žï¼Œä¹Ÿè®“您進入文本æ’入狀態了。 + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第三講第四節︰使用c指令的其他更改類命令 + + + ** 更改類指令å¯ä»¥ä½¿ç”¨åŒåˆªé™¤é¡žå‘½ä»¤æ‰€ä½¿ç”¨çš„å°è±¡åƒæ•¸ã€‚** + + 1. 更改類指令的工作方å¼è·Ÿåˆªé™¤é¡žå‘½ä»¤æ˜¯ä¸€è‡´çš„。æ“ä½œæ ¼å¼æ˜¯ï¸° + + [number] c object 或者 c [number] object + + 2. å°è±¡åƒæ•¸ä¹Ÿæ˜¯ä¸€æ¨£çš„,比如 w 代表單å—/單詞,$代表行末ç‰ç‰ã€‚ + + 3. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的第一行。 + + 4. 接著將光標移動到第一個錯誤處。 + + 5. 然後輸入 c$ 使得該行剩下的部分更æ£å¾—åŒç¬¬äºŒè¡Œä¸€æ¨£ã€‚最後按 <ESC> éµã€‚ + +---> The end of this line needs some help to make it like the second. +---> The end of this line needs to be corrected using the c$ command. + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第三講å°çµ + + + 1. è¦é‡æ–°ç½®å…¥å·²ç¶“刪除的文本內容,請輸入å°å¯«å—æ¯ p。該æ“作å¯ä»¥å°‡å·²åˆªé™¤ + 的文本內容置于光標之後。如果最後一次刪除的是一個整行,那麼該行將置 + 于當å‰å…‰æ¨™æ‰€åœ¨è¡Œçš„下一行。 + + 2. è¦æ›¿æ›å…‰æ¨™æ‰€åœ¨ä½ç½®çš„å—符,請輸入å°å¯«çš„ r å’Œè¦æ›¿æ›æŽ‰åŽŸä½ç½®å—ç¬¦çš„æ–°å— + 符å³å¯ã€‚ + + 3. 更改類命令å…許您改變指定的å°è±¡ï¼Œå¾žç•¶å‰å…‰æ¨™æ‰€åœ¨ä½ç½®ç›´åˆ°å°è±¡çš„末尾。 + 比如輸入 cw å¯ä»¥æ›¿æ›ç•¶å‰å…‰æ¨™åˆ°å–®è©žçš„末尾的內容;輸入 c$ å¯ä»¥æ›¿æ›ç•¶ + å‰å…‰æ¨™åˆ°è¡Œæœ«çš„內容。 + + 4. æ›´æ”¹é¡žå‘½ä»¤çš„æ ¼å¼æ˜¯ï¸° + + [number] c object 或者 c [number] object + +下é¢æˆ‘們繼續å¸ç¿’下一講。 + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第四講第一節︰定ä½åŠæ–‡ä»¶ç‹€æ…‹ + + + ** 輸入 CTRL-g 顯示當å‰ç·¨è¼¯æ–‡ä»¶ä¸ç•¶å‰å…‰æ¨™æ‰€åœ¨è¡Œä½ç½®ä»¥åŠæ–‡ä»¶ç‹€æ…‹ä¿¡æ¯ã€‚ + 輸入 SHIFT-G 則直接跳轉到文件ä¸çš„æŸä¸€æŒ‡å®šè¡Œã€‚** + + æ示︰切記è¦å…ˆé€šè®€æœ¬ç¯€å…§å®¹ï¼Œä¹‹å¾Œæ‰å¯ä»¥åŸ·è¡Œä»¥ä¸‹æ¥é©Ÿ!!! + + 1. 按下 CTRL éµä¸æ”¾é–‹ç„¶å¾ŒæŒ‰ g éµã€‚然後就會看到é é¢æœ€åº•éƒ¨å‡ºç¾ä¸€å€‹ç‹€æ…‹ä¿¡ + æ¯è¡Œï¼Œé¡¯ç¤ºçš„內容是當å‰ç·¨è¼¯çš„文件å和文件的總行數。請記ä½æ¥é©Ÿ3的行號。 + + 2. 按下 SHIFT-G éµå¯ä»¥ä½¿å¾—當å‰å…‰æ¨™ç›´æŽ¥è·³è½‰åˆ°æ–‡ä»¶æœ€å¾Œä¸€è¡Œã€‚ + + 3. 輸入您曾åœç•™çš„行號,然後按下 SHIFT-G。這樣就å¯ä»¥è¿”回到您第一次按下 + CTRL-g 時所在的行好了。注æ„︰輸入行號時,行號是ä¸æœƒåœ¨å±å¹•ä¸Šé¡¯ç¤ºå‡ºä¾† + 的。 + + 4. 如果願æ„,您å¯ä»¥ç¹¼çºŒåŸ·è¡Œæ¥é©Ÿ1至æ¥é©Ÿä¸‰ã€‚ + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第四講第二節︰æœç´¢é¡žå‘½ä»¤ + + + ** 輸入 / 以åŠå°¾éš¨çš„å—符串å¯ä»¥ç”¨ä»¥åœ¨ç•¶å‰æ–‡ä»¶ä¸æŸ¥æ‰¾è©²å—符串。** + + 1. 在æ£å¸¸æ¨¡å¼ä¸‹è¼¸å…¥ / å—符。您æ¤æ™‚會注æ„到該å—符和光標都會出ç¾åœ¨å±å¹•åº• + 部,這跟 : 命令是一樣的。 + + 2. 接著輸入 errroor <回車>。那個errroor就是您è¦æŸ¥æ‰¾çš„å—符串。 + + 3. è¦æŸ¥æ‰¾åŒä¸Šä¸€æ¬¡çš„å—符串,åªéœ€è¦æŒ‰ n éµã€‚è¦å‘相åæ–¹å‘查找åŒä¸Šä¸€æ¬¡çš„å— + 符串,請輸入 Shift-N å³å¯ã€‚ + + 4. 如果您想逆å‘查找å—符串,請使用 ? 代替 / 進行。 + +---> When the search reaches the end of the file it will continue at the start. + + "errroor" is not the way to spell error; errroor is an error. + + æ示︰如果查找已經到é”文件末尾,查找會自動從文件é 部繼續查找。 + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第四講第三節︰é…å°æ‹¬è™Ÿçš„查找 + + + ** 按 % å¯ä»¥æŸ¥æ‰¾é…å°çš„括號 )ã€]ã€}。** + + 1. 把光標放在本節下é¢æ¨™è¨˜æœ‰ --> 那一行ä¸çš„任何一個 (ã€[ 或 { 處。 + + 2. 接著按 % å—符。 + + 3. æ¤æ™‚光標的ä½ç½®æ‡‰ç•¶æ˜¯åœ¨é…å°çš„括號處。 + + 4. å†æ¬¡æŒ‰ % å°±å¯ä»¥è·³å›žé…å°çš„第一個括號處。 + +---> This ( is a test line with ('s, ['s ] and {'s } in it. )) + +æ示︰在程åºèª¿è©¦æ™‚,這個功能用來查找ä¸é…å°çš„括號是很有用的。 + + + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第四講第四節︰修æ£éŒ¯èª¤çš„方法之一 + + + ** 輸入 :s/old/new/g å¯ä»¥æ›¿æ› old 為 new。** + + 1. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的那一行。 + + 2. 輸入 :s/thee/the <回車> 。請注æ„該命令åªæ”¹è®Šå…‰æ¨™æ‰€åœ¨è¡Œçš„ç¬¬ä¸€å€‹åŒ¹é… + 串。 + + 3. 輸入 :s/thee/the/g 則是替æ›å…¨è¡Œçš„匹é…串。 + +---> the best time to see thee flowers is in thee spring. + + 4. è¦æ›¿æ›å…©è¡Œä¹‹é–“出ç¾çš„æ¯å€‹åŒ¹é…串,請輸入 :#,#s/old/new/g (#,#代表的是 + 兩行的行號)。輸入 :%s/old/new/g 則是替æ›æ•´å€‹æ–‡ä»¶ä¸çš„æ¯å€‹åŒ¹é…串。 + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第四講å°çµ + + + 1. Ctrl-g 用于顯示當å‰å…‰æ¨™æ‰€åœ¨ä½ç½®å’Œæ–‡ä»¶ç‹€æ…‹ä¿¡æ¯ã€‚Shift-G 用于將光標跳 + 轉至文件最後一行。先敲入一個行號然後按 Shift-G 則是將光標移動至該行 + 號代表的行。 + + 2. 輸入 / 然後緊隨一個å—符串是則是在當å‰æ‰€ç·¨è¼¯çš„文檔ä¸å‘後查找該å—符串。 + 輸入å•è™Ÿ ? 然後緊隨一個å—符串是則是在當å‰æ‰€ç·¨è¼¯çš„文檔ä¸å‘å‰æŸ¥æ‰¾è©²å— + 符串。完æˆä¸€æ¬¡æŸ¥æ‰¾ä¹‹å¾ŒæŒ‰ n éµå‰‡æ˜¯é‡å¾©ä¸Šä¸€æ¬¡çš„命令,å¯åœ¨åŒä¸€æ–¹å‘上查 + 找下一個å—符串所在;或者按 Shift-N å‘相åæ–¹å‘查找下該å—符串所在。 + + 3. 如果光標當å‰ä½ç½®æ˜¯æ‹¬è™Ÿ(ã€)ã€[ã€]ã€{ã€},按 % å¯ä»¥å°‡å…‰æ¨™ç§»å‹•åˆ°é…å°çš„ + 括號上。 + + 4. 在一行內替æ›é 一個å—符串 old 為新的å—符串 new,請輸入 :s/old/new + 在一行內替æ›æ‰€æœ‰çš„å—符串 old 為新的å—符串 new,請輸入 :s/old/new/g + 在兩行內替æ›æ‰€æœ‰çš„å—符串 old 為新的å—符串 new,請輸入 :#,#s/old/new/g + 在文件內替æ›æ‰€æœ‰çš„å—符串 old 為新的å—符串 new,請輸入 :%s/old/new/g + 進行全文替æ›æ™‚è©¢å•ç”¨æˆ¶ç¢ºèªæ¯å€‹æ›¿æ›éœ€æ·»åŠ c é¸é …,請輸入 :%s/old/new/gc + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第五講第一節︰在 VIM 內執行外部命令的方法 + + + ** 輸入 :! 然後緊隨著輸入一個外部命令å¯ä»¥åŸ·è¡Œè©²å¤–部命令。** + + 1. 按下我們所熟悉的 : 命令è¨ç½®å…‰æ¨™åˆ°å±å¹•åº•éƒ¨ã€‚這樣就å¯ä»¥è®“您輸入命令了。 + + 2. 接著輸入感嘆號 ! 這個å—符,這樣就å…許您執行外部的 shell 命令了。 + + 3. 我們以 ls 命令為例。輸入 !ls <回車> 。該命令就會列舉出您當å‰ç›®éŒ„çš„ + 內容,就如åŒæ‚¨åœ¨å‘½ä»¤è¡Œæ示符下輸入 ls 命令的çµæžœä¸€æ¨£ã€‚如果 !ls æ²’èµ· + 作用,您å¯ä»¥è©¦è©¦ :!dir 看看。 + +---> æ示︰ 所有的外部命令都å¯ä»¥ä»¥é€™ç¨®æ–¹å¼åŸ·è¡Œã€‚ + +---> æ示︰ 所有的 : å‘½ä»¤éƒ½å¿…é ˆä»¥ <回車> 告終。 + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第五講第二節︰關于ä¿å˜æ–‡ä»¶çš„æ›´å¤šä¿¡æ¯ + + + ** è¦å°‡å°æ–‡ä»¶çš„改動ä¿å˜åˆ°æ–‡ä»¶ä¸ï¼Œè«‹è¼¸å…¥ :w FILENAME ** + + 1. 輸入 :!dir 或者 :!ls ç²çŸ¥ç•¶å‰ç›®éŒ„的內容。您應當已知é“最後還得敲 + <回車> å§ã€‚ + + 2. é¸æ“‡ä¸€å€‹å°šæœªå˜åœ¨æ–‡ä»¶å,比如 TEST 。 + + 3. 接著輸入 :w TEST (æ¤è™• TEST 是您所é¸æ“‡çš„文件å。) + + 4. 該命令會以 TEST 為文件åä¿å˜æ•´å€‹æ–‡ä»¶ (VIM 教程)。為了確ä¿æ£ç¢ºä¿å˜ï¼Œ + è«‹å†æ¬¡è¼¸å…¥ :!dir 查看您的目錄列表內容。 + +---> 請注æ„︰如果您退出 VIM 然後在以文件å TEST 為åƒæ•¸é€²å…¥ï¼Œé‚£éº¼è©²æ–‡ä»¶å…§ + 容應該åŒæ‚¨ä¿å˜æ™‚的文件內容是完全一樣的。 + + 5. ç¾åœ¨æ‚¨å¯ä»¥é€šéŽè¼¸å…¥ :!rm TEST 來刪除 TEST 文件了。 + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第五講第三節︰一個具有é¸æ“‡æ€§çš„ä¿å˜å‘½ä»¤ + + + ** è¦ä¿å˜æ–‡ä»¶çš„部分內容,請輸入 :#,# w FILENAME ** + + 1. å†ä¾†åŸ·è¡Œä¸€æ¬¡ :!dir 或者 :!ls ç²çŸ¥ç•¶å‰ç›®éŒ„的內容,然後é¸æ“‡ä¸€å€‹åˆé©çš„ + ä¸é‡å的文件å,比如 TEST 。 + + 2. 接著將光標移動至本é çš„æœ€é ‚ç«¯ï¼Œç„¶å¾ŒæŒ‰ CTRL-g 找到該行的行號。別忘了 + 行號哦。 + + 3. 接著把光標移動至本é 的最底端,å†æŒ‰ä¸€æ¬¡ CTRL-g 。也別忘了這個行好哦。 + + 4. 為了åªä¿å˜æ–‡ç« çš„æŸå€‹éƒ¨åˆ†ï¼Œè«‹è¼¸å…¥ :#,# w TEST 。這裡的 #,# å°±æ˜¯ä¸Šé¢ + è¦æ±‚您記ä½çš„行號(é ‚ç«¯è¡Œè™Ÿ,底端行號),而 TEST 就是é¸å®šçš„文件å。 + + 5. 最後,用 :!dir 確èªæ–‡ä»¶æ˜¯å¦æ£ç¢ºä¿å˜ã€‚但是這次先別刪除掉。 + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第五講第四節︰æå–å’Œåˆä¸¦æ–‡ä»¶ + + + ** è¦å‘當å‰æ–‡ä»¶ä¸æ’å…¥å¦å¤–的文件的內容,請輸入 :r FILENAME ** + + 1. è«‹éµå…¥ :!dir 確èªæ‚¨å‰é¢å‰µå»ºçš„ TEST 文件還在。 + + 2. 然後將光標移動至當å‰é é¢çš„é ‚ç«¯ã€‚ + +特別æ示︰ 執行æ¥é©Ÿ3之後您將看到第五講第三節,請屆時å†å¾€ä¸‹ç§»å‹•å›žåˆ°é€™è£¡ä¾†ã€‚ + + 3. æŽ¥è‘—é€šéŽ :r TEST å°‡å‰é¢å‰µå»ºçš„å為 TEST 的文件æå–進來。 + +特別æ示︰您所æå–進來的文件將從光標所在ä½ç½®è™•é–‹å§‹ç½®å…¥ã€‚ + + 4. 為了確èªæ–‡ä»¶å·²ç¶“æå–æˆåŠŸï¼Œç§»å‹•å…‰æ¨™å›žåˆ°åŽŸä¾†çš„ä½ç½®å°±å¯ä»¥æ³¨æ„有兩份第 + 五講第三節,一份是原本,å¦å¤–一份是來自文件的副本。 + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第五講å°çµ + + + 1. :!command 用于執行一個外部命令 command。 + + 請看一些實際例å︰ + :!dir - 用于顯示當å‰ç›®éŒ„的內容。 + :!rm FILENAME - 用于刪除å為 FILENAME 的文件。 + + 2. :w FILENAME å¯å°‡ç•¶å‰ VIM ä¸æ£åœ¨ç·¨è¼¯çš„文件ä¿å˜åˆ°å為 FILENAME + 的文件ä¸ã€‚ + + 3. :#,#w FILENAME å¯å°‡ç•¶å‰ç·¨è¼¯æ–‡ä»¶ç¬¬ # 行至第 # 行的內容ä¿å˜åˆ°æ–‡ä»¶ + FILENAME ä¸ã€‚ + + 4. :r FILENAME å¯æå–ç£ç›¤æ–‡ä»¶ FILENAME 並將其æ’入到當å‰æ–‡ä»¶çš„光標ä½ç½® + 後é¢ã€‚ + + + + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第å…講第一節︰打開類命令 + + + ** 輸入 o 將在光標的下方打開新的一行並進入æ’入模å¼ã€‚** + + 1. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的那一行。 + + 2. 接著輸入å°å¯«çš„ o 在光標 *下方* 打開新的一行並進入æ’入模å¼ã€‚ + + 3. 然後復制標記有 ---> 的行並按 <ESC> éµé€€å‡ºæ’入模å¼è€Œé€²å…¥æ£å¸¸æ¨¡å¼ã€‚ + +---> After typing o the cursor is placed on the open line in Insert mode. + + 4. 為了在光標 *上方* 打開新的一行,åªéœ€è¦è¼¸å…¥å¤§å¯«çš„ O 而ä¸æ˜¯å°å¯«çš„ o + å°±å¯ä»¥äº†ã€‚請在下行測試一下å§ã€‚當光標處在在該行上時,按 Shift-Oå¯ä»¥ + 在該行上方新開一行。 + +Open up a line above this by typing Shift-O while the cursor is on this line. + + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第å…講第二節︰光標後æ’入類命令 + + + ** 輸入 a å°‡å¯åœ¨å…‰æ¨™ä¹‹å¾Œæ’入文本。 ** + + 1. 請在æ£å¸¸æ¨¡å¼ä¸‹é€šéŽè¼¸å…¥ $ 將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的第一行 + 的末尾。 + + 2. 接著輸入å°å¯«çš„ a 則å¯åœ¨å…‰æ¨™ä¹‹å¾Œæ’入文本了。大寫的 A 則å¯ä»¥ç›´æŽ¥åœ¨è¡Œ + 末æ’入文本。 + +æ示︰輸入大寫 A çš„æ“作方法å¯ä»¥åœ¨è¡Œæœ«æ’入文本,é¿å…了輸入 i,光標定ä½åˆ° + 最後一個å—符,輸入的文本,<ESC> 回復æ£å¸¸æ¨¡å¼ï¼Œç®é å³éµç§»å‹•å…‰æ¨™ä»¥åŠ + x 刪除當å‰å…‰æ¨™æ‰€åœ¨ä½ç½®å—符ç‰ç‰è«¸å¤šç¹é›œçš„æ“作。 + + 3. æ“作之後第一行就å¯ä»¥è£œå……完整了。請注æ„光標後æ’入文本與æ’入模å¼æ˜¯åŸº + 本完全一致的,åªæ˜¯æ–‡æœ¬æ’入的ä½ç½®å®šä½ç¨æœ‰ä¸åŒç½·äº†ã€‚ + +---> This line will allow you to practice +---> This line will allow you to practice appending text to the end of a line. + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第å…講第三節︰å¦å¤–一個置æ›é¡žå‘½ä»¤çš„版本 + + + ** 輸入大寫的 R å¯é€£çºŒæ›¿æ›å¤šå€‹å—符。** + + 1. 請將光標移動到本節ä¸ä¸‹é¢æ¨™è¨˜æœ‰ ---> 的第一行。 + + 2. 移動光標到第一行ä¸ä¸åŒäºŽæ¨™æœ‰ ---> 的第二行的第一個單詞的開始,å³å–® + è©ž last 處。 + + 3. 然後輸入大寫的 R 開始把第一行ä¸çš„ä¸åŒäºŽç¬¬äºŒè¡Œçš„剩余å—符é€ä¸€è¼¸å…¥ï¼Œå°± + å¯ä»¥å…¨éƒ¨æ›¿æ›æŽ‰åŽŸæœ‰çš„å—符而使得第一行完全雷åŒç¬¬äºŒè¡Œäº†ã€‚ + +---> To make the first line the same as the last on this page use the keys. +---> To make the first line the same as the second, type R and the new text. + + 4. 請注æ„︰如果您按 <ESC> 退出置æ›æ¨¡å¼å›žå¾©æ£å¸¸æ¨¡å¼ï¼Œå°šæœªæ›¿æ›çš„æ–‡æœ¬å°‡ä» + 然ä¿æŒåŽŸç‹€ã€‚ + + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第å…講第四節︰è¨ç½®é¡žå‘½ä»¤çš„é¸é … + + + ** è¨ç½®å¯ä½¿æŸ¥æ‰¾æˆ–者替æ›å¯å¿½ç•¥å¤§å°å¯«çš„é¸é … ** + + + 1. è¦æŸ¥æ‰¾å–®è©ž ignore å¯åœ¨æ£å¸¸æ¨¡å¼ä¸‹è¼¸å…¥ /ignore 。è¦é‡å¾©æŸ¥æ‰¾è©²è©žï¼Œå¯ä»¥ + é‡å¾©æŒ‰ n éµã€‚ + + 2. 然後è¨ç½® ic é¸é …(ic就是英文忽略大å°å¯«Ignore Case的首å—æ¯ç¸®å¯«è©ž)ï¼Œå³ + 輸入︰ + :set ic + + 3. ç¾åœ¨å¯ä»¥é€šéŽéµå…¥ n éµå†æ¬¡æŸ¥æ‰¾å–®è©ž ignore。é‡å¾©æŸ¥æ‰¾å¯ä»¥é‡å¾©éµå…¥ n éµã€‚ + + 4. 然後è¨ç½® hlsearch å’Œ incsearch 這兩個é¸é …,輸入以下內容︰ + :set hls is + + 5. ç¾åœ¨å¯ä»¥å†æ¬¡è¼¸å…¥æŸ¥æ‰¾å‘½ä»¤ï¼Œçœ‹çœ‹æœƒæœ‰ä»€éº¼æ•ˆæžœï¸° + /ignore + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第å…講å°çµ + + + 1. 輸入å°å¯«çš„ o å¯ä»¥åœ¨å…‰æ¨™ä¸‹æ–¹æ‰“開新的一行並將光標置于新開的行首,進入 + æ’入模å¼ã€‚ + 輸入大寫的 O å¯ä»¥åœ¨å…‰æ¨™ä¸Šæ–¹æ‰“開新的一行並將光標置于新開的行首,進入 + æ’入模å¼ã€‚ + + 2. 輸入å°å¯«çš„ a å¯ä»¥åœ¨å…‰æ¨™æ‰€åœ¨ä½ç½®ä¹‹å¾Œæ’入文本。 + 輸入大寫的 A å¯ä»¥åœ¨å…‰æ¨™æ‰€åœ¨è¡Œçš„行末之後æ’入文本。 + + 3. 輸入大寫的 R 將進入替æ›æ¨¡å¼ï¼Œç›´è‡³æŒ‰ <ESC> éµé€€å‡ºæ›¿æ›æ¨¡å¼è€Œé€²å…¥æ£å¸¸ + 模å¼ã€‚ + + 4. 輸入 :set xxx å¯ä»¥è¨ç½® xxx é¸é …。 + + + + + + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第七講︰在線幫助命令 + + ** 使用在線幫助系統 ** + + Vim æ“有一個細致全é¢çš„在線幫助系統。è¦å•Ÿå‹•è©²å¹«åŠ©ç³»çµ±ï¼Œè«‹é¸æ“‡å¦‚下三種方 + 法之一︰ + - 按下 <HELP> éµ (如果éµç›¤ä¸Šæœ‰çš„話) + - 按下 <F1> éµ (如果éµç›¤ä¸Šæœ‰çš„話) + - 輸入 :help <回車> + + 輸入 :q <回車> å¯ä»¥é—œé–‰å¹«åŠ©çª—å£ã€‚ + + æ供一個æ£ç¢ºçš„åƒæ•¸çµ¦":help"命令,您å¯ä»¥æ‰¾åˆ°é—œäºŽè©²ä¸»é¡Œçš„幫助。請試驗以 + 下åƒæ•¸(å¯åˆ¥å¿˜äº†æŒ‰å›žè»Šéµå“¦ã€‚:)︰ + + :help w <回車> + :help c_<T <回車> + :help insert-index <回車> + :help user-manual <回車> + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 第八講︰創建一個啟動腳本 + + ** 啟用vim的功能 ** + + Vim的功能特性è¦æ¯”vi多得多,但大部分功能都沒有缺çœæ¿€æ´»ã€‚為了啟動更多的 + 功能,您得創建一個vimrc文件。 + + 1. 開始編輯vimrc文件,這å–決于您所使用的æ“作系統︰ + + :edit ~/.vimrc 這是Unix系統所使用的命令 + :edit $VIM/_vimrc 這是Windows系統所使用的命令 + + 2. 接著導入vimrc范例文件︰ + + :read $VIMRUNTIME/vimrc_example.vim + + 3. ä¿å˜æ–‡ä»¶ï¼Œå‘½ä»¤ç‚ºï¸° + + :write + + 在下次您啟動vim的時候,編輯器就會有了語法高亮的功能。您å¯ä»¥ç¹¼çºŒæŠŠæ‚¨å–œ + æ¡çš„其它功能è¨ç½®æ·»åŠ 到這個vimrc文件ä¸ã€‚ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + vim 教程到æ¤çµæŸã€‚本教程åªæ˜¯ç‚ºäº†ç°¡æ˜Žåœ°ä»‹ç´¹ä¸€ä¸‹vim編輯器,但已足以讓您 + 很容易å¸æœƒä½¿ç”¨æœ¬ç·¨è¼¯å™¨äº†ã€‚毋庸質疑,vim還有很多很多的命令,本教程所介 + 紹的還差得é 著呢。所以您è¦ç²¾é€šçš„話,還望繼續努力哦。下一æ¥æ‚¨å¯ä»¥é–±è®€ + vim手冊,使用的命令是︰ + :help user-manual + + 為了更進一æ¥çš„åƒè€ƒå’Œå¸ç¿’,以下這本書值得推薦︰ + + Vim - Vi Improved - 作者︰Steve Oualline + 出版社︰New Riders + + 這是第一本完全講解vim的書ç±ã€‚å°äºŽåˆå¸è€…特別有用。其ä¸é‚„包å«æœ‰å¤§é‡å¯¦ä¾‹ + å’Œåœ–ç¤ºã€‚æ¬²çŸ¥è©³æƒ…ï¼Œè«‹è¨ªå• http://iccf-holland.org/click5.html + + 以下這本書比較è€äº†è€Œä¸”內容主è¦æ˜¯vi而ä¸æ˜¯vim,但是也值得推薦︰ + + Learning the Vi Editor - 作者︰Linda Lamb + 出版社︰O'Reilly & Associates Inc. + + 這是一本ä¸éŒ¯çš„書,通éŽå®ƒæ‚¨å¹¾ä¹Žèƒ½å¤ 了解到全部vièƒ½å¤ åšåˆ°çš„事情。æ¤æ›¸çš„第 + å…個版本也包å«äº†ä¸€äº›é—œäºŽvimçš„ä¿¡æ¯ã€‚ + + 本教程是由來自Calorado School of Mineseçš„Michael C. Pierceã€Robert K. + Ware 所編寫的,其ä¸ä¾†è‡ªColorado State Universityçš„Charles Smithæ供了 + 很多創æ„。編者通信地å€æ˜¯ï¸° + + bware@mines.colorado.edu + + 本教程已由Bram Moolenaar專為vim進行修訂。 + + + + è¯åˆ¶è€…附言︰ + =========== + ç°¡é«”ä¸æ–‡æ•™ç¨‹ç¿»è¯ç‰ˆä¹‹è¯åˆ¶è€…為æ¢æ˜Œæ³° <beos@turbolinux.com.cn>,還有 + å¦å¤–一個è¯ç³»åœ°å€ï¸°linuxrat@gnuchina.org。 + + ç¹é«”ä¸æ–‡æ•™ç¨‹æ˜¯å¾žç°¡é«”ä¸æ–‡æ•™ç¨‹ç¿»è¯ç‰ˆä½¿ç”¨ Debian GNU/Linux ä¸æ–‡é …ç›®å° + 組的于廣è¼å…ˆç”Ÿç·¨å¯«çš„ä¸æ–‡æ¼¢å—轉碼器 autoconvert 轉æ›è€Œæˆçš„,並å°è½‰ + æ›çš„çµæžœåšäº†ä¸€äº›ç´°ç¯€çš„改動。 + + 變更記錄︰ + ========= + 2002å¹´08月30æ—¥ æ¢æ˜Œæ³° <beos@turbolinux.com.cn> + æ„Ÿè¬ RMS@SMTH 的指æ£ï¼Œå°‡å¤šè™•éŒ¯èª¤ä¿®æ£ã€‚ + + 2002å¹´04月22æ—¥ æ¢æ˜Œæ³° <linuxrat@gnuchina.org> + æ„Ÿè¬ xuandong@sh163.net 的指æ£ï¼Œå°‡å…©è™•éŒ¯åˆ¥å—ä¿®æ£ã€‚ + + 2002å¹´03月18æ—¥ æ¢æ˜Œæ³° <linuxrat@gnuchina.org> + æ ¹æ“šBram Molenaar先生在2002å¹´03月16日的來信è¦æ±‚,將vimtutor1.4ä¸è¯ + 版å‡ç´šåˆ°vimtutor1.5。 + + 2001å¹´11月15æ—¥ æ¢æ˜Œæ³° <linuxrat@gnuchina.org> + å°‡vimtutor1.4ä¸è¯ç‰ˆæ交給Bram Molenaarå’ŒSven Guckes。 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~