diff --git a/runtime/autoload/gzip.vim b/runtime/autoload/gzip.vim index a6b4605b06..e4adec0947 100644 --- a/runtime/autoload/gzip.vim +++ b/runtime/autoload/gzip.vim @@ -1,6 +1,6 @@ " Vim autoload file for editing compressed files. " Maintainer: Bram Moolenaar -" Last Change: 2014 Nov 05 +" Last Change: 2016 Sep 28 " These functions are used by the gzip plugin. @@ -63,6 +63,9 @@ fun gzip#read(cmd) " set 'modifiable' let ma_save = &ma setlocal ma + " set 'write' + let write_save = &write + set write " Reset 'foldenable', otherwise line numbers get adjusted. if has("folding") let fen_save = &fen @@ -127,6 +130,7 @@ fun gzip#read(cmd) let &pm = pm_save let &cpo = cpo_save let &l:ma = ma_save + let &write = write_save if has("folding") let &l:fen = fen_save endif diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index de85844d5d..76485c2f38 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -22,8 +22,8 @@ if &cp || exists("g:loaded_netrw") finish endif -" netrw requires vim having patch 213; netrw will benefit from vim's having patch#656, too -if v:version < 704 || !has("patch213") +" netrw requires vim having patch 7.4.213; netrw will benefit from vim's having patch#656, too +if v:version < 704 || (v:version == 704 && !has("patch213")) if !exists("s:needpatch213") unsilent echomsg "***sorry*** this version of netrw requires vim v7.4 with patch 213" endif diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim index 7f25d9df33..8e38867a77 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: 2015 Jul 13 +" Last Change: 2016 Oct 10 " " OPTIONS: " @@ -195,6 +195,8 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ " }}} elseif context =~? 'implements' return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports) + elseif context =~? 'instanceof' + return phpcomplete#CompleteClassName(a:base, ['c', 'n'], current_namespace, imports) elseif context =~? 'extends\s\+.\+$' && a:base == '' return ['implements'] elseif context =~? 'extends' @@ -787,6 +789,8 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports) if kinds == ['c', 'i'] let filterstr = 'v:val =~? "\\(class\\|interface\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"' + elseif kinds == ['c', 'n'] + let filterstr = 'v:val =~? "\\(class\\|namespace\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"' elseif kinds == ['c'] let filterstr = 'v:val =~? "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"' elseif kinds == ['i'] @@ -931,7 +935,7 @@ function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibite endfor for modifier in a:modifiers - " if the modifier is prohibited its a no match + " if the modifier is prohibited it's a no match if index(a:prohibited_modifiers, modifier) != -1 return 0 endif @@ -996,7 +1000,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) " let required_modifiers += ['static'] endif let all_variable = filter(deepcopy(a:sccontent), - \ 'v:val =~ "^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$"') + \ 'v:val =~ "\\(^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$\\|^\\s*\\(\\/\\|\\*\\)*\\s*@property\\s\\+\\S\\+\\s\\S\\{-}\\s*$\\)"') let variables = [] for i in all_variable @@ -1160,6 +1164,14 @@ function! phpcomplete#GetTaglist(pattern) " {{{ endif let tags = taglist(a:pattern) + for tag in tags + for prop in keys(tag) + if prop == 'cmd' || prop == 'static' || prop == 'kind' || prop == 'builtin' + continue + endif + let tag[prop] = substitute(tag[prop], '\\\\', '\\', 'g') + endfor + endfor let s:cache_tags[a:pattern] = tags let has_key = has_key(s:cache_tags, a:pattern) let s:cache_tags_checksum = cache_checksum @@ -1379,7 +1391,7 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat " Get Structured information of all classes and subclasses including namespace and includes " try to find the method's return type in docblock comment for classstructure in classcontents - let docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method + let docblock_target_pattern = 'function\s\+&\?'.method.'\>\|\(public\|private\|protected\|var\).\+\$'.method.'\>\|@property.\+\$'.method.'\>' let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern) if doc_str != '' break @@ -1387,8 +1399,17 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat endfor if doc_str != '' let docblock = phpcomplete#ParseDocBlock(doc_str) - if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') - let type = has_key(docblock.return, 'type') ? docblock.return.type : docblock.var.type + if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0 + let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : '' + + if type == '' + for property in docblock.properties + if property.description =~? method + let type = property.type + break + endif + endfor + endif " there's a namespace in the type, threat the type as FQCN if type =~ '\\' @@ -1554,6 +1575,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor elseif get(methodstack, 0) =~# function_invocation_pattern let function_name = matchstr(methodstack[0], '^\s*\zs'.function_name_pattern) let function_file = phpcomplete#GetFunctionLocation(function_name, a:current_namespace) + if function_file == '' + let function_file = phpcomplete#GetFunctionLocation(function_name, '\') + endif if function_file == 'VIMPHP_BUILTINFUNCTION' " built in function, grab the return type from the info string @@ -1569,7 +1593,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines) " try to expand the classname of the returned type with the context got from the function's source file - let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports) + let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports) endif endif if classname_candidate != '' @@ -1650,9 +1674,10 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let sub_methodstack = phpcomplete#GetMethodStack(matchstr(line, '^\s*'.object.'\s*=&\?\s*\s\+\zs.*')) let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType( \ classname, - \ a:current_namespace, + \ namespace_for_class, \ a:imports, \ sub_methodstack) + return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate endif endif @@ -1783,6 +1808,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let [function_name, function_namespace] = phpcomplete#ExpandClassName(function_name, a:current_namespace, a:imports) let function_file = phpcomplete#GetFunctionLocation(function_name, function_namespace) + if function_file == '' + let function_file = phpcomplete#GetFunctionLocation(function_name, '\') + endif if function_file == 'VIMPHP_BUILTINFUNCTION' " built in function, grab the return type from the info string @@ -1798,7 +1826,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let classname_candidate = docblock.return.type let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines) " try to expand the classname of the returned type with the context got from the function's source file - let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports) + let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports) break endif endif @@ -1861,6 +1889,8 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor for tag in tags if tag.kind ==? 'v' && tag.cmd =~? '=\s*new\s\+\zs'.class_name_pattern.'\ze' let classname = matchstr(tag.cmd, '=\s*new\s\+\zs'.class_name_pattern.'\ze') + " unescape the classname, it would have "\" doubled since it is an ex command + let classname = substitute(classname, '\\\(\_.\)', '\1', 'g') return classname endif endfor @@ -2077,6 +2107,19 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam endif call searchpair('{', '', '}', 'W') let class_closing_bracket_line = line('.') + + " Include class docblock + let doc_line = cfline - 1 + if getline(doc_line) =~? '^\s*\*/' + while doc_line != 0 + if getline(doc_line) =~? '^\s*/\*\*' + let cfline = doc_line + break + endif + let doc_line -= 1 + endwhile + endif + let classcontent = join(getline(cfline, class_closing_bracket_line), "\n") let used_traits = [] @@ -2241,8 +2284,19 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{ let line = a:sccontent[i] " search for a function declaration if line =~? a:search - let l = i - 1 - " start backward serch for the comment block + if line =~? '@property' + let doc_line = i + while doc_line != sccontent_len - 1 + if a:sccontent[doc_line] =~? '^\s*\*/' + let l = doc_line + break + endif + let doc_line += 1 + endwhile + else + let l = i - 1 + endif + " start backward search for the comment block while l != 0 let line = a:sccontent[l] " if it's a one line docblock like comment and we can just return it right away @@ -2263,7 +2317,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{ return '' end - while l != 0 + while l >= 0 let line = a:sccontent[l] if line =~? '^\s*/\*\*' let comment_start = l @@ -2297,9 +2351,10 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{ \ 'return': {}, \ 'throws': [], \ 'var': {}, + \ 'properties': [], \ } - let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g') + let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@type\|@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g') let docblock_lines = split(a:docblock, "\n") let param_lines = filter(copy(docblock_lines), 'v:val =~? "^@param"') @@ -2334,15 +2389,26 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{ endif endfor - let var_line = filter(copy(docblock_lines), 'v:val =~? "^@var"') + let var_line = filter(copy(docblock_lines), 'v:val =~? "^\\(@var\\|@type\\)"') if len(var_line) > 0 - let var_parts = matchlist(var_line[0], '@var\s\+\(\S\+\)\s*\(.*\)') + let var_parts = matchlist(var_line[0], '\(@var\|@type\)\s\+\(\S\+\)\s*\(.*\)') let res['var'] = { \ 'line': var_parts[0], - \ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 1, '')), - \ 'description': get(var_parts, 2, '')} + \ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 2, '')), + \ 'description': get(var_parts, 3, '')} endif + let property_lines = filter(copy(docblock_lines), 'v:val =~? "^@property"') + for property_line in property_lines + let parts = matchlist(property_line, '\(@property\)\s\+\(\S\+\)\s*\(.*\)') + if len(parts) > 0 + call add(res.properties, { + \ 'line': parts[0], + \ 'type': phpcomplete#GetTypeFromDocBlockParam(get(parts, 2, '')), + \ 'description': get(parts, 3, '')}) + endif + endfor + return res endfunction " }}} @@ -2498,6 +2564,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ let name = matchstr(name, '\\\zs[^\\]\+\ze$') endif endif + " leading slash is not required use imports are always absolute let imports[name] = {'name': object, 'kind': ''} endfor @@ -2533,6 +2600,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ elseif !exists('no_namespace_candidate') " save the first namespacless match to be used if no better " candidate found later on + let tag.namespace = namespace_for_classes let no_namespace_candidate = tag endif endif diff --git a/runtime/autoload/rubycomplete.vim b/runtime/autoload/rubycomplete.vim index e1064c8a58..40b87f4cbe 100644 --- a/runtime/autoload/rubycomplete.vim +++ b/runtime/autoload/rubycomplete.vim @@ -93,7 +93,7 @@ function! s:GetBufferRubyEntity( name, type, ... ) let stopline = 1 - let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?' + let crex = '^\s*\<' . a:type . '\>\s*\<' . escape(a:name, '*') . '\>\s*\(<\s*.*\s*\)\?' let [lnum,lcol] = searchpos( crex, 'w' ) "let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' ) @@ -149,7 +149,7 @@ function! s:GetRubyVarType(v) let ctors = ctors.'\)' let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)' - let sstr = ''.a:v.'\>\s*[+\-*/]*'.fstr + let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr let [lnum,lcol] = searchpos(sstr,'nb',stopline) if lnum != 0 && lcol != 0 let str = matchstr(getline(lnum),fstr,lcol) @@ -196,7 +196,7 @@ function! rubycomplete#Complete(findstart, base) if c =~ '\w' continue elseif ! c =~ '\.' - idx = -1 + let idx = -1 break else break @@ -266,6 +266,28 @@ class VimRubyCompletion end end + def load_gems + fpath = VIM::evaluate("get(g:, 'rubycomplete_gemfile_path', 'Gemfile')") + return unless File.file?(fpath) && File.readable?(fpath) + want_bundler = VIM::evaluate("get(g:, 'rubycomplete_use_bundler')") + parse_file = !want_bundler + begin + require 'bundler' + Bundler.setup + Bundler.require + rescue Exception + parse_file = true + end + if parse_file + File.new(fpath).each_line do |line| + begin + require $1 if /\s*gem\s*['"]([^'"]+)/.match(line) + rescue Exception + end + end + end + end + def load_buffer_class(name) dprint "load_buffer_class(%s) START" % name classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")') @@ -588,6 +610,10 @@ class VimRubyCompletion load_rails end + want_gems = VIM::evaluate("get(g:, 'rubycomplete_load_gemfile')") + load_gems unless want_gems.to_i.zero? + + input = VIM::Buffer.current.line cpos = VIM::Window.current.cursor[1] - 1 input = input[0..cpos] @@ -678,7 +704,9 @@ class VimRubyCompletion cv = eval("self.class.constants") vartype = get_var_type( receiver ) dprint "vartype: %s" % vartype - if vartype != '' + + invalid_vartype = ['', "gets"] + if !invalid_vartype.include?(vartype) load_buffer_class( vartype ) begin @@ -706,7 +734,7 @@ class VimRubyCompletion methods.concat m.instance_methods(false) } end - variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0 + variables += add_rails_columns( "#{vartype}" ) if vartype && !invalid_vartype.include?(vartype) when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/ message = $1 diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index 5e76870cce..9c518cb9d0 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -117,7 +117,7 @@ fun! tar#Browse(tarfile) if !filereadable(a:tarfile) " call Decho('a:tarfile<'.a:tarfile.'> not filereadable') if a:tarfile !~# '^\a\+://' - " if its an url, don't complain, let url-handlers such as vim do its thing + " if it's an url, don't complain, let url-handlers such as vim do its thing redraw! echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None endif diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim index 687500ebe3..ea086e0882 100644 --- a/runtime/autoload/zip.vim +++ b/runtime/autoload/zip.vim @@ -1,7 +1,7 @@ " zip.vim: Handles browsing zipfiles " AUTOLOAD PORTION -" Date: Jul 02, 2013 -" Version: 27 +" Date: Sep 13, 2016 +" Version: 28 " Maintainer: Charles E Campbell " License: Vim License (see vim's :help license) " Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1 @@ -20,10 +20,10 @@ if &cp || exists("g:loaded_zip") finish endif -let g:loaded_zip= "v27" +let g:loaded_zip= "v28" if v:version < 702 echohl WarningMsg - echo "***warning*** this version of zip needs vim 7.2" + echo "***warning*** this version of zip needs vim 7.2 or later" echohl Normal finish endif @@ -53,6 +53,9 @@ endif if !exists("g:zip_unzipcmd") let g:zip_unzipcmd= "unzip" endif +if !exists("g:zip_extractcmd") + let g:zip_extractcmd= g:zip_unzipcmd +endif " ---------------- " Functions: {{{1 @@ -62,14 +65,14 @@ endif " zip#Browse: {{{2 fun! zip#Browse(zipfile) " call Dfunc("zip#Browse(zipfile<".a:zipfile.">)") - " sanity check: insure that the zipfile has "PK" as its first two letters + " sanity check: ensure that the zipfile has "PK" as its first two letters " (zipped files have a leading PK as a "magic cookie") if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK' exe "noautocmd e ".fnameescape(a:zipfile) " call Dret("zip#Browse : not a zipfile<".a:zipfile.">") return " else " Decho -" call Decho("zip#Browse: a:zipfile<".a:zipfile."> passed PK test - its a zip file") +" call Decho("zip#Browse: a:zipfile<".a:zipfile."> passed PK test - it's a zip file") endif let repkeep= &report @@ -92,7 +95,7 @@ fun! zip#Browse(zipfile) endif if !filereadable(a:zipfile) if a:zipfile !~# '^\a\+://' - " if its an url, don't complain, let url-handlers such as vim do its thing + " if it's an url, don't complain, let url-handlers such as vim do its thing redraw! echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None " call inputsave()|call input("Press to continue")|call inputrestore() @@ -136,8 +139,10 @@ fun! zip#Browse(zipfile) return endif + " Maps associated with zip plugin setlocal noma nomod ro - noremap :call ZipBrowseSelect() + noremap :call ZipBrowseSelect() + noremap x :call zip#Extract() let &report= repkeep " call Dret("zip#Browse") @@ -204,6 +209,15 @@ fun! zip#Read(fname,mode) endif " call Decho("zipfile<".zipfile.">") " call Decho("fname <".fname.">") + " sanity check + if !executable(substitute(g:zip_unzipcmd,'\s\+.*$','','')) + redraw! + echohl Error | echo "***error*** (zip#Read) sorry, your system doesn't appear to have the ".g:zip_unzipcmd." program" | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + let &report= repkeep +" call Dret("zip#Write") + return + endif " the following code does much the same thing as " exe "keepj sil! r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1) @@ -236,9 +250,9 @@ fun! zip#Write(fname) set report=10 " sanity checks - if !executable(g:zip_zipcmd) + if !executable(substitute(g:zip_zipcmd,'\s\+.*$','','')) redraw! - echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the zip pgm" | echohl None + echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the ".g:zip_zipcmd." program" | echohl None " call inputsave()|call input("Press to continue")|call inputrestore() let &report= repkeep " call Dret("zip#Write") @@ -344,6 +358,48 @@ fun! zip#Write(fname) " call Dret("zip#Write") endfun +" --------------------------------------------------------------------- +" zip#Extract: extract a file from a zip archive {{{2 +fun! zip#Extract() +" call Dfunc("zip#Extract()") + + let repkeep= &report + set report=10 + let fname= getline(".") +" call Decho("fname<".fname.">") + + " sanity check + if fname =~ '^"' + let &report= repkeep +" call Dret("zip#Extract") + return + endif + if fname =~ '/$' + redraw! + echohl Error | echo "***error*** (zip#Extract) Please specify a file, not a directory" | echohl None + let &report= repkeep +" call Dret("zip#Extract") + return + endif + + " extract the file mentioned under the cursor +" call Decho("system(".g:zip_extractcmd." ".shellescape(b:zipfile)." ".shellescape(shell).")") + call system(g:zip_extractcmd." ".shellescape(b:zipfile)." ".shellescape(shell)) +" call Decho("zipfile<".b:zipfile.">") + if v:shell_error != 0 + echohl Error | echo "***error*** ".g:zip_extractcmd." ".b:zipfile." ".fname.": failed!" | echohl NONE + elseif !filereadable(fname) + echohl Error | echo "***error*** attempted to extract ".fname." but it doesn't appear to be present!" + else + echo "***note*** successfully extracted ".fname + endif + + " restore option + let &report= repkeep + +" call Dret("zip#Extract") +endfun + " --------------------------------------------------------------------- " s:Escape: {{{2 fun! s:Escape(fname,isfilt) diff --git a/runtime/colors/evening.vim b/runtime/colors/evening.vim index 5dae08280e..5257307593 100644 --- a/runtime/colors/evening.vim +++ b/runtime/colors/evening.vim @@ -1,6 +1,6 @@ " Vim color file " Maintainer: Bram Moolenaar -" Last Change: 2006 Apr 14 +" Last Change: 2016 Oct 10 " This color scheme uses a dark grey background. @@ -45,8 +45,8 @@ hi CursorColumn term=reverse ctermbg=Black guibg=grey40 hi CursorLine term=underline cterm=underline guibg=grey40 " Groups for syntax highlighting -hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5 -hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5 +hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 +hi Special term=bold ctermfg=LightRed guifg=Orange if &t_Co > 8 hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold endif diff --git a/runtime/colors/koehler.vim b/runtime/colors/koehler.vim index a36f9f6972..250472a162 100644 --- a/runtime/colors/koehler.vim +++ b/runtime/colors/koehler.vim @@ -2,7 +2,7 @@ " vim: tw=0 ts=4 sw=4 " Vim color file " Maintainer: Ron Aaron -" Last Change: 2013 May 23 +" Last Change: 2016 Sep 04 hi clear set background=dark @@ -45,6 +45,7 @@ hi TabLineFill term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white g hi TabLineSel term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue hi Underlined term=underline cterm=bold,underline ctermfg=lightblue guifg=lightblue gui=bold,underline hi Ignore ctermfg=black ctermbg=black guifg=black guibg=black +hi EndOfBuffer term=bold cterm=bold ctermfg=darkred guifg=#cc0000 gui=bold hi link IncSearch Visual hi link String Constant hi link Character Constant diff --git a/runtime/compiler/cucumber.vim b/runtime/compiler/cucumber.vim index c020be6e3b..17ce3627c1 100644 --- a/runtime/compiler/cucumber.vim +++ b/runtime/compiler/cucumber.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Cucumber " Maintainer: Tim Pope -" Last Change: 2010 Aug 09 +" Last Change: 2016 Aug 29 if exists("current_compiler") finish @@ -19,7 +19,7 @@ CompilerSet makeprg=cucumber CompilerSet errorformat= \%W%m\ (Cucumber::Undefined), - \%E%m\ (%.%#), + \%E%m\ (%\\S%#), \%Z%f:%l, \%Z%f:%l:%.%# diff --git a/runtime/compiler/haml.vim b/runtime/compiler/haml.vim index b06a672df7..9464c3dc85 100644 --- a/runtime/compiler/haml.vim +++ b/runtime/compiler/haml.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Haml " Maintainer: Tim Pope -" Last Change: 2013 May 30 +" Last Change: 2016 Aug 29 if exists("current_compiler") finish @@ -15,7 +15,7 @@ endif let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=haml\ -c +CompilerSet makeprg=haml CompilerSet errorformat= \Haml\ %trror\ on\ line\ %l:\ %m, diff --git a/runtime/compiler/rake.vim b/runtime/compiler/rake.vim index 3bd9da0daf..8490f2a9e9 100644 --- a/runtime/compiler/rake.vim +++ b/runtime/compiler/rake.vim @@ -27,7 +27,11 @@ CompilerSet errorformat= \%\\s%#[%f:%l:\ %#%m, \%\\s%#%f:%l:\ %#%m, \%\\s%#%f:%l:, - \%m\ [%f:%l]: + \%m\ [%f:%l]:, + \%+Erake\ aborted!, + \%+EDon't\ know\ how\ to\ build\ task\ %.%#, + \%+Einvalid\ option:%.%#, + \%+Irake\ %\\S%\\+%\\s%\\+#\ %.%# let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/compiler/rspec.vim b/runtime/compiler/rspec.vim index 7c340bab15..c77bd70da7 100644 --- a/runtime/compiler/rspec.vim +++ b/runtime/compiler/rspec.vim @@ -22,9 +22,10 @@ CompilerSet errorformat= \%f:%l:\ %tarning:\ %m, \%E%.%#:in\ `load':\ %f:%l:%m, \%E%f:%l:in\ `%*[^']':\ %m, - \%-Z\ \ \ \ \ \#\ %f:%l:%.%#, + \%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#, \%E\ \ %\\d%\\+)%.%#, \%C\ \ \ \ \ %m, + \%C%\\s%#, \%-G%.%# let &cpo = s:cpo_save diff --git a/runtime/compiler/rubyunit.vim b/runtime/compiler/rubyunit.vim index 93a0c8e653..ed0639b581 100644 --- a/runtime/compiler/rubyunit.vim +++ b/runtime/compiler/rubyunit.vim @@ -17,6 +17,8 @@ let s:cpo_save = &cpo set cpo-=C CompilerSet makeprg=testrb +" CompilerSet makeprg=ruby\ -Itest +" CompilerSet makeprg=m CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:, \%C%m\ [%f:%l]:, diff --git a/runtime/compiler/sass.vim b/runtime/compiler/sass.vim index 376a52b303..9c540ac443 100644 --- a/runtime/compiler/sass.vim +++ b/runtime/compiler/sass.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Sass " Maintainer: Tim Pope -" Last Change: 2013 May 30 +" Last Change: 2016 Aug 29 if exists("current_compiler") finish @@ -15,7 +15,7 @@ endif let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=sass\ -c +CompilerSet makeprg=sass CompilerSet errorformat= \%f:%l:%m\ (Sass::Syntax%trror), diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index e7c7b0d71a..f783438fc9 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -76,11 +76,15 @@ exception is that "" is expanded when the autocmd is defined. Example: Here Vim expands to the name of the file containing this line. -When your vimrc file is sourced twice, the autocommands will appear twice. -To avoid this, put this command in your vimrc file, before defining -autocommands: > +`:autocmd` adds to the list of autocommands regardless of whether they are +already present. When your .vimrc file is sourced twice, the autocommands +will appear twice. To avoid this, define your autocommands in a group, so +that you can easily clear them: > - :autocmd! " Remove ALL autocommands for the current group. + augroup vimrc + autocmd! " Remove all vimrc autocommands + au BufNewFile,BufRead *.html so :h/html.vim + augroup END If you don't want to remove all autocommands, you can instead use a variable to ensure that Vim includes the autocommands only once: > @@ -127,8 +131,13 @@ prompt. When one command outputs two messages this can happen anyway. :au[tocmd]! [group] {event} Remove ALL autocommands for {event}. + Warning: You should not do this without a group for + |BufRead| and other common events, it can break + plugins, syntax highlighting, etc. :au[tocmd]! [group] Remove ALL autocommands. + Warning: You should normally not do this without a + group, it breaks plugins, syntax highlighting, etc. When the [group] argument is not given, Vim uses the current group (as defined with ":augroup"); otherwise, Vim uses the group defined with [group]. @@ -422,8 +431,8 @@ BufUnload Before unloading a buffer. This is when the NOTE: When this autocommand is executed, the current buffer "%" may be different from the buffer being unloaded "". - Don't change to another buffer, it will cause - problems. + Don't change to another buffer or window, it + will cause problems! When exiting and v:dying is 2 or more this event is not triggered. *BufWinEnter* @@ -794,7 +803,9 @@ QuickFixCmdPre Before a quickfix command is run (|:make|, |:vimgrepadd|, |:lvimgrepadd|, |:cscope|, |:cfile|, |:cgetfile|, |:caddfile|, |:lfile|, |:lgetfile|, |:laddfile|, |:helpgrep|, - |:lhelpgrep|). + |:lhelpgrep|, |:cexpr|, |:cgetexpr|, + |:caddexpr|, |:cbuffer|, |:cgetbuffer|, + |:caddbuffer|). The pattern is matched against the command being run. When |:grep| is used but 'grepprg' is set to "internal" it still matches "grep". @@ -1002,7 +1013,7 @@ WinLeave Before leaving a window. If the window to be *WinNew* WinNew When a new window was created. Not done for - the fist window, when Vim has just started. + the first window, when Vim has just started. Before a WinEnter event. ============================================================================== @@ -1086,6 +1097,9 @@ Note that for all systems the '/' character is used for path separator (even Windows). This was done because the backslash is difficult to use in a pattern and to make the autocommands portable across different systems. +It is possible to use |pattern| items, but they may not work as expected, +because of the translation done for the above. + *autocmd-changes* Matching with the pattern is done when an event is triggered. Changing the buffer name in one of the autocommands, or even deleting the buffer, does not @@ -1184,11 +1198,12 @@ name! different from existing {event} names, as this most likely will not do what you intended. - *:augroup-delete* *E367* *W19* + *:augroup-delete* *E367* *W19* *E936* :aug[roup]! {name} Delete the autocmd group {name}. Don't use this if there is still an autocommand using this group! You will get a warning if doing - it anyway. + it anyway. when the group is the current group + you will get error E936. To enter autocommands for a specific group, use this method: 1. Select the group with ":augroup {name}". diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index e0974b103c..c669d1792d 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -833,6 +833,7 @@ The numbering of "\1", "\2" etc. is done based on which "\(" comes first in the pattern (going left to right). When a parentheses group matches several times, the last one will be used for "\1", "\2", etc. Example: > :s/\(\(a[a-d] \)*\)/\2/ modifies "aa ab x" to "ab x" +The "\2" is for "\(a[a-d] \)". At first it matches "aa ", secondly "ab ". When using parentheses in combination with '|', like in \([ab]\)\|\([cd]\), either the first or second pattern in parentheses did not match, so either diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 7277e1d22e..3e041c3b62 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -219,9 +219,10 @@ CTRL-Y When there is a modeless selection, copy the selection into the clipboard. |modeless-selection| If there is no selection CTRL-Y is inserted as a character. -CTRL-J *c_CTRL-J* *c_* *c_* *c_CR* +CTRL-M or CTRL-J *c_CTRL-M* *c_CTRL-J* *c_* *c_* *c_CR* or start entered command - *c_* *c_Esc* + +CTRL-[ *c_CTRL-[* *c_* *c_Esc* When typed and 'x' not present in 'cpoptions', quit Command-line mode without executing. In macros or when 'x' present in 'cpoptions', start entered command. diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 57458b7b81..7007a89611 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -160,7 +160,8 @@ start editing another file, Vim will refuse this. In order to overrule this protection, add a '!' to the command. The changes will then be lost. For example: ":q" will not work if the buffer was changed, but ":q!" will. To see whether the buffer was changed use the "CTRL-G" command. The message includes -the string "[Modified]" if the buffer has been changed. +the string "[Modified]" if the buffer has been changed, or "+" if the 'm' flag +is in 'shortmess'. If you want to automatically save the changes without asking, switch on the 'autowriteall' option. 'autowrite' is the associated Vi-compatible option diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 107dd28ecd..2d6c6ee3a0 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -107,7 +107,7 @@ To test for a non-empty string, use empty(): > *non-zero-arg* Function arguments often behave slightly different from |TRUE|: If the argument is present and it evaluates to a non-zero Number, |v:true| or a -non-empty String, then the value is considere to be TRUE. +non-empty String, then the value is considered to be TRUE. Note that " " and "0" are also non-empty strings, thus cause the mode to be cleared. A List, Dictionary or Float is not a Number or String, thus evaluates to FALSE. @@ -631,13 +631,17 @@ It's possible to form a variable name with curly braces, see Expression syntax summary, from least to most significant: -|expr1| expr2 ? expr1 : expr1 if-then-else +|expr1| expr2 + expr2 ? expr1 : expr1 if-then-else -|expr2| expr3 || expr3 .. logical OR +|expr2| expr3 + expr3 || expr3 .. logical OR -|expr3| expr4 && expr4 .. logical AND +|expr3| expr4 + expr4 && expr4 .. logical AND -|expr4| expr5 == expr5 equal +|expr4| expr5 + expr5 == expr5 equal expr5 != expr5 not equal expr5 > expr5 greater than expr5 >= expr5 greater than or equal @@ -654,24 +658,28 @@ Expression syntax summary, from least to most significant: expr5 is expr5 same |List| instance expr5 isnot expr5 different |List| instance -|expr5| expr6 + expr6 .. number addition or list concatenation +|expr5| expr6 + expr6 + expr6 .. number addition or list concatenation expr6 - expr6 .. number subtraction expr6 . expr6 .. string concatenation -|expr6| expr7 * expr7 .. number multiplication +|expr6| expr7 + expr7 * expr7 .. number multiplication expr7 / expr7 .. number division expr7 % expr7 .. number modulo -|expr7| ! expr7 logical NOT +|expr7| expr8 + ! expr7 logical NOT - expr7 unary minus + expr7 unary plus -|expr8| expr8[expr1] byte of a String or item of a |List| +|expr8| expr9 + expr8[expr1] byte of a String or item of a |List| expr8[expr1 : expr1] substring of a String or sublist of a |List| expr8.name entry in a |Dictionary| expr8(expr1, ...) function call with |Funcref| variable -|expr9| number number constant +|expr9| number number constant "string" string constant, backslash is special 'string' string constant, ' is doubled [expr1, ...] |List| @@ -931,7 +939,7 @@ expr8[expr1] item of String or |List| *expr-[]* *E111* If expr8 is a Number or String this results in a String that contains the expr1'th single byte from expr8. expr8 is used as a String, expr1 as a -Number. This doesn't recognize multi-byte encodings, see |byteidx()| for +Number. This doesn't recognize multi-byte encodings, see `byteidx()` for an alternative, or use `split()` to turn the string into a list of characters. Index zero gives the first byte. This is like it works in C. Careful: @@ -1214,7 +1222,7 @@ The arguments are optional. Example: > < error function *closure* Lambda expressions can access outer scope variables and arguments. This is -often called a closure. Example where "i" a and "a:arg" are used in a lambda +often called a closure. Example where "i" and "a:arg" are used in a lambda while they exist in the function scope. They remain valid even after the function returns: > :function Foo(arg) @@ -1233,7 +1241,7 @@ Examples for using a lambda expression with |sort()|, |map()| and |filter()|: > :echo sort([3,7,2,1,4], {a, b -> a - b}) < [1, 2, 3, 4, 7] -The lambda expression is also useful for Channel, Job and timer: > +The lambda expression is also useful for jobs and timers: > :let timer = timer_start(500, \ {-> execute("echo 'Handler called'", "")}, \ {'repeat': 3}) @@ -2023,8 +2031,8 @@ expand({expr} [, {nosuf} [, {list}]]) feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer filereadable({file}) Number |TRUE| if {file} is a readable file filewritable({file}) Number |TRUE| if {file} is a writable file -filter({expr}, {string}) List/Dict remove items from {expr} where - {string} is 0 +filter({expr1}, {expr2}) List/Dict remove items from {expr1} where + {expr2} is 0 finddir({name}[, {path}[, {count}]]) String find directory {name} in {path} findfile({name}[, {path}[, {count}]]) @@ -2048,7 +2056,7 @@ garbagecollect([{atexit}]) none free memory, breaking cyclic references get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def} get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def} get({func}, {what}) any get property of funcref/partial {func} -getbufinfo( [{expr}]) List information about buffers +getbufinfo([{expr}]) List information about buffers getbufline({expr}, {lnum} [, {end}]) List lines {lnum} to {end} of buffer {expr} getbufvar({expr}, {varname} [, {def}]) @@ -2147,7 +2155,7 @@ lispindent({lnum}) Number Lisp indent for line {lnum} localtime() Number current time log({expr}) Float natural logarithm (base e) of {expr} log10({expr}) Float logarithm of Float {expr} to base 10 -map({expr}, {string}) List/Dict change each item in {expr} to {expr} +map({expr1}, {expr2}) List/Dict change each item in {expr1} to {expr} maparg({name}[, {mode} [, {abbr} [, {dict}]]]) String or Dict rhs of mapping {name} in mode {mode} @@ -3044,6 +3052,8 @@ delete({fname} [, {flags}]) *delete()* When {flags} is "rf": Deletes the directory by the name {fname} and everything in it, recursively. BE CAREFUL! + Note: on MS-Windows it is not possible to delete a directory + that is being used. The result is a Number, which is 0 if the delete operation was successful and -1 when the deletion failed or partly failed. @@ -3478,9 +3488,10 @@ filter({expr1}, {expr2}) *filter()* is zero remove the item from the |List| or |Dictionary|. {expr2} must be a |string| or |Funcref|. - if {expr2} is a |string|, inside {expr2} |v:val| has the value + If {expr2} is a |string|, inside {expr2} |v:val| has the value of the current item. For a |Dictionary| |v:key| has the key - of the current item. + of the current item and for a |List| |v:key| has the index of + the current item. For a |Dictionary| |v:key| has the key of the current item. Examples: > call filter(mylist, 'v:val !~ "OLD"') @@ -3503,6 +3514,10 @@ filter({expr1}, {expr2}) *filter()* return a:idx % 2 == 1 endfunc call filter(mylist, function('Odd')) +< It is shorter when using a |lambda|: > + call filter(myList, {idx, val -> idx * val <= 42}) +< If you do not use "val" you can leave it out: > + call filter(myList, {idx -> idx % 2 == 1}) < The operation is done in-place. If you want a |List| or |Dictionary| to remain unmodified make a copy first: > @@ -4538,6 +4553,7 @@ histadd({history}, {item}) *histadd()* "expr" or "=" typed expression history "input" or "@" input line history "debug" or ">" debug command history + empty the current or last used history The {history} string does not need to be the whole name, one character is sufficient. If {item} does already exist in the history, it will be @@ -5140,6 +5156,10 @@ map({expr1}, {expr2}) *map()* return a:key . '-' . a:val endfunc call map(myDict, function('KeyValue')) +< It is shorter when using a |lambda|: > + call map(myDict, {key, val -> key . '-' . val}) +< If you do not use "val" you can leave it out: > + call map(myDict, {key -> 'item: ' . key}) < The operation is done in-place. If you want a |List| or |Dictionary| to remain unmodified make a copy first: > @@ -6167,7 +6187,7 @@ rpcstop({channel}) {Nvim} *rpcstop()* connecting to |v:servername|. screenattr(row, col) *screenattr()* - Like screenchar(), but return the attribute. This is a rather + Like |screenchar()|, but return the attribute. This is a rather arbitrary number that can only be used to compare to the attribute at other positions. @@ -7579,13 +7599,14 @@ timer_start({time}, {callback} [, {options}]) busy or Vim is not waiting for input the time will be longer. {callback} is the function to call. It can be the name of a - function or a Funcref. It is called with one argument, which + function or a |Funcref|. It is called with one argument, which is the timer ID. The callback is only invoked when Vim is waiting for input. {options} is a dictionary. Supported entries: "repeat" Number of times to repeat calling the - callback. -1 means forever. + callback. -1 means forever. When not present + the callback will be called once. Example: > func MyHandler(timer) diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 4c7360c88e..c03100460d 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -565,6 +565,17 @@ These maps can be disabled with > :let g:no_pdf_maps = 1 < +PYTHON *ft-python-plugin* *PEP8* + +By default the following options are set, in accordance with PEP8: > + + setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 + +To disable this behaviour, set the following variable in your vimrc: > + + let g:python_recommended_style = 0 + + RPM SPEC *ft-spec-plugin* Since the text for this plugin is rather long it has been put in a separate diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 6321175420..e19a80059a 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -48,7 +48,11 @@ Example: > print 'EAT ME' EOF endfunction -< + +To see what version of Python you have: > + :python import sys + :python print(sys.version) + Note: Python is very sensitive to the indenting. Make sure the "class" line and "EOF" do not have any indent. @@ -692,6 +696,10 @@ functions to evaluate Python expressions and pass their values to VimL. The `:py3` and `:python3` commands work similar to `:python`. A simple check if the `:py3` command is working: > :py3 print("Hello") + +To see what version of Python you have: > + :py3 import sys + :py3 print(sys.version) < *:py3file* The `:py3file` command works similar to `:pyfile`. *:py3do* diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt index 2474039d82..e02ace67de 100644 --- a/runtime/doc/if_ruby.txt +++ b/runtime/doc/if_ruby.txt @@ -54,6 +54,9 @@ Example Vim script: > EOF endfunction < +To see what version of Ruby you have: > + :ruby print RUBY_VERSION +< *:rubydo* *:rubyd* *E265* :[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 0dc8fff975..16e9d4a64d 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -982,7 +982,7 @@ tag command action in Command-line editing mode ~ |c_CTRL-E| CTRL-E cursor to end of command-line |'cedit'| CTRL-F default value for 'cedit': opens the command-line window; otherwise not used - CTRL-G not used +|c_CTRL-G| CTRL-G next match when 'incsearch' is active |c_| delete the character in front of the cursor |c_digraph| {char1} {char2} enter digraph when 'digraph' is on @@ -1000,7 +1000,7 @@ tag command action in Command-line editing mode ~ |c_CTRL-L| CTRL-L do completion on the pattern in front of the cursor and insert the longest common part |c_| execute entered command -|c_| CTRL-M same as +|c_CTRL-M| CTRL-M same as |c_CTRL-N| CTRL-N after using 'wildchar' with multiple matches: go to next match, otherwise: same as CTRL-O not used @@ -1015,7 +1015,7 @@ tag command action in Command-line editing mode ~ insert the contents of a register or object under the cursor literally CTRL-S (used for terminal control flow) - CTRL-T not used +|c_CTRL-T| CTRL-T previous match when 'incsearch' is active |c_CTRL-U| CTRL-U remove all characters |c_CTRL-V| CTRL-V insert next non-digit literally, insert three digit decimal number as a single byte. @@ -1024,7 +1024,7 @@ tag command action in Command-line editing mode ~ CTRL-Y copy (yank) modeless selection CTRL-Z not used (reserved for suspend) |c_| abandon command-line without executing it -|c_| CTRL-[ same as +|c_CTRL-[| CTRL-[ same as |c_CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode, abandon command-line |c_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode', abandon command-line diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index bc34b69508..e5a32041a5 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -126,10 +126,7 @@ http://www.vim.org/maillist.php Bug reports: *bugs* *bug-reports* *bugreport.vim* -Send bug reports to: Vim Developers -This is a maillist, you need to become a member first and many people will see -the message. If you don't want that, e.g. because it is a security issue, -send it to , this only goes to the Vim maintainer (that's Bram). +Report bugs on GitHub: https://github.com/neovim/neovim/issues Please be brief; all the time that is spent on answering mail is subtracted from the time that is spent on improving Vim! Always give a reproducible diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 3ba1ce1f17..25bd2d18ee 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -437,6 +437,9 @@ with a space. Note: When using mappings for Visual mode, you can use the "'<" mark, which is the start of the last selected Visual area in the current buffer |'<|. +The |:filter| command can be used to select what mappings to list. The +pattern is matched against the {lhs} and {rhs} in the raw form. + *:map-verbose* When 'verbose' is non-zero, listing a key map will also display where it was last defined. Example: > @@ -1136,6 +1139,10 @@ scripts. " Command has the -register attribute b Command is local to current buffer (see below for details on attributes) + The list can be filtered on command name with + |:filter|, e.g., to list all commands with "Pyth" in + the name: > + filter Pyth command :com[mand] {cmd} List the user-defined commands that start with {cmd} diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index 5c2dddc8b3..e619cfde30 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -39,6 +39,7 @@ back. Note: If the output has been stopped with "q" at the more prompt, it will only be displayed up to this point. The previous command output is cleared when another command produces output. +The "g<" output is not redirected. If you want to find help on a specific (error) message, use the ID at the start of the message. For example, to get help on the message: > diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 6b96271c4a..bbfd6d32d3 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -10,7 +10,7 @@ Options *options* 2. Automatically setting options |auto-setting| 3. Options summary |option-summary| -For an overview of options see help.txt |option-list|. +For an overview of options see quickref.txt |option-list|. Vim has a number of internal variables and switches which can be set to achieve special effects. These options come in three forms: @@ -2092,7 +2092,7 @@ A jump table for the options with a short description can be found at |Q_op|. uhex Show unprintable characters hexadecimal as instead of using ^C and ~C. - When neither "lastline" or "truncate" is included, a last line that + When neither "lastline" nor "truncate" is included, a last line that doesn't fit is replaced with "@" lines. *'eadirection'* *'ead'* @@ -2219,10 +2219,15 @@ A jump table for the options with a short description can be found at |Q_op|. *'exrc'* *'ex'* *'noexrc'* *'noex'* 'exrc' 'ex' boolean (default off) global - Enables the reading of .nvimrc and .exrc in the current directory. - If you switch this option on you should also consider setting the - 'secure' option (see |initialization|). Using this option comes - with a potential security risk, use with care! + Enables the reading of .vimrc and .exrc in the current directory. + Setting this option is a potential security leak. E.g., consider + unpacking a package or fetching files from github, a .vimrc in there + might be a trojan horse. BETTER NOT SET THIS OPTION! + Instead, define an autocommand in your .vimrc to set options for a + matching directory. + + If you do switch this option on you should also consider setting the + 'secure' option (see |initialization|). This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. Also see |init.vim| and |gui-init|. @@ -3426,6 +3431,8 @@ A jump table for the options with a short description can be found at |Q_op|. original position when no match is found and when pressing . You still need to finish the search command with to move the cursor to the match. + You can use the CTRL-G and CTRL-T keys to move to the next and + previous match. |c_CTRL-G| |c_CTRL-T| Vim only searches for about half a second. With a complicated pattern and/or a lot of text the match may not be found. This is to avoid that Vim hangs while you are typing the pattern. @@ -3915,10 +3922,11 @@ A jump table for the options with a short description can be found at |Q_op|. global Changes the special characters that can be used in search patterns. See |pattern|. - NOTE: To avoid portability problems with using patterns, always keep - this option at the default "on". Only switch it off when working with - old Vi scripts. In any other situation write patterns that work when - 'magic' is on. Include "\M" when you want to |/\M|. + WARNING: Switching this option off most likely breaks plugins! That + is because many patterns assume it's on and will fail when it's off. + Only switch it off when working with old Vi scripts. In any other + situation write patterns that work when 'magic' is on. Include "\M" + when you want to |/\M|. *'makeef'* *'mef'* 'makeef' 'mef' string (default: "") @@ -4884,7 +4892,9 @@ A jump table for the options with a short description can be found at |Q_op|. ordering. This is for preferences to overrule or add to the distributed defaults or system-wide settings (rarely needed). - More entries are added when using |packages|. + More entries are added when using |packages|. If it gets very long + then `:set rtp` will be truncated, use `:echo &rtp` to see the full + string. Note that, unlike 'path', no wildcards like "**" are allowed. Normal wildcards are allowed, but can significantly slow down searching for diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 1d0f42c222..c951a58734 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -354,8 +354,8 @@ For starters, read chapter 27 of the user manual |usr_27.txt|. */\%#=* *two-engines* *NFA* Vim includes two regexp engines: 1. An old, backtracking engine that supports everything. -2. A new, NFA engine that works much faster on some patterns, but does not - support everything. +2. A new, NFA engine that works much faster on some patterns, possibly slower + on some patterns. Vim will automatically select the right engine for you. However, if you run into a problem or want to specifically select one engine or the other, you can diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index d0cfa70582..3e19f0b4af 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -530,7 +530,7 @@ variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"' < (note: it has been reported that windows 7 with putty v0.6's "-batch" option - doesn't work, so its best to leave it off for that system) + doesn't work, so it's best to leave it off for that system) See |netrw-p8| for more about putty, pscp, psftp, etc. @@ -1204,7 +1204,7 @@ The :NetrwMB command is available outside of netrw buffers (once netrw has been invoked in the session). The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By -default, its stored on the first directory on the user's |'runtimepath'|. +default, it's stored on the first directory on the user's |'runtimepath'|. Related Topics: |netrw-gb| how to return (go) to a bookmark @@ -1429,7 +1429,7 @@ be used in that count. *.netrwhist* See |g:netrw_dirhistmax| for how to control the quantity of history stack slots. The file ".netrwhist" holds history when netrw (and vim) is not -active. By default, its stored on the first directory on the user's +active. By default, it's stored on the first directory on the user's |'runtimepath'|. Related Topics: @@ -3269,7 +3269,7 @@ The user function is passed one argument; it resembles > fun! ExampleUserMapFunc(islocal) < -where a:islocal is 1 if its a local-directory system call or 0 when +where a:islocal is 1 if it's a local-directory system call or 0 when remote-directory system call. Use netrw#Expose("varname") to access netrw-internal (script-local) @@ -3593,7 +3593,7 @@ Example: Clear netrw's marked file list via a mapping on gu > *netrw-p16* P16. When editing remote files (ex. :e ftp://hostname/path/file), - under Windows I get an |E303| message complaining that its unable + under Windows I get an |E303| message complaining that it's unable to open a swap file. (romainl) It looks like you are starting Vim from a protected @@ -3647,7 +3647,7 @@ Example: Clear netrw's marked file list via a mapping on gu > P21. I've made a directory (or file) with an accented character, but netrw isn't letting me enter that directory/read that file: - Its likely that the shell or o/s is using a different encoding + It's likely that the shell or o/s is using a different encoding than you have vim (netrw) using. A patch to vim supporting "systemencoding" may address this issue in the future; for now, just have netrw use the proper encoding. For example: > diff --git a/runtime/doc/pi_zip.txt b/runtime/doc/pi_zip.txt index 64f0be1a08..c20bda1fa1 100644 --- a/runtime/doc/pi_zip.txt +++ b/runtime/doc/pi_zip.txt @@ -6,7 +6,7 @@ Author: Charles E. Campbell (remove NOSPAM from Campbell's email first) -Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright* +Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright* The VIM LICENSE (see |copyright|) applies to the files in this package, including zipPlugin.vim, zip.vim, and pi_zip.vim. except use "zip.vim" instead of "VIM". Like anything else that's free, zip.vim @@ -33,6 +33,9 @@ Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright* also write to the file. Currently, one may not make a new file in zip archives via the plugin. + *zip-x* + x : may extract a listed file when the cursor is atop it + OPTIONS *g:zip_nomax* @@ -60,6 +63,11 @@ Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright* It's used during the writing (updating) of a file already in a zip file; by default: > let g:zip_zipcmd= "zip" +< + *g:zip_extractcmd* + This option specifies the program (and any options needed) used to + extract a file from a zip archive. By default, > + let g:zip_extractcmd= g:zip_unzipcmd < PREVENTING LOADING~ @@ -83,8 +91,26 @@ Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright* One can simply extend this line to accommodate additional extensions that should be treated as zip files. + Alternatively, one may change *g:zipPlugin_ext* in one's .vimrc. + Currently (11/30/15) it holds: > + + let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip, + \ *.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm, + \ *.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm, + \ *.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx,*.epub' + ============================================================================== 4. History *zip-history* {{{1 + v28 Oct 08, 2014 * changed the sanity checks for executables to reflect + the command actually to be attempted in zip#Read() + and zip#Write() + * added the extraction of a file capability + Nov 30, 2015 * added *.epub to the |g:zipPlugin_ext| list + Sep 13, 2016 * added *.apk to the |g:zipPlugin_ext| list and + sorted the suffices. + v27 Jul 02, 2013 * sanity check: zipfile must have "PK" as its first + two bytes. + * modified to allow zipfile: entries in quickfix lists v26 Nov 15, 2012 * (Jason Spiro) provided a lot of new extensions that are synonyms for .zip v25 Jun 27, 2011 * using keepj with unzip -Z diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index b34d081ba9..bfe689fb13 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -152,7 +152,7 @@ q Stops recording. :[addr]@: Repeat last command-line. First set cursor at line [addr] (default is current line). - *:@@* +:[addr]@ *:@@* :[addr]@@ Repeat the previous :@{0-9a-z"}. First set cursor at line [addr] (default is current line). diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 14e8c5d76f..f7c47125f1 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -425,7 +425,7 @@ accordingly. Vim proceeds in this order: - The environment variable EXINIT. The value of $EXINIT is used as an Ex command line. - c. If the 'exrc' option is on (which is not the default), the current + c. If the 'exrc' option is on (which is NOT the default), the current directory is searched for three files. The first that exists is used, the others are ignored. - The file ".nvimrc" (for Unix) @@ -1184,6 +1184,9 @@ running) you have additional options: file. This list is read on startup and only changes afterwards with ":rshada!". Also see |v:oldfiles|. The number can be used with |c_#<|. + The output can be filtered with |:filter|, e.g.: > + filter /\.vim/ oldfiles +< The filtering happens on the file name. :bro[wse] o[ldfiles][!] List file names as with |:oldfiles|, and then prompt diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 3b54f9f268..9e4f546f64 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -2656,7 +2656,75 @@ your vimrc: *g:filetype_r* RUBY *ruby.vim* *ft-ruby-syntax* -There are a number of options to the Ruby syntax highlighting. + Ruby: Operator highlighting |ruby_operators| + Ruby: Whitespace errors |ruby_space_errors| + Ruby: Folding |ruby_fold| |ruby_foldable_groups| + Ruby: Reducing expensive operations |ruby_no_expensive| |ruby_minlines| + Ruby: Spellchecking strings |ruby_spellcheck_strings| + + *ruby_operators* + Ruby: Operator highlighting ~ + +Operators can be highlighted by defining "ruby_operators": > + + :let ruby_operators = 1 +< + *ruby_space_errors* + Ruby: Whitespace errors ~ + +Whitespace errors can be highlighted by defining "ruby_space_errors": > + + :let ruby_space_errors = 1 +< +This will highlight trailing whitespace and tabs preceded by a space character +as errors. This can be refined by defining "ruby_no_trail_space_error" and +"ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after +spaces respectively. + + *ruby_fold* *ruby_foldable_groups* + Ruby: Folding ~ + +Folding can be enabled by defining "ruby_fold": > + + :let ruby_fold = 1 +< +This will set the value of 'foldmethod' to "syntax" locally to the current +buffer or window, which will enable syntax-based folding when editing Ruby +filetypes. + +Default folding is rather detailed, i.e., small syntax units like "if", "do", +"%w[]" may create corresponding fold levels. + +You can set "ruby_foldable_groups" to restrict which groups are foldable: > + + :let ruby_foldable_groups = 'if case %' +< +The value is a space-separated list of keywords: + + keyword meaning ~ + -------- ------------------------------------- ~ + ALL Most block syntax (default) + NONE Nothing + if "if" or "unless" block + def "def" block + class "class" block + module "module" block + do "do" block + begin "begin" block + case "case" block + for "for", "while", "until" loops + { Curly bracket block or hash literal + [ Array literal + % Literal with "%" notation, e.g.: %w(STRING), %!STRING! + / Regexp + string String and shell command output (surrounded by ', ", `) + : Symbol + # Multiline comment + << Here documents + __END__ Source code after "__END__" directive + + *ruby_no_expensive* + Ruby: Reducing expensive operations ~ By default, the "end" keyword is colorized according to the opening statement of the block it closes. While useful, this feature can be expensive; if you @@ -2667,6 +2735,8 @@ you may want to turn it off by defining the "ruby_no_expensive" variable: > < In this case the same color will be used for all control keywords. + *ruby_minlines* + If you do want this feature enabled, but notice highlighting errors while scrolling backwards, which are fixed when redrawing with CTRL-L, try setting the "ruby_minlines" variable to a value larger than 50: > @@ -2676,48 +2746,13 @@ the "ruby_minlines" variable to a value larger than 50: > Ideally, this value should be a number of lines large enough to embrace your largest class or module. -Highlighting of special identifiers can be disabled by removing the -rubyIdentifier highlighting: > + *ruby_spellcheck_strings* + Ruby: Spellchecking strings ~ - :hi link rubyIdentifier NONE -< -This will prevent highlighting of special identifiers like "ConstantName", -"$global_var", "@@class_var", "@instance_var", "| block_param |", and -":symbol". +Ruby syntax will perform spellchecking of strings if you define +"ruby_spellcheck_strings": > -Significant methods of Kernel, Module and Object are highlighted by default. -This can be disabled by defining "ruby_no_special_methods": > - - :let ruby_no_special_methods = 1 -< -This will prevent highlighting of important methods such as "require", "attr", -"private", "raise" and "proc". - -Ruby operators can be highlighted. This is enabled by defining -"ruby_operators": > - - :let ruby_operators = 1 -< -Whitespace errors can be highlighted by defining "ruby_space_errors": > - - :let ruby_space_errors = 1 -< -This will highlight trailing whitespace and tabs preceded by a space character -as errors. This can be refined by defining "ruby_no_trail_space_error" and -"ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after -spaces respectively. - -Folding can be enabled by defining "ruby_fold": > - - :let ruby_fold = 1 -< -This will set the 'foldmethod' option to "syntax" and allow folding of -classes, modules, methods, code blocks, heredocs and comments. - -Folding of multiline comments can be disabled by defining -"ruby_no_comment_fold": > - - :let ruby_no_comment_fold = 1 + :let ruby_spellcheck_strings = 1 < SCHEME *scheme.vim* *ft-scheme-syntax* @@ -2815,9 +2850,11 @@ vimrc file: > (Adapted from the html.vim help text by Claudio Fleiner ) -SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* + *ft-posix-synax* *ft-dash-syntax* +SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* -This covers the "normal" Unix (Bourne) sh, bash and the Korn shell. +This covers syntax highlighting for the older Unix (Bourne) sh, and newer +shells such as bash, dash, posix, and the Korn shells. Vim attempts to determine which shell type is in use by specifying that various filenames are of specific types: > @@ -2826,28 +2863,31 @@ various filenames are of specific types: > bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash < If none of these cases pertain, then the first line of the file is examined -(ex. /bin/sh /bin/ksh /bin/bash). If the first line specifies a shelltype, -then that shelltype is used. However some files (ex. .profile) are known to -be shell files but the type is not apparent. Furthermore, on many systems -sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix). +(ex. looking for /bin/sh /bin/ksh /bin/bash). If the first line specifies a +shelltype, then that shelltype is used. However some files (ex. .profile) are +known to be shell files but the type is not apparent. Furthermore, on many +systems sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" +(Posix). -One may specify a global default by instantiating one of the following three +One may specify a global default by instantiating one of the following variables in your vimrc: - ksh: > + ksh: > let g:is_kornshell = 1 -< posix: (using this is the same as setting is_kornshell to 1) > +< posix: (using this is the nearly the same as setting g:is_kornshell to 1) > let g:is_posix = 1 < bash: > let g:is_bash = 1 < sh: (default) Bourne shell > let g:is_sh = 1 +< (dash users should use posix) + If there's no "#! ..." line, and the user hasn't availed himself/herself of a default sh.vim syntax setting as just shown, then syntax/sh.vim will assume the Bourne shell syntax. No need to quote RFCs or market penetration statistics in error reports, please -- just select the default version of the -sh your system uses in your vimrc. +sh your system uses and install the associated "let..." in your <.vimrc>. The syntax/sh.vim file provides several levels of syntax-based folding: > @@ -2856,7 +2896,7 @@ The syntax/sh.vim file provides several levels of syntax-based folding: > let g:sh_fold_enabled= 2 (enable heredoc folding) let g:sh_fold_enabled= 4 (enable if/do/for folding) > -then various syntax items (HereDocuments and function bodies) become +then various syntax items (ie. HereDocuments and function bodies) become syntax-foldable (see |:syn-fold|). You also may add these together to get multiple types of folding: > @@ -2880,14 +2920,7 @@ reduce this, the "sh_maxlines" internal variable can be set. Example: > The default is to use the twice sh_minlines. Set it to a smaller number to speed up displaying. The disadvantage is that highlight errors may appear. - *g:sh_isk* *g:sh_noisk* -The shell languages appear to let "." be part of words, commands, etc; -consequently it should be in the isk for sh.vim. As of v116 of syntax/sh.vim, -syntax/sh.vim will append the "." to |'iskeyword'| by default; you may control -this behavior with: > - let g:sh_isk = '..whatever characters you want as part of iskeyword' - let g:sh_noisk= 1 " otherwise, if this exists, the isk will NOT chg -< + *sh-embed* *sh-awk* Sh: EMBEDDING LANGUAGES~ @@ -3461,8 +3494,8 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword* and also determines where |:syn-keyword| will be checked for a new match. - It is recommended when writing syntax files, to use this command - to the correct value for the specific syntax language and not change + It is recommended when writing syntax files, to use this command to + set the correct value for the specific syntax language and not change the 'iskeyword' option. DEFINING KEYWORDS *:syn-keyword* @@ -3520,7 +3553,11 @@ DEFINING KEYWORDS *:syn-keyword* DEFINING MATCHES *:syn-match* -:sy[ntax] match {group-name} [{options}] [excludenl] {pattern} [{options}] +:sy[ntax] match {group-name} [{options}] + [excludenl] + [keepend] + {pattern} + [{options}] This defines one match. @@ -3529,6 +3566,9 @@ DEFINING MATCHES *:syn-match* [excludenl] Don't make a pattern with the end-of-line "$" extend a containing match or region. Must be given before the pattern. |:syn-excludenl| + keepend Don't allow contained matches to go past a + match with the end pattern. See + |:syn-keepend|. {pattern} The search pattern that defines the match. See |:syn-pattern| below. Note that the pattern may match more than one diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index c299d43927..c9635a9f6f 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -195,6 +195,12 @@ Other commands: :tabs List the tab pages and the windows they contain. Shows a ">" for the current window. Shows a "+" for modified buffers. + For example: + Tab page 1 ~ + + tabpage.txt ~ + ex_docmd.c ~ + Tab page 2 ~ + > main.c ~ REORDERING TAB PAGES: diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index fd81064d5b..1a93a4504f 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -85,6 +85,8 @@ g8 Print the hex values of the bytes used in the on paper see |:hardcopy|. In the GUI you can use the File.Print menu entry. See |ex-flags| for [flags]. + The |:filter| command can be used to only show lines + matching a pattern. :[range]p[rint] {count} [flags] Print {count} lines, starting with [range] (default @@ -367,7 +369,7 @@ N *+statusline* Options 'statusline', 'rulerformat' and special formats of 'titlestring' and 'iconstring' N *+syntax* Syntax highlighting |syntax| N *+tablineat* 'tabline' option recognizing %@Func@ items. -N *+tag_binary* binary searching in tags file |tag-binary-search| +T *+tag_binary* binary searching in tags file |tag-binary-search| N *+tag_old_static* old method for static tags |tag-old-static| m *+tag_any_white* any white space allowed in tags file |tag-any-white| B *+termguicolors* 24-bit color in xterm-compatible terminals support @@ -461,6 +463,29 @@ m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support| :redi[r] END End redirecting messages. + *:filt* *:filter* +:filt[er][!] {pat} {command} +:filt[er][!] /{pat}/ {command} + Restrict the output of {command} to lines matching + with {pat}. For example, to list only xml files: > + :filter /\.xml$/ oldfiles +< If the [!] is given, restrict the output of {command} + to lines that do NOT match {pat}. + + {pat} is a Vim search pattern. Instead of enclosing + it in / any non-ID character (see |'isident'|) can be + used, so long as it does not appear in {pat}. Without + the enclosing character the pattern cannot include the + bar character. + + The pattern is matched against the relevant part of + the output, not necessarily the whole line. Only some + commands support filtering, try it out to check if it + works. + + Only normal messages are filtered, error messages are + not. + *:sil* *:silent* *:silent!* :sil[ent][!] {command} Execute {command} silently. Normal messages will not be given or added to the message history. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 43155aa27e..a909debf97 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2016 Aug 26 +" Last Change: 2016 Sep 22 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -672,6 +672,9 @@ au BufNewFile,BufRead *.dts,*.dtsi setf dts " EDIF (*.edf,*.edif,*.edn,*.edo) au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif +" EditorConfig (close enough to dosini) +au BufNewFile,BufRead .editorconfig setf dosini + " Embedix Component Description au BufNewFile,BufRead *.ecd setf ecd @@ -802,6 +805,10 @@ au BufNewFile,BufRead *.gp,.gprc setf gp au BufNewFile,BufRead */.gnupg/options setf gpg au BufNewFile,BufRead */.gnupg/gpg.conf setf gpg au BufNewFile,BufRead */usr/*/gnupg/options.skel setf gpg +if !empty($GNUPGHOME) + au BufNewFile,BufRead $GNUPGHOME/options setf gpg + au BufNewFile,BufRead $GNUPGHOME/gpg.conf setf gpg +endif " gnash(1) configuration files au BufNewFile,BufRead gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc setf gnash diff --git a/runtime/ftplugin/cucumber.vim b/runtime/ftplugin/cucumber.vim index 2ec1a5976f..f4848d1c60 100644 --- a/runtime/ftplugin/cucumber.vim +++ b/runtime/ftplugin/cucumber.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Cucumber " Maintainer: Tim Pope -" Last Change: 2013 Jun 01 +" Last Change: 2016 Aug 29 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) @@ -19,27 +19,23 @@ setlocal omnifunc=CucumberComplete let b:undo_ftplugin = "setl fo< com< cms< ofu<" let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??') +if !exists("b:cucumber_steps_glob") + let b:cucumber_steps_glob = b:cucumber_root.'/**/*.rb' +endif if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps") - nnoremap :exe jump('edit',v:count) - nnoremap [ :exe jump('edit',v:count) - nnoremap ] :exe jump('edit',v:count) - nnoremap ] :exe jump('split',v:count) - nnoremap :exe jump('split',v:count) - nnoremap d :exe jump('split',v:count) - nnoremap :exe jump('split',v:count) - nnoremap } :exe jump('pedit',v:count) - nnoremap [d :exe jump('pedit',v:count) - nnoremap ]d :exe jump('pedit',v:count) + cnoremap foldopen if &foldopen =~# 'tag'exe 'norm! zv'endif + nnoremap