diff options
Diffstat (limited to 'runtime')
31 files changed, 327 insertions, 228 deletions
diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim index 5ddad88873..dbc40fdf36 100644 --- a/runtime/autoload/phpcomplete.vim +++ b/runtime/autoload/phpcomplete.vim @@ -3,7 +3,7 @@ " Maintainer: Dávid Szabó ( complex857 AT gmail DOT com ) " Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " URL: https://github.com/shawncplus/phpcomplete.vim -" Last Change: 2014 Dec 01 +" Last Change: 2015 Feb 28 " " OPTIONS: " @@ -145,7 +145,7 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.'))) - if context =~? '^use\s' + if context =~? '^use\s' || context ==? 'use' return phpcomplete#CompleteUse(a:base) endif @@ -189,7 +189,7 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ " }}} elseif context =~? 'implements' return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports) - elseif context =~? 'extends\s\+.\+$' + elseif context =~? 'extends\s\+.\+$' && a:base == '' return ['implements'] elseif context =~? 'extends' let kinds = context =~? 'class\s' ? ['c'] : ['i'] @@ -244,12 +244,13 @@ function! phpcomplete#CompleteUse(base) " {{{ if has_key(tag, 'namespace') let patched_ctags_detected = 1 endif + if tag.kind ==? 'n' && tag.name =~? '^'.namespace_match_pattern let patched_ctags_detected = 1 call add(namespaced_matches, {'word': tag.name, 'kind': 'n', 'menu': tag.filename, 'info': tag.filename }) - elseif has_key(tag, 'namespace') && (tag.kind ==? 'c' || tag.kind ==? 'i') && tag.namespace ==? namespace_for_class + elseif has_key(tag, 'namespace') && (tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't') && tag.namespace ==? namespace_for_class call add(namespaced_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename }) - elseif (tag.kind ==? 'c' || tag.kind ==? 'i') + elseif (tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't') call add(no_namespace_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename }) endif endfor @@ -272,6 +273,10 @@ function! phpcomplete#CompleteUse(base) " {{{ endfor endif + for comp in res + let comp.word = substitute(comp.word, '^\\', '', '') + endfor + return res endfunction " }}} @@ -326,6 +331,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ let ext_functions = {} let ext_constants = {} let ext_classes = {} + let ext_traits = {} let ext_interfaces = {} let ext_namespaces = {} @@ -420,7 +426,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ endif endif endif - elseif tag.kind ==? 'c' || tag.kind ==? 'i' + elseif tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't' let info = ' - '.tag.filename let key = '' @@ -441,6 +447,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ let ext_classes[key] = info elseif tag.kind ==? 'i' let ext_interfaces[key] = info + elseif tag.kind ==? 't' + let ext_traits[key] = info endif endif endif @@ -463,7 +471,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ endfor for [interfacename, info] in items(g:php_builtin_interfacenames) if interfacename =~? '^'.base - let builtin_interfaces[leading_slash.interfacename] = info + let builtin_interfaces[leading_slash.g:php_builtin_interfaces[tolower(interfacename)].name] = info endif endfor endif @@ -511,6 +519,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ else let ext_interfaces[imported_name] = ' '.import.name.' - '.import.filename endif + elseif import.kind ==? 't' + let ext_traits[imported_name] = ' '.import.name.' - '.import.filename endif " no builtin interfaces @@ -540,6 +550,9 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ " Add external interfaces call extend(all_values, ext_interfaces) + " Add external traits + call extend(all_values, ext_traits) + " Add built-in classes call extend(all_values, builtin_classnames) @@ -566,6 +579,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ elseif has_key(ext_interfaces, i) || has_key(builtin_interfaces, i) let info = has_key(ext_interfaces, i) ? ext_interfaces[i] : builtin_interfaces[i].' - builtin' let final_list += [{'word':i, 'kind': 'i', 'menu': info, 'info': i.info}] + elseif has_key(ext_traits, i) + let final_list += [{'word':i, 'kind': 't', 'menu': ext_traits[i], 'info': ext_traits[i]}] elseif has_key(int_constants, i) || has_key(builtin_constants, i) let info = has_key(int_constants, i) ? int_constants[i] : ' - builtin' let final_list += [{'word':i, 'kind': 'd', 'menu': info, 'info': i.info}] @@ -784,7 +799,7 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports) let tags = [] if len(tag_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion - let tags = phpcomplete#GetTaglist('^'.tag_match_pattern) + let tags = phpcomplete#GetTaglist('^\c'.tag_match_pattern) endif if len(tags) @@ -861,6 +876,39 @@ function! phpcomplete#CompareCompletionRow(i1, i2) " {{{ endfunction " }}} +function! s:getNextCharWithPos(filelines, current_pos) " {{{ + let line_no = a:current_pos[0] + let col_no = a:current_pos[1] + let last_line = a:filelines[len(a:filelines) - 1] + let end_pos = [len(a:filelines) - 1, strlen(last_line) - 1] + if line_no > end_pos[0] || line_no == end_pos[0] && col_no > end_pos[1] + return ['EOF', 'EOF'] + endif + + " we've not reached the end of the current line break + if col_no + 1 < strlen(a:filelines[line_no]) + let col_no += 1 + else + " we've reached the end of the current line, jump to the next + " non-blank line (blank lines have no position where we can read from, + " not even a whitespace. The newline char does not positionable by vim + let line_no += 1 + while strlen(a:filelines[line_no]) == 0 + let line_no += 1 + endwhile + + let col_no = 0 + endif + + " return 'EOF' string to signal end of file, normal results only one char + " in length + if line_no == end_pos[0] && col_no > end_pos[1] + return ['EOF', 'EOF'] + endif + + return [[line_no, col_no], a:filelines[line_no][col_no]] +endfunction " }}} + function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) " {{{ " if theres no modifier, and no modifier is allowed and no modifier is required if len(a:modifiers) == 0 && len(a:required_modifiers) == 0 @@ -1602,26 +1650,26 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor endif endif - " in-file lookup for typehinted function arguments - " - the function can have a name or be anonymous (e.g., function qux() { ... } vs. function () { ... }) - " - the type-hinted argument can be anywhere in the arguments list. - if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array - let f_args = matchstr(line, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)') - let args = split(f_args, '\s*\zs,\ze\s*') - for arg in args - if arg =~# object.'\(,\|$\)' - let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object) - let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports) + " function declaration line + if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(' + let function_lines = join(reverse(lines), " ") + " search for type hinted arguments + if function_lines =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array + let f_args = matchstr(function_lines, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)') + let args = split(f_args, '\s*\zs,\ze\s*') + for arg in args + if arg =~# object.'\(,\|$\)' + let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object) + let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports) + break + endif + endfor + if classname_candidate != '' break endif - endfor - if classname_candidate != '' - break endif - endif - " if we see a function declaration, try loading the docblock for it and look for matching @params - if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.object + " search for docblock for the function let match_line = substitute(line, '\\', '\\\\', 'g') let sccontent = getline(0, a:start_line - i) let doc_str = phpcomplete#GetDocBlock(sccontent, match_line) @@ -1641,13 +1689,14 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor endif " assignment for the variable in question with a variable on the right hand side - if line =~# '^\s*'.object.'\s*=&\?\s*'.variable_name_pattern + if line =~# '^\s*'.object.'\s*=&\?\s\+\(clone\)\?\s*'.variable_name_pattern " try to find the next non-comment or string ";" char - let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s*'.variable_name_pattern) + let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s\+\(clone\)\?\s*'.variable_name_pattern) let filelines = reverse(lines) let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col]) let chars_read = 1 + let last_pos = pos " read while end of the file while char != 'EOF' && chars_read < 1000 let last_pos = pos @@ -1689,6 +1738,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let filelines = reverse(lines) let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col]) let chars_read = 1 + let last_pos = pos " read while end of the file while char != 'EOF' && chars_read < 1000 let last_pos = pos @@ -1819,7 +1869,7 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{ let i = 1 while i < line('.') let line = getline(line('.')-i) - if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*class\s*'.a:classname.'\(\s\+\|$\)' && tolower(current_namespace) == search_namespace + if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\)' && tolower(current_namespace) == search_namespace return expand('%:p') else let i += 1 @@ -1831,7 +1881,9 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{ let no_namespace_candidate = '' let tags = phpcomplete#GetTaglist('^'.a:classname.'$') for tag in tags - if tag.kind == 'c' || tag.kind == 'i' + " We'll allow interfaces and traits to be handled classes since you + " can't have colliding names with different kinds anyway + if tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't' if !has_key(tag, 'namespace') let no_namespace_candidate = tag.filename else @@ -1979,9 +2031,9 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam " remember the window we started at let phpcomplete_original_window = winnr() - silent! below 1new + silent! tab 1new silent! 0put =cfile - call search('\(class\|interface\)\_s\+'.a:class_name.'\(\>\|$\)') + call search('\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)') let cfline = line('.') call search('{') let endline = line('.') @@ -1994,8 +2046,48 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam let extends_class = '' endif call searchpair('{', '', '}', 'W') - let classcontent = join(getline(cfline, line('.')), "\n") + let class_closing_bracket_line = line('.') + let classcontent = join(getline(cfline, class_closing_bracket_line), "\n") + + let used_traits = [] + " move back to the line next to the class's definition + call cursor(endline + 1, 1) + let keep_searching = 1 + while keep_searching != 0 + " try to grab "use..." keywords + let [lnum, col] = searchpos('\c^\s\+use\s\+'.class_name_pattern, 'cW', class_closing_bracket_line) + let syn_name = synIDattr(synID(lnum, col, 0), "name") + if syn_name =~? 'string\|comment' + call cursor(lnum + 1, 1) + continue + endif + + let trait_line = getline(lnum) + if trait_line !~? ';' + " try to find the next line containing ';' + let l = lnum + let search_line = trait_line + + " add lines from the file until theres no ';' in them + while search_line !~? ';' && l > 0 + " file lines are reversed so we need to go backwards + let l += 1 + let search_line = getline(l) + let trait_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g') + endwhile + endif + let use_expression = matchstr(trait_line, '^\s*use\s\+\zs.\{-}\ze;') + let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")') + let used_traits += map(use_parts, 'substitute(v:val, "\\s", "", "g")') + call cursor(lnum + 1, 1) + + if [lnum, col] == [0, 0] + let keep_searching = 0 + endif + endwhile + silent! bw! % + let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline]) " go back to original window exe phpcomplete_original_window.'wincmd w' @@ -2008,21 +2100,27 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam \ 'mtime': getftime(full_file_path), \ }) + let all_extends = used_traits if extends_class != '' - let [extends_class, namespace] = phpcomplete#ExpandClassName(extends_class, current_namespace, imports) - if namespace == '' - let namespace = '\' - endif - let classlocation = phpcomplete#GetClassLocation(extends_class, namespace) - if classlocation == "VIMPHP_BUILTINOBJECT" - let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(extends_class)])] - elseif classlocation != '' && filereadable(classlocation) - let full_file_path = fnamemodify(classlocation, ':p') - let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), extends_class) - elseif tolower(current_namespace) == tolower(namespace) - " try to find the declaration in the same file. - let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, extends_class) - endif + call add(all_extends, extends_class) + endif + if len(all_extends) > 0 + for class in all_extends + let [class, namespace] = phpcomplete#ExpandClassName(class, current_namespace, imports) + if namespace == '' + let namespace = '\' + endif + let classlocation = phpcomplete#GetClassLocation(class, namespace) + if classlocation == "VIMPHP_BUILTINOBJECT" + let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(class)])] + elseif classlocation != '' && filereadable(classlocation) + let full_file_path = fnamemodify(classlocation, ':p') + let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), class) + elseif tolower(current_namespace) == tolower(namespace) + " try to find the declaration in the same file. + let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, class) + endif + endfor endif return result @@ -2270,19 +2368,40 @@ endfunction! " }}} function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ + let original_window = winnr() + + silent! tab 1new + silent! 0put =a:file_lines + normal! G + + " clear out classes, functions and other blocks + while 1 + let block_start_pos = searchpos('\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{', 'Web') + if block_start_pos == [0, 0] + break + endif + let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"') + silent! exec block_start_pos[0].','.block_end_pos[0].'d' + endwhile + normal! G + + " grab the remains + let file_lines = reverse(getline(1, line('.') - 1)) + + silent! bw! % + exe original_window.'wincmd w' + let namespace_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*' - let file_lines = reverse(copy(a:file_lines)) let i = 0 let file_length = len(file_lines) let imports = {} - let current_namespace = '\' while i < file_length let line = file_lines[i] if line =~? '^\s*namespace\s*'.namespace_name_pattern - let current_namespace = matchstr(line, '^\s*namespace\s*\zs'.namespace_name_pattern.'\ze') + let current_namespace = matchstr(line, '\c^\s*namespace\s*\zs'.namespace_name_pattern.'\ze') break endif @@ -2303,11 +2422,11 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ let use_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g') endwhile endif - let use_expression = matchstr(use_line, '^\s*use\s\+\zs.\{-}\ze;') + let use_expression = matchstr(use_line, '^\c\s*use\s\+\zs.\{-}\ze;') let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")') for part in use_parts if part =~? '\s\+as\s\+' - let [object, name] = split(part, '\s\+as\s\+') + let [object, name] = split(part, '\s\+as\s\+\c') let object = substitute(object, '^\\', '', '') let name = substitute(name, '^\\', '', '') else @@ -2343,7 +2462,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ break endif " if the name matches with the extracted classname and namespace - if (tag.kind == 'c' || tag.kind == 'i') && tag.name == classname + if (tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't') && tag.name == classname if has_key(tag, 'namespace') let patched_ctags_detected = 1 if tag.namespace == namespace_for_classes @@ -2386,7 +2505,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ let tags = phpcomplete#GetTaglist('^'.import['name'].'$') for tag in tags " search for the first matchin namespace, class, interface with no namespace - if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i') + if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't') call extend(import, tag) let import['builtin'] = 0 break diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index ffba29efc7..140a2f2e66 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1041,7 +1041,7 @@ The pattern is interpreted like mostly used in file names: [^ch] match any character but 'c' and 'h' Note that for all systems the '/' character is used for path separator (even -MS-DOS). This was done because the backslash is difficult to use in a pattern +Windows). This was done because the backslash is difficult to use in a pattern and to make the autocommands portable across different systems. *autocmd-changes* diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 7e8c788626..ae808a4a9b 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -379,7 +379,7 @@ CTRL-N After using 'wildchar' which got multiple matches, go to next <S-Tab> *c_CTRL-P* *c_<S-Tab>* CTRL-P After using 'wildchar' which got multiple matches, go to previous match. Otherwise recall older command-line from - history. <S-Tab> only works with the GUI and with MS-DOS. + history. <S-Tab> only works with the GUI. *c_CTRL-A* CTRL-A All names that match the pattern in front of the cursor are inserted. @@ -819,7 +819,7 @@ These modifiers can be given, in this order: separator is removed. Thus ":p:h" on a directory name results on the directory name itself (without trailing slash). When the file name is an absolute path (starts with "/" for - Unix; "x:\" for MS-DOS and WIN32), that part is not removed. + Unix; "x:\" for Windows), that part is not removed. When there is no head (path is relative to current directory) the result is empty. :t Tail of the file name (last component of the name). Must @@ -918,8 +918,8 @@ option contains "sh", this is done twice, to avoid the shell trying to expand the "!". *filename-backslash* -For filesystems that use a backslash as directory separator (MS-DOS and -Windows), it's a bit difficult to recognize a backslash that is used +For filesystems that use a backslash as directory separator (Windows +filesystems), it's a bit difficult to recognize a backslash that is used to escape the special meaning of the next character. The general rule is: If the backslash is followed by a normal file name character, it does not have a special meaning. Therefore "\file\foo" is a valid file name, you don't have diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 42c674d5ce..bcb89f6527 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -130,9 +130,7 @@ You can use this file if you discover that you need the original file. See also the 'patchmode' option. The name of the backup file is normally the same as the original file with 'backupext' appended. The default "~" is a bit strange to avoid accidentally overwriting existing files. If you prefer ".bak" -change the 'backupext' option. Extra dots are replaced with '_' on MS-DOS -machines, when Vim has detected that an MS-DOS-like filesystem is being used -(e.g., messydos or crossdos). The backup file can be placed in another +change the 'backupext' option. The backup file can be placed in another directory by setting 'backupdir'. When you started editing without giving a file name, "No File" is displayed in @@ -471,9 +469,9 @@ The 'fileformat' option sets the <EOL> style for a file: "mac" <CR> Mac format *Mac-format* When reading a file, the mentioned characters are interpreted as the <EOL>. -In DOS format (default for MS-DOS and Win32), <CR><NL> and <NL> are both -interpreted as the <EOL>. Note that when writing the file in DOS format, -<CR> characters will be added for each single <NL>. Also see |file-read|. +In DOS format (default for Windows), <CR><NL> and <NL> are both interpreted as +the <EOL>. Note that when writing the file in DOS format, <CR> characters will +be added for each single <NL>. Also see |file-read|. When writing a file, the mentioned characters are used for <EOL>. For DOS format <CR><NL> is used. Also see |DOS-format-write|. @@ -494,13 +492,13 @@ If you start editing a new file and the 'fileformats' option is not empty (which is the default), Vim will try to detect whether the lines in the file are separated by the specified formats. When set to "unix,dos", Vim will check for lines with a single <NL> (as used on Unix) or by a <CR><NL> pair -(MS-DOS). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos", +(Windows). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos", otherwise it is set to "unix". When 'fileformats' includes "mac", and no <NL> characters are found in the file, 'fileformat' is set to "mac". -If the 'fileformat' option is set to "dos" on non-MS-DOS systems the message +If the 'fileformat' option is set to "dos" on non-Windows systems the message "[dos format]" is shown to remind you that something unusual is happening. On -MS-DOS systems you get the message "[unix format]" if 'fileformat' is set to +Windows systems you get the message "[unix format]" if 'fileformat' is set to "unix". On all systems but the Macintosh you get the message "[mac format]" if 'fileformat' is set to "mac". @@ -966,10 +964,10 @@ lost the original file. *DOS-format-write* If the 'fileformat' is "dos", <CR> <NL> is used for <EOL>. This is default -for MS-DOS and Win32. On other systems the message "[dos format]" is shown to +for Windows. On other systems the message "[dos format]" is shown to remind you that an unusual <EOL> was used. *Unix-format-write* -If the 'fileformat' is "unix", <NL> is used for <EOL>. On MS-DOS and Win32 +If the 'fileformat' is "unix", <NL> is used for <EOL>. On Windows the message "[unix format]" is shown. *Mac-format-write* If the 'fileformat' is "mac", <CR> is used for <EOL>. On non-Mac systems the @@ -999,11 +997,11 @@ When the file name is actually a device name, Vim will not make a backup (that would be impossible). You need to use "!", since the device already exists. Example for Unix: > :w! /dev/lpt0 -and for MS-DOS or MS-Windows: > +and Windows: > :w! lpt0 For Unix a device is detected when the name doesn't refer to a normal file or a directory. A fifo or named pipe also looks like a device to Vim. -For MS-DOS and MS-Windows the device is detected by its name: +For Windows the device is detected by its name: CON CLOCK$ NUL @@ -1224,7 +1222,7 @@ present in 'cpoptions' and "!" is not used in the command. Does not change the meaning of an already opened file, because its full path name is remembered. Files from the |arglist| may change though! - On MS-DOS this also changes the active drive. + On Windows this also changes the active drive. To change to the directory of the current file: > :cd %:h < diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e295772693..1f1dc71f28 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2825,7 +2825,7 @@ executable({expr}) *executable()* arguments. executable() uses the value of $PATH and/or the normal searchpath for programs. *PATHEXT* - On MS-DOS and MS-Windows the ".exe", ".bat", etc. can + On Windows the ".exe", ".bat", etc. can optionally be included. Then the extensions in $PATHEXT are tried. Thus if "foo.exe" does not exist, "foo.exe.bat" can be found. If $PATHEXT is not set then ".exe;.com;.bat;.cmd" is @@ -2833,9 +2833,9 @@ executable({expr}) *executable()* the name without an extension. When 'shell' looks like a Unix shell, then the name is also tried without adding an extension. - On MS-DOS and MS-Windows it only checks if the file exists and + On Windows it only checks if the file exists and is not a directory, not if it's really executable. - On MS-Windows an executable in the same directory as Vim is + On Windows an executable in the same directory as Vim is always found. Since this directory is added to $PATH it should also work to execute it |win32-PATH|. The result is a Number: @@ -3625,8 +3625,7 @@ getmatches() *getmatches()* < *getpid()* getpid() Return a Number which is the process ID of the Vim process. - On Unix and MS-Windows this is a unique number, until Vim - exits. On MS-DOS it's always zero. + This is a unique number, until Vim exits. *getpos()* getpos({expr}) Get the position for {expr}. For possible values of {expr} @@ -5891,7 +5890,7 @@ sha256({string}) *sha256()* shellescape({string} [, {special}]) *shellescape()* Escape {string} for use as a shell command argument. - On MS-Windows and MS-DOS, when 'shellslash' is not set, it + On Windows when 'shellslash' is not set, it will enclose {string} in double quotes and double all double quotes within {string}. For other systems, it will enclose {string} in single quotes diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt index 6036264237..b85c0a357c 100644 --- a/runtime/doc/farsi.txt +++ b/runtime/doc/farsi.txt @@ -111,7 +111,7 @@ The letter encoding used is the Vim extended ISIR-3342 standard with a built in function to convert between Vim extended ISIR-3342 and ISIR-3342 standard. For document portability reasons, the letter encoding is kept the same across -different platforms (i.e. UNIX's, NT/95/98, MS DOS, ...). +different platforms (i.e. Unix, Windows, ...). o Keyboard diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index baf7550948..b6525e8494 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -595,7 +595,7 @@ Format description: ignored. 2. Each entry starts with line that has format "{type} with timestamp {timestamp}:". {timestamp} is |strftime()|-formatted string representing - actual UNIX timestamp value. First strftime() argument is equal to + actual Unix timestamp value. First strftime() argument is equal to `%Y-%m-%dT%H:%M:%S`. When writing this timestamp is parsed using |msgpack#strptime()|, with caching (it remembers which timestamp produced particular strftime() output and uses this value if you did not change diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt index 7bc0f5cb13..ce00600979 100644 --- a/runtime/doc/gui_w32.txt +++ b/runtime/doc/gui_w32.txt @@ -257,17 +257,6 @@ WARNING: If you close this window with the "X" button, and confirm the question if you really want to kill the application, Vim may be killed too! (This does not apply to commands run asynchronously with ":!start".) - *msdos-mode* -If you get a dialog that says "This program is set to run in MS-DOS mode..." -when you run an external program, you can solve this by changing the -properties of the associated shortcut: -- Use a Windows Explorer to find the command.com that is used. It can be - c:\command.com, c:\dos\command.com, c:\windows\command.com, etc. -- With the right mouse button, select properties of this command.com. -- In the Program tab select "Advanced". -- Unselect "MS-DOS mode". -- Click "OK" twice. - *win32-!start* Normally, Vim waits for a command to complete before continuing (this makes sense for most shell commands which produce output for Vim to use). If you diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 013eb6b97b..cb01d5fe92 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1941,9 +1941,9 @@ If the 'fileformats' option is not empty Vim tries to recognize the type of changed, the detected format is only used while reading the file. A similar thing happens with 'fileencodings'. -On non-MS-DOS and Win32 systems the message "[dos format]" is shown if +On non-Windows systems the message "[dos format]" is shown if a file is read in DOS format, to remind you that something unusual is done. -On Macintosh, MS-DOS, and Win32 the message "[unix format]" is shown if +On Macintosh and Windows the message "[unix format]" is shown if a file is read in Unix format. On non-Macintosh systems, the message "[Mac format]" is shown if a file is read in Mac format. diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index 431b6e1ad7..fdf106a7bb 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -251,7 +251,7 @@ Vim would never have become what it is now, without the help of these people! lots of patches Ingo Wilken Tcl interface Mike Williams PostScript printing - Juergen Weigert Lattice version, AUX improvements, UNIX and + Juergen Weigert Lattice version, AUX improvements, Unix and MS-DOS ports, autoconf Stefan 'Sec' Zehl Maintainer of vim.org diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 6539ad364b..013e7c742c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -183,7 +183,7 @@ the option value, use '\"' instead. This example sets the 'titlestring' option to 'hi "there"': > :set titlestring=hi\ \"there\" -For MS-DOS and WIN32 backslashes in file names are mostly not removed. More +For Windows backslashes in file names are mostly not removed. More precise: For options that expect a file name (those where environment variables are expanded) a backslash before a normal file name character is not removed. But a backslash before a special character (space, backslash, comma, @@ -772,14 +772,14 @@ A jump table for the options with a short description can be found at |Q_op|. putting a ":gui" command in the gvimrc file, before where the value of 'background' is used (e.g., before ":syntax on"). - For MS-DOS and Windows the default is "dark". + For Windows the default is "dark". For other systems "dark" is used when 'term' is "linux", "screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark background. Otherwise the default is "light". Normally this option would be set in the vimrc file. Possibly depending on the terminal name. Example: > - :if &term == "pcterm" + :if &term == "xterm" : set background=dark :endif < When this option is set, the default settings for the highlight groups @@ -900,7 +900,7 @@ A jump table for the options with a short description can be found at |Q_op|. impossible!). Writing may fail because of this. - A directory "." means to put the backup file in the same directory as the edited file. - - A directory starting with "./" (or ".\" for MS-DOS et al.) means to + - A directory starting with "./" (or ".\" for Windows) means to put the backup file relative to where the edited file is. The leading "." is replaced with the path name of the edited file. ("." inside a directory name has no special meaning). @@ -2075,7 +2075,7 @@ A jump table for the options with a short description can be found at |Q_op|. the edited file. On Unix, a dot is prepended to the file name, so it doesn't show in a directory listing. On MS-Windows the "hidden" attribute is set and a dot prepended if possible. - - A directory starting with "./" (or ".\" for MS-DOS et al.) means to + - A directory starting with "./" (or ".\" for Windows) means to put the swap file relative to where the edited file is. The leading "." is replaced with the path name of the edited file. - For Unix and Win32, if a directory ends in two path separators "//" @@ -2395,7 +2395,7 @@ A jump table for the options with a short description can be found at |Q_op|. is read. *'fileformat'* *'ff'* -'fileformat' 'ff' string (MS-DOS and MS-Windows default: "dos", +'fileformat' 'ff' string (Windows default: "dos", Unix default: "unix", Macintosh default: "mac") local to buffer @@ -2865,14 +2865,14 @@ A jump table for the options with a short description can be found at |Q_op|. r-cr:hor20-Cursor/lCursor, sm:block-Cursor -blinkwait175-blinkoff150-blinkon175", - for MS-DOS and Win32 console: + for Windows console: "n-v-c:block,o:hor50,i-ci:hor15, r-cr:hor30,sm:block") global {only available when compiled with GUI enabled, and - for MS-DOS and Win32 console} + for Windows console} This option tells Vim what the cursor should look like in different - modes. It fully works in the GUI. In an MSDOS or Win32 console, only + modes. It fully works in the GUI. In a Windows console, only the height of the cursor can be changed. This can be done by specifying a block cursor, or a percentage for a vertical or horizontal cursor. @@ -3614,7 +3614,7 @@ A jump table for the options with a short description can be found at |Q_op|. When executing commands with |:normal| 'insertmode' is not used. *'isfname'* *'isf'* -'isfname' 'isf' string (default for MS-DOS and Win32: +'isfname' 'isf' string (default for Windows: "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=" otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=") global @@ -3665,7 +3665,7 @@ A jump table for the options with a short description can be found at |Q_op|. See |option-backslash| about including spaces and backslashes. *'isident'* *'isi'* -'isident' 'isi' string (default for MS-DOS and Win32: +'isident' 'isi' string (default for Windows: "@,48-57,_,128-167,224-235" otherwise: "@,48-57,_,192-255") global @@ -4288,7 +4288,7 @@ A jump table for the options with a short description can be found at |Q_op|. The mouse pointer is restored when the mouse is moved. *'mousemodel'* *'mousem'* -'mousemodel' 'mousem' string (default "extend", "popup" for MS-DOS and Win32) +'mousemodel' 'mousem' string (default "extend", "popup" for Windows) global Sets the model to use for the mouse. The name mostly specifies what the right mouse button is used for: @@ -4390,7 +4390,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'mousetime'* *'mouset'* 'mousetime' 'mouset' number (default 500) global - Only for GUI, MS-DOS, Win32 and Unix with xterm. Defines the maximum + Only for GUI, Windows and Unix with xterm. Defines the maximum time in msec between two mouse clicks for the second click to be recognized as a multi click. @@ -4471,11 +4471,11 @@ A jump table for the options with a short description can be found at |Q_op|. *'opendevice'* *'odev'* *'noopendevice'* *'noodev'* 'opendevice' 'odev' boolean (default off) global - {only for MS-DOS and MS-Windows} + {only for Windows} Enable reading and writing from devices. This may get Vim stuck on a device that can be opened but doesn't actually do the I/O. Therefore it is off by default. - Note that on MS-Windows editing "aux.h", "lpt1.txt" and the like also + Note that on Windows editing "aux.h", "lpt1.txt" and the like also result in editing a device. @@ -5249,7 +5249,7 @@ A jump table for the options with a short description can be found at |Q_op|. r Removable media. The argument is a string (up to the next ','). This parameter can be given several times. Each specifies the start of a path for which no marks will be - stored. This is to avoid removable media. For MS-DOS you + stored. This is to avoid removable media. For Windows you could use "ra:,rb:". You can also use it for temp files, e.g., for Unix: "r/tmp". Case is ignored. *shada-s* @@ -5287,8 +5287,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'shell'* *'sh'* *E91* 'shell' 'sh' string (default $SHELL or "sh", - MS-DOS and Win32: "command.com" or - "cmd.exe") + Windows: "cmd.exe") global Name of the shell to use for ! and :! commands. When changing the value also check these options: 'shellpipe', 'shellslash' @@ -5330,11 +5329,11 @@ A jump table for the options with a short description can be found at |Q_op|. *'shellcmdflag'* *'shcf'* 'shellcmdflag' 'shcf' string (default: "-c"; - MS-DOS and Win32, when 'shell' does not + Windows, when 'shell' does not contain "sh" somewhere: "/c") global Flag passed to the shell to execute "!" and ":!" commands; e.g., - "bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like + "bash.exe -c ls" or "cmd.exe /c dir". For Windows systems, the default is set according to the value of 'shell', to reduce the need to set this option by the user. On Unix it can have more than one flag. Each white space separated @@ -5342,7 +5341,7 @@ A jump table for the options with a short description can be found at |Q_op|. See |option-backslash| about including spaces and backslashes. See |shell-unquoting| which talks about separating this option into multiple arguments. - Also see |dos-shell| for MS-DOS and MS-Windows. + Also see |dos-shell| for Windows. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -5357,7 +5356,7 @@ A jump table for the options with a short description can be found at |Q_op|. The name of the temporary file can be represented by "%s" if necessary (the file name is appended automatically if no %s appears in the value of this option). - For MS-DOS the default is ">". The output is directly saved in a file + For Windows the default is ">". The output is directly saved in a file and not echoed to the screen. For Unix the default it "| tee". The stdout of the compiler is saved in a file and echoed to the screen. If the 'shell' option is "csh" or @@ -5381,7 +5380,7 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'shellquote'* *'shq'* -'shellquote' 'shq' string (default: ""; MS-DOS and Win32, when 'shell' +'shellquote' 'shq' string (default: ""; Windows, when 'shell' contains "sh" somewhere: "\"") global Quoting character(s), put around the command passed to the shell, for @@ -5389,7 +5388,7 @@ A jump table for the options with a short description can be found at |Q_op|. quoting. See 'shellxquote' to include the redirection. It's probably not useful to set both options. This is an empty string by default. Only known to be useful for - third-party shells on MS-DOS-like systems, such as the MKS Korn Shell + third-party shells on Windows systems, such as the MKS Korn Shell or bash, where it should be "\"". The default is adjusted according the value of 'shell', to reduce the need to set this option by the user. See |dos-shell|. @@ -5454,7 +5453,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'shellxescape'* *'sxe'* 'shellxescape' 'sxe' string (default: ""; - for MS-DOS and MS-Windows: "\"&|<>()@^") + for Windows: "\"&|<>()@^") global When 'shellxquote' is set to "(" then the characters listed in this option will be escaped with a '^' character. This makes it possible @@ -6342,9 +6341,8 @@ A jump table for the options with a short description can be found at |Q_op|. 'term' string (default is $TERM, if that fails: in the GUI: "builtin_gui" on Mac: "mac-ansi" - on MS-DOS: "pcterm" on Unix: "ansi" - on Win 32: "win32") + on Windows: "win32") global Name of the terminal. Used for choosing the terminal control characters. Environment variables are expanded |:set_env|. @@ -7100,6 +7098,6 @@ A jump table for the options with a short description can be found at |Q_op|. global The number of microseconds to wait for each character sent to the screen. When non-zero, characters are sent to the terminal one by - one. For MS-DOS pcterm this does not work. For debugging purposes. + one. For debugging purposes. vim:tw=78:ts=8:ft=help:noet:norl: diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 212e43cd99..21eeb9bc41 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -131,7 +131,7 @@ gD Goto global Declaration. When the cursor is on a *CTRL-C* CTRL-C Interrupt current (search) command. Use CTRL-Break on - MS-DOS |dos-CTRL-Break|. + Windows |dos-CTRL-Break|. In Normal mode, any pending command is aborted. *:noh* *:nohlsearch* @@ -1084,7 +1084,7 @@ x A single character, with no special meaning, matches itself *[:backspace:]* [:backspace:] the <BS> character The brackets in character class expressions are additional to the brackets delimiting a collection. For example, the following is a - plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is, + plausible pattern for a Unix filename: "[-./[:alnum:]_~]\+" That is, a list of at least one character, each of which is either '-', '.', '/', alphabetic, numeric, '_' or '~'. These items only work for 8-bit characters. diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 399933b512..bcce5a983a 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -587,11 +587,11 @@ or simpler > "$*" can be given multiple times, for example: > :set makeprg=gcc\ -o\ $*\ $* -The 'shellpipe' option defaults to ">" for MS-DOS and Win32. This means that -the output of the compiler is saved in a file and not shown on the screen -directly. For Unix "| tee" is used. The compiler output is shown on the -screen and saved in a file the same time. Depending on the shell used "|& -tee" or "2>&1| tee" is the default, so stderr output will be included. +The 'shellpipe' option defaults to ">" on Windows. This means that the output +of the compiler is saved in a file and not shown on the screen directly. For +Unix "| tee" is used. The compiler output is shown on the screen and saved in +a file the same time. Depending on the shell used "|& tee" or "2>&1| tee" is +the default, so stderr output will be included. If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful for compilers that write to an errorfile themselves. @@ -999,9 +999,9 @@ normally happens by matching following characters and items. When nothing is following the rest of the line is matched. If "%f" is followed by a '%' or a backslash, it will look for a sequence of 'isfname' characters. -On MS-DOS and MS-Windows a leading "C:" will be included in "%f", even when -using "%f:". This means that a file name which is a single alphabetical -letter will not be detected. +On Windows a leading "C:" will be included in "%f", even when using "%f:". +This means that a file name which is a single alphabetical letter will not be +detected. The "%p" conversion is normally followed by a "^". It's used for compilers that output a line like: > diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index ec7f340581..ded5e69438 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -980,11 +980,9 @@ Short explanation of each option: *option-list* |g_CTRL-G| g CTRL-G show cursor column, line, and character position |CTRL-C| CTRL-C during searches: Interrupt the search -|dos-CTRL-Break| CTRL-Break MS-DOS: during searches: Interrupt the search +|dos-CTRL-Break| CTRL-Break Windows: during searches: Interrupt the search |<Del>| <Del> while entering a count: delete last character |:version| :ve[rsion] show version information -|:mode| :mode N MS-DOS: set screen mode to N (number, C80, - C4350, etc.) |:normal| :norm[al][!] {commands} execute Normal mode commands |Q| Q switch to "Ex" mode diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt index 0c65b243b1..e09138b2f5 100644 --- a/runtime/doc/recover.txt +++ b/runtime/doc/recover.txt @@ -60,7 +60,7 @@ Disadvantages: If you want to put swap files in a fixed place, put a command resembling the following ones in your vimrc: :set dir=~/tmp (for Unix) - :set dir=c:\\tmp (for MS-DOS and Win32) + :set dir=c:\\tmp (for Windows) This is also very handy when editing files on floppy. Of course you will have to create that "tmp" directory for this to work! diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index 81ab72a100..933ab3a444 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -1,4 +1,4 @@ -*remote.txt* For Vim version 7.4. Last change: 2008 May 24 +*remote.txt* For Vim version 7.4. Last change: 2015 Mar 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,7 +34,8 @@ The following command line arguments are available: The remote Vim is raised. If you don't want this use > vim --remote-send "<C-\><C-N>:n filename<CR>" -< --remote-silent [+{cmd}] {file} ... *--remote-silent* +< + --remote-silent [+{cmd}] {file} ... *--remote-silent* As above, but don't complain if there is no server and the file is edited locally. --remote-wait [+{cmd}] {file} ... *--remote-wait* diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 90b41d1eee..59dbbf3067 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -287,13 +287,13 @@ with CTRL-V followed by the three digit decimal code. This does NOT work for the <t_xx> termcap codes, these can only be used in mappings. *:source_crnl* *W15* -MS-DOS and Win32: Files that are read with ":source" normally have -<CR><NL> <EOL>s. These always work. If you are using a file with <NL> <EOL>s -(for example, a file made on Unix), this will be recognized if 'fileformats' -is not empty and the first line does not end in a <CR>. This fails if the -first line has something like ":map <F1> :help^M", where "^M" is a <CR>. If -the first line ends in a <CR>, but following ones don't, you will get an error -message, because the <CR> from the first lines will be lost. +Windows: Files that are read with ":source" normally have <CR><NL> <EOL>s. +These always work. If you are using a file with <NL> <EOL>s (for example, a +file made on Unix), this will be recognized if 'fileformats' is not empty and +the first line does not end in a <CR>. This fails if the first line has +something like ":map <F1> :help^M", where "^M" is a <CR>. If the first line +ends in a <CR>, but following ones don't, you will get an error message, +because the <CR> from the first lines will be lost. Mac Classic: Files that are read with ":source" normally have <CR> <EOL>s. These always work. If you are using a file with <NL> <EOL>s (for example, a @@ -303,7 +303,7 @@ linebreaks which has a <CR> in first line. On other systems, Vim expects ":source"ed files to end in a <NL>. These always work. If you are using a file with <CR><NL> <EOL>s (for example, a -file made on MS-DOS), all lines will have a trailing <CR>. This may cause +file made on Windows), all lines will have a trailing <CR>. This may cause problems for some commands (e.g., mappings). There is no automatic <EOL> detection, because it's common to start with a line that defines a mapping that ends in a <CR>, which will confuse the automaton. @@ -658,10 +658,6 @@ long you take to respond to the input() prompt is irrelevant. Profiling should give a good indication of where time is spent, but keep in mind there are various things that may clobber the results: -- The accuracy of the time measured depends on the gettimeofday() system - function. It may only be as accurate as 1/100 second, even though the times - are displayed in micro seconds. - - Real elapsed time is measured, if other processes are busy they may cause delays at unpredictable moments. You may want to run the profiling several times and use the lowest results. diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index f46a258e2e..e2473976eb 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -356,7 +356,7 @@ accordingly. Vim proceeds in this order: 1. Set the 'shell' and 'term' option *SHELL* *COMSPEC* *TERM* The environment variable SHELL, if it exists, is used to set the - 'shell' option. On MS-DOS and Win32, the COMSPEC variable is used + 'shell' option. On Windows, the COMSPEC variable is used if SHELL is not set. The environment variable TERM, if it exists, is used to set the 'term' option. However, 'term' will change later when starting the GUI (step @@ -494,7 +494,7 @@ sessions. Put it in a place so that it will be found by 3b: Local setup: Put all commands that you need for editing a specific directory only into a vimrc file and place it in that directory under the name ".nvimrc" ("_nvimrc" -for MS-DOS and Win32). NOTE: To make Vim look for these special files you +for Windows). NOTE: To make Vim look for these special files you have to turn on the option 'exrc'. See |trojan-horse| too. System setup: @@ -516,10 +516,9 @@ interfere with Vi, then use the variable VIMINIT and the file init.vim instead. MS-DOS line separators: -On MS-DOS-like systems (MS-DOS itself and Win32), Vim assumes that all -the vimrc files have <CR> <NL> pairs as line separators. This will give -problems if you have a file with only <NL>s and have a line like -":map xx yy^M". The trailing ^M will be ignored. +On Windows systems Vim assumes that all the vimrc files have <CR> <NL> pairs +as line separators. This will give problems if you have a file with only +<NL>s and have a line like ":map xx yy^M". The trailing ^M will be ignored. The $MYVIMRC or $MYGVIMRC file will be set to the first found vimrc and/or gvimrc file. @@ -947,7 +946,7 @@ about to abandon with ":bdel", use ":wsh". The '[' and ']' marks are not stored, but the '"' mark is. The '"' mark is very useful for jumping to the cursor position when the file was last exited. No marks are saved for files that start with any string given with the "r" flag in 'shada'. This can be -used to avoid saving marks for files on removable media (for MS-DOS you would +used to avoid saving marks for files on removable media (for Windows you would use "ra:,rb:". The |v:oldfiles| variable is filled with the file names that the ShaDa file has marks for. diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 1682980b5a..78d6fdb1e1 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -71,10 +71,10 @@ with: > For a color terminal see |:hi-normal-cterm|. For setting up your own colors syntax highlighting see |syncolor|. -NOTE: The syntax files on MS-DOS and Windows have lines that end in <CR><NL>. -The files for Unix end in <NL>. This means you should use the right type of -file for your system. Although on MS-DOS and Windows the right format is -automatically selected if the 'fileformats' option is not empty. +NOTE: The syntax files on Windows have lines that end in <CR><NL>. The files +for Unix end in <NL>. This means you should use the right type of file for +your system. Although on Windows the right format is automatically selected +if the 'fileformats' option is not empty. NOTE: When using reverse video ("gvim -fg white -bg black"), the default value of 'background' will not be set until the GUI window is opened, which is after @@ -4507,7 +4507,7 @@ mentioned for the default values. See |:verbose-cmd| for more information. *highlight-args* *E416* *E417* *E423* There are three types of terminals for highlighting: term a normal terminal (vt100, xterm) -cterm a color terminal (MS-DOS console, color-xterm, these have the "Co" +cterm a color terminal (Windows console, color-xterm, these have the "Co" termcap entry) gui the GUI @@ -4653,7 +4653,7 @@ ctermbg={color-nr} *highlight-ctermbg* *E419* *E420* When Vim knows the normal foreground and background colors, "fg" and "bg" can be used as color names. This only works after setting the - colors for the Normal group and for the MS-DOS console. Example, for + colors for the Normal group and for the Windows console. Example, for reverse video: > :highlight Visual ctermfg=bg ctermbg=fg < Note that the colors are used that are valid at the moment this diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index a43da81b57..d85b4a326d 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -425,11 +425,9 @@ cleared when scrolling). Unfortunately it is not possible to deduce from the termcap how cursor positioning should be done when using a scrolling region: Relative to the beginning of the screen or relative to the beginning of the scrolling region. -Most terminals use the first method. A known exception is the MS-DOS console -(pcterm). The 't_CS' option should be set to any string when cursor -positioning is relative to the start of the scrolling region. It should be -set to an empty string otherwise. It defaults to "yes" when 'term' is -"pcterm". +Most terminals use the first method. The 't_CS' option should be set to any +string when cursor positioning is relative to the start of the scrolling +region. It should be set to an empty string otherwise. Note for xterm users: The shifted cursor keys normally don't work. You can make them work with the xmodmap command and some mappings in Vim. @@ -672,10 +670,9 @@ border, the text is scrolled. A selection can be started by pressing the left mouse button on the first character, moving the mouse to the last character, then releasing the mouse button. You will not always see the selection until you release the button, -only in some versions (GUI, MS-DOS, WIN32) will the dragging be shown -immediately. Note that you can make the text scroll by moving the mouse at -least one character in the first/last line in the window when 'scrolloff' is -non-zero. +only in some versions (GUI, Windows) will the dragging be shown immediately. +Note that you can make the text scroll by moving the mouse at least one +character in the first/last line in the window when 'scrolloff' is non-zero. In Normal, Visual and Select mode clicking the right mouse button causes the Visual area to be extended. When 'mousemodel' is "popup", the left button has @@ -689,9 +686,9 @@ work on systems where the window manager consumes the mouse events when the alt key is pressed (it may move the window). *double-click* -Double, triple and quadruple clicks are supported when the GUI is active, -for MS-DOS and Win32, and for an xterm (if the gettimeofday() function is -available). For selecting text, extra clicks extend the selection: +Double, triple and quadruple clicks are supported when the GUI is active, for +Windows and for an xterm. For selecting text, extra clicks extend the +selection: click select ~ double word or % match *<2-LeftMouse>* triple line *<3-LeftMouse>* diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt index cd25b14e32..f81a4e3a2c 100644 --- a/runtime/doc/usr_02.txt +++ b/runtime/doc/usr_02.txt @@ -29,11 +29,10 @@ To start Vim, enter this command: > gvim file.txt -In UNIX you can type this at any command prompt. If you are running Microsoft -Windows, open an MS-DOS prompt window and enter the command. - In either case, Vim starts editing a file called file.txt. Because this -is a new file, you get a blank window. This is what your screen will look -like: +On Unix you can type this at any command prompt. If you are running Windows, +open a command prompt window and enter the command. In either case, Vim +starts editing a file called file.txt. Because this is a new file, you get a +blank window. This is what your screen will look like: +---------------------------------------+ |# | @@ -61,10 +60,9 @@ use this command: > the editing occurs inside your command window. In other words, if you are running inside an xterm, the editor uses your xterm window. If you are using -an MS-DOS command prompt window under Microsoft Windows, the editing occurs -inside this window. The text in the window will look the same for both -versions, but with gvim you have extra features, like a menu bar. More about -that later. +the command prompt under Microsoft Windows, the editing occurs inside this +window. The text in the window will look the same for both versions, but with +gvim you have extra features, like a menu bar. More about that later. ============================================================================== *02.2* Inserting text @@ -80,7 +78,7 @@ mistakes; you can correct them later. To enter the following programmer's limerick, this is what you type: > iA very intelligent turtle - Found programming UNIX a hurdle + Found programming Unix a hurdle After typing "turtle" you press the <Enter> key to start a new line. Finally you press the <Esc> key to stop Insert mode and go back to Normal mode. You @@ -88,7 +86,7 @@ now have two lines of text in your Vim window: +---------------------------------------+ |A very intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | | | @@ -110,7 +108,7 @@ of the window. This indicates you are in Insert mode. +---------------------------------------+ |A very intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | |-- INSERT -- | @@ -187,7 +185,7 @@ look like this: +---------------------------------------+ |intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | | | @@ -202,7 +200,7 @@ insert mode (the final <Esc>). The result: +---------------------------------------+ |A young intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | | | @@ -215,7 +213,7 @@ To delete a whole line use the "dd" command. The following line will then move up to fill the gap: +---------------------------------------+ - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | |~ | @@ -332,7 +330,7 @@ Insert mode. Then you can type the text for the new line. Suppose the cursor is somewhere in the first of these two lines: A very intelligent turtle ~ - Found programming UNIX a hurdle ~ + Found programming Unix a hurdle ~ If you now use the "o" command and type new text: > @@ -342,7 +340,7 @@ The result is: A very intelligent turtle ~ That liked using Vim ~ - Found programming UNIX a hurdle ~ + Found programming Unix a hurdle ~ The "O" command (uppercase) opens a line above the cursor. diff --git a/runtime/doc/usr_09.txt b/runtime/doc/usr_09.txt index 05cc32bceb..d68d734b8f 100644 --- a/runtime/doc/usr_09.txt +++ b/runtime/doc/usr_09.txt @@ -134,10 +134,10 @@ The following command makes the mouse work like a Microsoft Windows mouse: > :behave mswin -The default behavior of the mouse on UNIX systems is xterm. The default -behavior on a Microsoft Windows system is selected during the installation -process. For details about what the two behaviors are, see |:behave|. Here -follows a summary. +The default behavior of the mouse on Unix systems is xterm. The default +behavior on Windows systems is selected during the installation process. For +details about what the two behaviors are, see |:behave|. Here follows a +summary. XTERM MOUSE BEHAVIOR diff --git a/runtime/doc/usr_10.txt b/runtime/doc/usr_10.txt index 64b0181c35..bf7ba18222 100644 --- a/runtime/doc/usr_10.txt +++ b/runtime/doc/usr_10.txt @@ -698,10 +698,10 @@ still be something that an external command can do better or faster. through an external program. In other words, it runs the system command represented by {program}, giving it the block of text represented by {motion} as input. The output of this command then replaces the selected block. - Because this summarizes badly if you are unfamiliar with UNIX filters, take + Because this summarizes badly if you are unfamiliar with Unix filters, take a look at an example. The sort command sorts a file. If you execute the following command, the unsorted file input.txt will be sorted and written to -output.txt. (This works on both UNIX and Microsoft Windows.) > +output.txt. This works on both Unix and Windows. > sort <input.txt >output.txt diff --git a/runtime/doc/usr_12.txt b/runtime/doc/usr_12.txt index fba1b53274..237abae55f 100644 --- a/runtime/doc/usr_12.txt +++ b/runtime/doc/usr_12.txt @@ -309,7 +309,7 @@ matches can be found. ============================================================================== *12.8* Find where a word is used -If you are a UNIX user, you can use a combination of Vim and the grep command +If you are a Unix user, you can use a combination of Vim and the grep command to edit all the files that contain a given word. This is extremely useful if you are working on a program and want to view or edit all the files that contain a specific variable. @@ -324,7 +324,7 @@ will only list the files containing the word and not print the matching lines. The word it is searching for is "frame_counter". Actually, this can be any regular expression. (Note: What grep uses for regular expressions is not exactly the same as what Vim uses.) - The entire command is enclosed in backticks (`). This tells the UNIX shell + The entire command is enclosed in backticks (`). This tells the Unix shell to run this command and pretend that the results were typed on the command line. So what happens is that the grep command is run and produces a list of files, these files are put on the Vim command line. This results in Vim diff --git a/runtime/doc/usr_23.txt b/runtime/doc/usr_23.txt index bdb3b7afd6..4761203512 100644 --- a/runtime/doc/usr_23.txt +++ b/runtime/doc/usr_23.txt @@ -25,7 +25,7 @@ Back in the early days, the old Teletype machines used two characters to start a new line. One to move the carriage back to the first position (carriage return, <CR>), another to move the paper up (line feed, <LF>). When computers came out, storage was expensive. Some people decided that -they did not need two characters for end-of-line. The UNIX people decided +they did not need two characters for end-of-line. The Unix people decided they could use <Line Feed> only for end-of-line. The Apple people standardized on <CR>. The MS-DOS (and Microsoft Windows) folks decided to keep the old <CR><LF>. @@ -34,7 +34,7 @@ have line-break problems. The Vim editor automatically recognizes the different file formats and handles things properly behind your back. The option 'fileformats' contains the various formats that will be tried when a new file is edited. The following command, for example, tells Vim to -try UNIX format first and MS-DOS format second: > +try Unix format first and MS-DOS format second: > :set fileformats=unix,dos @@ -97,12 +97,12 @@ CONVERSION You can use the 'fileformat' option to convert from one file format to another. Suppose, for example, that you have an MS-DOS file named README.TXT -that you want to convert to UNIX format. Start by editing the MS-DOS format +that you want to convert to Unix format. Start by editing the MS-DOS format file: > vim README.TXT Vim will recognize this as a dos format file. Now change the file format to -UNIX: > +Unix: > :set fileformat=unix :write diff --git a/runtime/doc/usr_24.txt b/runtime/doc/usr_24.txt index 46a22c683c..ba9d083fe0 100644 --- a/runtime/doc/usr_24.txt +++ b/runtime/doc/usr_24.txt @@ -563,9 +563,9 @@ that combination. Thus CTRL-K dP also works. Since there is no digraph for "dP" Vim will also search for a "Pd" digraph. Note: - The digraphs depend on the character set that Vim assumes you are - using. On MS-DOS they are different from MS-Windows. Always use - ":digraphs" to find out which digraphs are currently available. + The digraphs depend on the character set that Vim assumes you + are using. Always use ":digraphs" to find out which digraphs are + currently available. You can define your own digraphs. Example: > diff --git a/runtime/doc/usr_27.txt b/runtime/doc/usr_27.txt index fb096593f2..d837610698 100644 --- a/runtime/doc/usr_27.txt +++ b/runtime/doc/usr_27.txt @@ -83,7 +83,7 @@ matter if 'ignorecase' or 'smartcase' was changed. Note: If your search takes much longer than you expected, you can interrupt - it with CTRL-C on Unix and CTRL-Break on MS-DOS and MS-Windows. + it with CTRL-C on Unix and CTRL-Break on Windows. ============================================================================== *27.2* Wrapping around the file end diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index c6b143ca0e..8017b99f97 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1499,8 +1499,8 @@ Here is a summary of items that apply to Vim scripts. They are also mentioned elsewhere, but form a nice checklist. The end-of-line character depends on the system. For Unix a single <NL> -character is used. For MS-DOS, Windows and the like, <CR><LF> is used. -This is important when using mappings that end in a <CR>. See |:source_crnl|. +character is used. For Windows <CR><LF> is used. This is important when +using mappings that end in a <CR>. See |:source_crnl|. WHITE SPACE diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index ad0f541dfd..f028102634 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -563,7 +563,7 @@ which it was defined is reported. :5sleep "sleep for five seconds :sleep 100m "sleep for a hundred milliseconds 10gs "sleep for ten seconds -< Can be interrupted with CTRL-C (CTRL-Break on MS-DOS). +< Can be interrupted with CTRL-C (CTRL-Break on Windows). "gs" stands for "goto sleep". While sleeping the cursor is positioned in the text, if at a visible position. diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index 34e8731898..38248d1b22 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -44,8 +44,7 @@ Memory usage limits The option 'maxmem' ('mm') is used to set the maximum memory used for one buffer (in kilobytes). 'maxmemtot' is used to set the maximum memory used for -all buffers (in kilobytes). The defaults depend on the system used. For -MS-DOS, 'maxmemtot' is set depending on the amount of memory available. +all buffers (in kilobytes). The defaults depend on the system used. These are not hard limits, but tell Vim when to move text into a swap file. If you don't like Vim to swap to a file, set 'maxmem' and 'maxmemtot' to a very large value. The swap file will then only be used for recovery. If you diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index e5491b2612..e113a904c3 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -2,7 +2,7 @@ " Language: Java " Maintainer: Claudio Fleiner <claudio@fleiner.com> " URL: http://www.fleiner.com/vim/syntax/java.vim -" Last Change: 2012 Oct 05 +" Last Change: 2015 March 01 " Please check :help java.vim for comments on some of the options available. @@ -30,7 +30,7 @@ endif " some characters that cannot be in a java program (outside a string) syn match javaError "[\\@`]" -syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|[^-]->\|\*\/" +syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|\*\/" syn match javaOK "\.\.\." @@ -63,7 +63,7 @@ syn match javaTypedef "\.\s*\<class\>"ms=s+1 syn keyword javaClassDecl enum syn match javaClassDecl "^class\>" syn match javaClassDecl "[^.]\s*\<class\>"ms=s+1 -syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>" +syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>\(([^)]*)\)\=" contains=javaString syn match javaClassDecl "@interface\>" syn keyword javaBranch break continue nextgroup=javaUserLabelRef skipwhite syn match javaUserLabelRef "\k\+" contained @@ -121,7 +121,7 @@ if exists("java_space_errors") endif endif -syn region javaLabelRegion transparent matchgroup=javaLabel start="\<case\>" matchgroup=NONE end=":" contains=javaNumber,javaCharacter +syn region javaLabelRegion transparent matchgroup=javaLabel start="\<case\>" matchgroup=NONE end=":" contains=javaNumber,javaCharacter,javaString syn match javaUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=javaLabel syn keyword javaLabel default @@ -188,10 +188,10 @@ syn region javaString start=+"+ end=+"+ end=+$+ contains=javaSpecialChar,javaS syn match javaCharacter "'[^']*'" contains=javaSpecialChar,javaSpecialCharError syn match javaCharacter "'\\''" contains=javaSpecialChar syn match javaCharacter "'[^\\]'" -syn match javaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" -syn match javaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" -syn match javaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" -syn match javaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" +syn match javaNumber "\<\(0[bB][0-1]\+\|0[0-7]*\|0[xX]\x\+\|\d\(\d\|_\d\)*\)[lL]\=\>" +syn match javaNumber "\(\<\d\(\d\|_\d\)*\.\(\d\(\d\|_\d\)*\)\=\|\.\d\(\d\|_\d\)*\)\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\=" +syn match javaNumber "\<\d\(\d\|_\d\)*[eE][-+]\=\d\(\d\|_\d\)*[fFdD]\=\>" +syn match javaNumber "\<\d\(\d\|_\d\)*\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\>" " unicode characters syn match javaSpecial "\\u\d\{4\}" @@ -200,19 +200,21 @@ syn cluster javaTop add=javaString,javaCharacter,javaNumber,javaSpecial,javaStri if exists("java_highlight_functions") if java_highlight_functions == "indent" - syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses - syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses - syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses - syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses + syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation else " This line catches method declarations at any indentation>0, but it assumes " two things: " 1. class names are always capitalized (ie: Button) " 2. method names are never capitalized (except constructors, of course) - syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses + "syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses + syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(<.*>\s\+\)\?\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^(){}]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*(+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses,javaAnnotation endif + syn match javaLambdaDef "[a-zA-Z_][a-zA-Z0-9_]*\s*->" syn match javaBraces "[{}]" - syn cluster javaTop add=javaFuncDef,javaBraces + syn cluster javaTop add=javaFuncDef,javaBraces,javaLambdaDef endif if exists("java_highlight_debug") @@ -266,18 +268,23 @@ if exists("java_mark_braces_in_parens_as_errors") endif " catch errors caused by wrong parenthesis -syn region javaParenT transparent matchgroup=javaParen start="(" end=")" contains=@javaTop,javaParenT1 +syn region javaParenT transparent matchgroup=javaParen start="(" end=")" contains=@javaTop,javaParenT1 syn region javaParenT1 transparent matchgroup=javaParen1 start="(" end=")" contains=@javaTop,javaParenT2 contained syn region javaParenT2 transparent matchgroup=javaParen2 start="(" end=")" contains=@javaTop,javaParenT contained syn match javaParenError ")" " catch errors caused by wrong square parenthesis -syn region javaParenT transparent matchgroup=javaParen start="\[" end="\]" contains=@javaTop,javaParenT1 +syn region javaParenT transparent matchgroup=javaParen start="\[" end="\]" contains=@javaTop,javaParenT1 syn region javaParenT1 transparent matchgroup=javaParen1 start="\[" end="\]" contains=@javaTop,javaParenT2 contained syn region javaParenT2 transparent matchgroup=javaParen2 start="\[" end="\]" contains=@javaTop,javaParenT contained syn match javaParenError "\]" JavaHiLink javaParenError javaError +if exists("java_highlight_functions") + syn match javaLambdaDef "([a-zA-Z0-9_<>\[\], \t]*)\s*->" + " needs to be defined after the parenthesis error catcher to work +endif + if !exists("java_minlines") let java_minlines = 10 endif @@ -288,6 +295,7 @@ if version >= 508 || !exists("did_java_syn_inits") if version < 508 let did_java_syn_inits = 1 endif + JavaHiLink javaLambdaDef Function JavaHiLink javaFuncDef Function JavaHiLink javaVarArg Function JavaHiLink javaBraces Function |