From 1e01546026ce909b5fe56c05867f28e77d1b6eb3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 25 Sep 2005 22:16:38 +0000 Subject: updated for version 7.0150 --- runtime/autoload/csscomplete.vim | 39 +- runtime/autoload/htmlcomplete.vim | 150 +++++-- runtime/autoload/netrw.vim | 250 ++++------- runtime/compiler/eruby.vim | 21 +- runtime/doc/diff.txt | 6 +- runtime/doc/eval.txt | 45 +- runtime/doc/insert.txt | 31 +- runtime/doc/map.txt | 13 +- runtime/doc/message.txt | 8 +- runtime/doc/options.txt | 13 +- runtime/doc/pi_netrw.txt | 303 ++++++------- runtime/doc/spell.txt | 6 +- runtime/doc/tags | 13 +- runtime/filetype.vim | 6 +- runtime/indent/eruby.vim | 20 + runtime/indent/php.vim | 918 +++++++++++++++++++------------------- runtime/indent/ruby.vim | 15 +- runtime/indent/sml.vim | 215 +++++++++ runtime/plugin/NetrwPlugin.vim | 16 +- runtime/plugin/NetrwSettings.vim | 4 +- runtime/spell/en.ascii.spl | Bin 566661 -> 566695 bytes runtime/spell/en.latin1.spl | Bin 568765 -> 568799 bytes runtime/spell/en.utf-8.spl | Bin 569196 -> 569230 bytes runtime/syntax/ruby.vim | 14 +- 24 files changed, 1185 insertions(+), 921 deletions(-) create mode 100644 runtime/indent/eruby.vim create mode 100644 runtime/indent/sml.vim (limited to 'runtime') diff --git a/runtime/autoload/csscomplete.vim b/runtime/autoload/csscomplete.vim index 8ac3600611..9461f39b8f 100644 --- a/runtime/autoload/csscomplete.vim +++ b/runtime/autoload/csscomplete.vim @@ -1,7 +1,7 @@ " Vim completion script " Language: CSS 2.1 " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2005 Sep 19 +" Last Change: 2005 Sep 23 function! csscomplete#CompleteCSS(findstart, base) if a:findstart @@ -18,6 +18,8 @@ else " 3. if } we are outside of css definitions " 4. for comments ignoring is be the easiest but assume they are the same " as 1. + " 5. if @ complete at-rule + " 6. if ! complete important let line = a:base let res = [] @@ -26,14 +28,16 @@ else " We need the last occurrence of char so reverse line let revline = join(reverse(split(line, '.\zs')), '') + let openbrace = stridx(revline, '{') let closebrace = stridx(revline, '}') - let colon = stridx(revline, ':') - let semicolon = stridx(revline, ';') - let opencomm = stridx(revline, '*/') " Line was reversed - let closecomm = stridx(revline, '/*') " Line was reversed - let style = stridx(revline, '=\s*elyts') " Line was reversed - let atrule = stridx(revline, '@') + let colon = stridx(revline, ':') + let semicolon = stridx(revline, ';') + let opencomm = stridx(revline, '*/') " Line was reversed + let closecomm = stridx(revline, '/*') " Line was reversed + let style = stridx(revline, '=\s*elyts') " Line was reversed + let atrule = stridx(revline, '@') + let exclam = stridx(revline, '!') if openbrace > -1 let borders[openbrace] = "openbrace" @@ -59,6 +63,9 @@ else if atrule > -1 let borders[atrule] = "atrule" endif + if exclam > -1 + let borders[exclam] = "exclam" + endif if len(borders) == 0 || borders[min(keys(borders))] =~ '^\(openbrace\|semicolon\|opencomm\|closecomm\|style\)$' " Complete properties @@ -318,6 +325,22 @@ else return [] + elseif borders[min(keys(borders))] == 'exclam' + + " Complete values + let impbase = matchstr(line, '.\{-}!\s*\ze[a-zA-Z ]*$') + let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$') + + let values = ["important"] + + for m in values + if m =~? '^'.entered_imp + call add(res, impbase . m) + endif + endfor + + return res + elseif borders[min(keys(borders))] == 'atrule' let afterat = matchstr(line, '.*@\zs.*') @@ -368,7 +391,7 @@ else endif - let values = ["charset", "page", "media", "import"] + let values = ["charset", "page", "media", "import", "font-face"] let atrulebase = matchstr(line, '.*@\ze[a-zA-Z -]*$') let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$') diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim index ab50952435..9dd5830a12 100644 --- a/runtime/autoload/htmlcomplete.vim +++ b/runtime/autoload/htmlcomplete.vim @@ -1,7 +1,7 @@ " Vim completion script " Language: XHTML 1.0 Strict " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2005 Sep 19 +" Last Change: 2005 Sep 23 function! htmlcomplete#CompleteTags(findstart, base) if a:findstart @@ -66,8 +66,13 @@ function! htmlcomplete#CompleteTags(findstart, base) " it possible? " Also retrieving class names from current file and linked " stylesheets. - if a:base =~ "\\(on[a-z]*\\|style\\|class\\)\\s*=\\s*[\"']" - if a:base =~ "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$" + if a:base =~ "\\(on[a-z]*\\|id\\|style\\|class\\)\\s*=\\s*[\"']" + if a:base =~ "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$" + if a:base =~ "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$" + let search_for = "class" + elseif a:base =~ "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$" + let search_for = "id" + endif " Handle class name completion " 1. Find lines of " 1a. Check file for @import @@ -76,9 +81,22 @@ function! htmlcomplete#CompleteTags(findstart, base) let head = getline(search(''), search('<\/head>')) let headjoined = join(copy(head), ' ') if headjoined =~ '\*[', ' ', 'g') - let styleheadlines = split(stylehead) - let headclasslines = filter(copy(styleheadlines), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'") + let stylehead = substitute(headjoined, '+>\*[,', ' ', 'g') + if search_for == 'class' + let styleheadlines = split(stylehead) + let headclasslines = filter(copy(styleheadlines), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'") + else + let stylesheet = split(headjoined, '[{}]') + " Get all lines which fit id syntax + let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'") + " Filter out possible color definitions + call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'") + " Filter out complex border definitions + call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'") + let templines = join(classlines, ' ') + let headclasslines = split(templines) + call filter(headclasslines, "v:val =~ '#[a-zA-Z0-9_-]\\+'") + endif let internal = 1 else let internal = 0 @@ -93,13 +111,15 @@ function! htmlcomplete#CompleteTags(findstart, base) let styletable += [matchstr(line, "href\\s*=\\s*[\"']\\zs\\f\\+\\ze")] endif endfor - for file in filestable + for file in styletable if filereadable(file) let stylesheet = readfile(file) let secimport = filter(copy(stylesheet), "v:val =~ '@import'") if len(secimport) > 0 for line in secimport - let secimportfiles += [matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")] + let secfile = matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze") + let secfile = fnamemodify(file, ":p:h").'/'.secfile + let secimportfiles += [secfile] endfor endif endif @@ -109,10 +129,24 @@ function! htmlcomplete#CompleteTags(findstart, base) for file in cssfiles if filereadable(file) let stylesheet = readfile(file) - let stylefile = join(stylesheet) - let stylefile = substitute(stylefile, '+>\*[', ' ', 'g') - let stylesheet = split(stylefile) - let classlines = filter(copy(stylesheet), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'") + let stylefile = join(stylesheet, ' ') + let stylefile = substitute(stylefile, '+>\*[,', ' ', 'g') + if search_for == 'class' + let stylesheet = split(stylefile) + let classlines = filter(copy(stylesheet), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'") + else + let stylesheet = split(stylefile, '[{}]') + " Get all lines which fit id syntax + let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'") + " Filter out possible color definitions + call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'") + " Filter out complex border definitions + call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'") + let templines = join(classlines, ' ') + let stylelines = split(templines) + let classlines = filter(stylelines, "v:val =~ '#[a-zA-Z0-9_-]\\+'") + + endif endif " We gathered classes definitions from all external files let classes += classlines @@ -120,43 +154,71 @@ function! htmlcomplete#CompleteTags(findstart, base) if internal == 1 let classes += headclasslines endif - let elements = {} - for element in classes - if element =~ '^\.' - let class = matchstr(element, '^\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze') - let class = substitute(class, ':.*', '', '') - if has_key(elements, "common") - let elements["common"] .= " ".class - else - let elements["common"] = class - endif - else - let class = matchstr(element, '[a-zA-Z1-6]*\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze') - let tagname = tolower(matchstr(element, '[a-zA-Z1-6]*\ze.')) - if tagname != '' - if has_key(elements, tagname) - let elements[tagname] .= " ".class + + if search_for == 'class' + let elements = {} + for element in classes + if element =~ '^\.' + let class = matchstr(element, '^\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze') + let class = substitute(class, ':.*', '', '') + if has_key(elements, 'common') + let elements['common'] .= ' '.class else - let elements[tagname] = class + let elements['common'] = class + endif + else + let class = matchstr(element, '[a-zA-Z1-6]*\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze') + let tagname = tolower(matchstr(element, '[a-zA-Z1-6]*\ze.')) + if tagname != '' + if has_key(elements, tagname) + let elements[tagname] .= ' '.class + else + let elements[tagname] = class + endif endif endif + endfor + + if has_key(elements, tag) && has_key(elements, 'common') + let values = split(elements[tag]." ".elements['common']) + elseif has_key(elements, tag) && !has_key(elements, 'common') + let values = split(elements[tag]) + elseif !has_key(elements, tag) && has_key(elements, 'common') + let values = split(elements['common']) + else + return [] endif - endfor - if has_key(elements, tag) && has_key(elements, "common") - let values = split(elements[tag]." ".elements["common"]) - elseif has_key(elements, tag) && !has_key(elements, "common") - let values = split(elements[tag]) - elseif !has_key(elements, tag) && has_key(elements, "common") - let values = split(elements["common"]) - else - return [] + elseif search_for == 'id' + " Find used IDs + " 1. Catch whole file + let filelines = getline(1, line('$')) + " 2. Find lines with possible id + let used_id_lines = filter(filelines, 'v:val =~ "id\\s*=\\s*[\"''][a-zA-Z0-9_-]\\+"') + " 3a. Join all filtered lines + let id_string = join(used_id_lines, ' ') + " 3b. And split them to be sure each id is in separate item + let id_list = split(id_string, 'id\s*=\s*') + " 4. Extract id values + let used_id = map(id_list, 'matchstr(v:val, "[\"'']\\zs[a-zA-Z0-9_-]\\+\\ze")') + let joined_used_id = ','.join(used_id, ',').',' + + let allvalues = map(classes, 'matchstr(v:val, ".*#\\zs[a-zA-Z0-9_-]\\+")') + + let values = [] + + for element in classes + if joined_used_id !~ ','.element.',' + let values += [element] + endif + + endfor + endif " We need special version of sbase let classbase = matchstr(a:base, ".*[\"']") - let classquote = matchstr(classbase, '.$') - + let classquote = matchstr(classbase, '.$') let entered_class = matchstr(attr, ".*=\\s*[\"']\\zs.*") @@ -229,6 +291,10 @@ function! htmlcomplete#CompleteTags(findstart, base) let values = ["text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button"] elseif a:base =~ '^button' let values = ["button", "submit", "reset"] + elseif a:base =~ '^style' + let values = ["text/css"] + elseif a:base =~ '^script' + let values = ["text/javascript"] endif else return [] @@ -313,11 +379,11 @@ function! htmlcomplete#CompleteTags(findstart, base) elseif tag == 'q' let attrs = coreattrs + ["cite"] elseif tag == 'script' - let attrs = ["id", "charset", "type", "src", "defer", "xml:space"] + let attrs = ["id", "charset", "type=\"text/javascript\"", "type", "src", "defer", "xml:space"] elseif tag == 'select' let attrs = coreattrs + ["name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange"] elseif tag == 'style' - let attrs = coreattrs + ["id", "type", "media", "title", "xml:space"] + let attrs = coreattrs + ["id", "type=\"text/css\"", "type", "media", "title", "xml:space"] elseif tag == 'table' let attrs = coreattrs + ["summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding"] elseif tag =~ '^\(thead\|tfoot\|tbody\|tr\)$' diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index c7434af9b5..10dd28542d 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,6 @@ " netrw.vim: Handles file transfer and remote directory listing across a network " AUTOLOAD PORTION -" Date: Sep 12, 2005 -" Version: 70 +" Last Change: Aug 29, 2005 " Maintainer: Charles E Campbell, Jr " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 @@ -17,19 +16,13 @@ " But be doers of the Word, and not only hearers, deluding your own selves {{{1 " (James 1:22 RSV) " =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -" Exception for &cp: {{{1 -if &cp - finish -endif +let s:keepcpo= &cpo +set cpo&vim +" call Decho("doing autoload/netrw.vim") if v:version < 700 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None finish endif -let g:loaded_netrw = "v70" -let s:keepcpo = &cpo -set cpo&vim -" call Decho("doing autoload/netrw.vim") " --------------------------------------------------------------------- " Default values for global netrw variables {{{1 @@ -1133,7 +1126,7 @@ fun! s:NetBrowse(dirname) " call Decho("new path<".path.">") " remote-read the requested file into current buffer - keepjumps keepalt enew! + enew! set ma " call Decho("exe file .method."://".user.machine."/".escape(path,s:netrw_cd_escape)) exe "file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape) @@ -1143,7 +1136,7 @@ fun! s:NetBrowse(dirname) keepjumps 1d " save certain window-oriented variables into buffer-oriented variables - call s:SetBufWinVars() + call s:BufWinVars() call s:NetOptionRestore() setlocal nomod @@ -1169,7 +1162,7 @@ fun! s:NetBrowse(dirname) endif else " call Decho("generate a new buffer") - keepjumps keepalt enew! + enew! endif " rename file to reflect where its from @@ -1207,7 +1200,7 @@ fun! s:NetBrowse(dirname) nnoremap U :call NetBookmarkDir(5,expand("%")) nnoremap v :call NetSplit(1) nnoremap x :call NetBrowseX(NetBrowseChgDir(expand("%"),NetGetWord()),1) - nnoremap <2-leftmouse> :call NetBrowse(NetBrowseChgDir(expand("%"),NetGetWord())) + nnoremap <2-leftmouse> :call NetBrowse(NetBrowseChgDir(expand("%"),NetGetWord())) exe 'nnoremap :call NetBrowseRm("'.user.machine.'","'.path.'")' exe 'vnoremap :call NetBrowseRm("'.user.machine.'","'.path.'")' exe 'nnoremap d :call NetMakeDir("'.user.machine.'")' @@ -1267,7 +1260,6 @@ fun! s:NetBrowse(dirname) if g:netrw_ftp_browse_reject != "" exe "silent! g/".g:netrw_ftp_browse_reject."/keepjumps d" endif - silent! keepjumps %s/\r$//e " if there's no ../ listed, then put ./ and ../ in let line1= line(".") @@ -1282,9 +1274,9 @@ fun! s:NetBrowse(dirname) keepjumps norm! 0 " more cleanup - exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e' - exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e' - exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e' + exe 'keepjumps silent! '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e' + exe "keepjumps silent! ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e' + exe "keepjumps silent! ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e' endif else @@ -1341,33 +1333,33 @@ fun! s:NetBrowse(dirname) keepjumps norm! 0 endif - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/ -> .*$//e' - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e' - exe 'silent keepjumps '.w:netrw_bannercnt + exe 'keepjumps silent '.w:netrw_bannercnt.',$s/ -> .*$//e' + exe 'keepjumps silent '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e' + exe w:netrw_bannercnt endif if line("$") >= w:netrw_bannercnt if g:netrw_sort_by =~ "^n" call s:SetSort() if g:netrw_sort_direction =~ 'n' - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort' + exe 'keepjumps silent '.w:netrw_bannercnt.',$sort' else - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!' + exe 'keepjumps silent '.w:netrw_bannercnt.',$sort!' endif - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{3}\///e' + exe 'keepjumps silent '.w:netrw_bannercnt.',$s/^\d\{3}\///e' endif if w:netrw_longlist == 1 " shorten the list to keep its width <= winwidth characters - exe "silent keepjumps ".w:netrw_bannercnt.',$s/\t[-dstrwx]\+/\t/e' + exe "keepjumps silent ".w:netrw_bannercnt.',$s/\t[-dstrwx]\+/\t/e' endif endif endif + " cleanup any windows mess at end-of-line + keepjumps silent! %s/\r$//e call s:NetrwWideListing() if line("$") >= w:netrw_bannercnt - " place cursor on the top-left corner of the file listing exe "keepjumps ".w:netrw_bannercnt - norm! 0 endif call s:NetOptionRestore() @@ -1457,7 +1449,7 @@ fun! s:NetGetWord() let s:netrw_skipbrowse= 1 echo 'Pressing "a" also works' elseif line("$") > w:netrw_bannercnt - exe 'silent keepjumps '.w:netrw_bannercnt + exe w:netrw_bannercnt endif elseif w:netrw_longlist == 0 @@ -1698,7 +1690,7 @@ fun! s:NetBrowseX(fname,remote) " create a local copy let fname= tempname().".".exten " call Decho("create a local copy of <".a:fname."> as <".fname.">") - exe "silent keepjumps bot 1new ".a:fname + exe "keepjumps silent bot 1new ".a:fname set bh=delete exe "w! ".fname q @@ -1823,14 +1815,14 @@ fun! s:NetBrowseFtpCmd(path,cmd) " cleanup for Windows if has("win32") || has("win95") || has("win64") || has("win16") - silent! keepjumps! %s/\r$//e + keepjumps silent!! %s/\r$//e endif if a:cmd == "dir" " infer directory/link based on the file permission string - silent! keepjumps g/d\%([-r][-w][-x]\)\{3}/s@$@/@ - silent! keepjumps g/l\%([-r][-w][-x]\)\{3}/s/$/@/ + keepjumps silent! g/d\%([-r][-w][-x]\)\{3}/s@$@/@ + keepjumps silent! g/l\%([-r][-w][-x]\)\{3}/s/$/@/ if w:netrw_longlist == 0 || w:netrw_longlist == 2 - exe "silent! keepjumps ".curline.',$s/^\%(\S\+\s\+\)\{8}//e' + exe "keepjumps silent! ".curline.',$s/^\%(\S\+\s\+\)\{8}//e' endif endif @@ -1868,9 +1860,9 @@ fun! s:NetrwListHide() " Prune the list by hiding any files which match " call Decho("pruning <".hide."> listhide<".listhide.">") if g:netrw_hide == 1 - exe 'silent keepjumps '.w:netrw_bannercnt.',$g~'.hide.'~d' + exe 'keepjumps silent '.w:netrw_bannercnt.',$g~'.hide.'~d' elseif g:netrw_hide == 2 - exe 'silent keepjumps '.w:netrw_bannercnt.',$v~'.hide.'~d' + exe 'keepjumps silent '.w:netrw_bannercnt.',$v~'.hide.'~d' endif endwhile @@ -2004,7 +1996,7 @@ fun! s:NetrwWideListing() exe "silent keepjumps norm! 0\".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p' endif exe "silent keepjumps ".newcolstart.','.newcolend.'d' - exe 'silent keepjumps '.w:netrw_bannercnt + exe w:netrw_bannercnt endwhile exe "silent keepjumps ".w:netrw_bannercnt.',$s/\s\+$//e' set noma nomod @@ -2138,7 +2130,7 @@ fun! s:NetBookmarkDir(chg,curdir) if exists("w:netrw_bannercnt") && line(".") <= w:netrw_bannercnt " looks like a "b" was pressed while in the banner region if line("$") > w:netrw_bannercnt - exe 'silent keepjumps '.w:netrw_bannercnt + exe w:netrw_bannercnt endif echo "" " call Dret("NetBookmarkDir - ignoring") @@ -2237,10 +2229,12 @@ endfun " --------------------------------------------------------------------- " NetObtain: obtain file under cursor (for remote browsing support) {{{2 fun! s:NetObtain() + if !exists("s:netrw_users_stl") + let s:netrw_users_stl= &stl + endif let fname= expand("") - - " NetrwStatusLine support - for obtaining support - call s:SetupNetrwStatusLine('%f %h%m%r%=%9*Obtaining '.fname) + exe 'set stl=%f\ %h%m%r%=Obtaining\ '.escape(fname,' ') + redraw! " call Dfunc("NetObtain() method=".w:netrw_method) if exists("w:netrw_method") && w:netrw_method =~ '[235]' @@ -2318,8 +2312,6 @@ fun! s:NetObtain() echohl Error | echo "***netrw*** this system doesn't support ftp" | echohl None call inputsave()|call input("Press to continue")|call inputrestore() endif - let &stl = s:netrw_users_stl - let &laststatus = s:netrw_users_ls " call Dret("NetObtain") return endif @@ -2343,8 +2335,7 @@ fun! s:NetObtain() endif " restore status line - let &stl = s:netrw_users_stl - let &laststatus = s:netrw_users_ls + let &stl= s:netrw_users_stl redraw! " call Dret("NetObtain") @@ -2413,7 +2404,7 @@ fun! netrw#DirBrowse(dirname) " get cleared buffer if bufnum < 0 || !bufexists(bufnum) - keepjumps keepalt enew! + keepalt enew! " call Decho("enew buffer") else exe "keepalt b ".bufnum @@ -2505,7 +2496,7 @@ fun! netrw#DirBrowse(dirname) nnoremap U :call NetBookmarkDir(5,expand("%")) nnoremap v :call NetSplit(3) nnoremap x :call NetBrowseX(LocalBrowseChgDir(b:netrw_curdir,NetGetWord(),0),0)" - nnoremap <2-leftmouse> :call LocalBrowse(LocalBrowseChgDir(b:netrw_curdir,NetGetWord())) + nnoremap <2-leftmouse> :exe "call LocalRefresh(LocalBrowseChgDir(b:netrw_curdir,NetGetWord()))" nnoremap :Pexplore nnoremap :Nexplore exe 'nnoremap :call LocalBrowseRm("'.b:netrw_curdir.'")' @@ -2583,19 +2574,19 @@ fun! netrw#DirBrowse(dirname) call s:SetSort() if g:netrw_sort_direction =~ 'n' - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort' + exe 'keepjumps silent '.w:netrw_bannercnt.',$sort' else - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!' + exe 'keepjumps silent '.w:netrw_bannercnt.',$sort!' endif - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{3}\///e' + exe 'keepjumps silent '.w:netrw_bannercnt.',$s/^\d\{3}\///e' else if g:netrw_sort_direction =~ 'n' - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort' + exe 'keepjumps silent '.w:netrw_bannercnt.',$sort' else - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!' + exe 'keepjumps silent '.w:netrw_bannercnt.',$sort!' endif - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{-}\///e' + exe 'keepjumps silent '.w:netrw_bannercnt.',$s/^\d\{-}\///e' endif endif @@ -2603,16 +2594,14 @@ fun! netrw#DirBrowse(dirname) call s:NetrwWideListing() if exists("w:netrw_bannercnt") && line("$") > w:netrw_bannercnt - " place cursor on the top-left corner of the file listing - exe 'silent '.w:netrw_bannercnt - norm! 0 + exe w:netrw_bannercnt endif " record previous current directory let w:netrw_prvdir= b:netrw_curdir " save certain window-oriented variables into buffer-oriented variables - call s:SetBufWinVars() + call s:BufWinVars() call s:NetOptionRestore() setlocal noma nomod nonu bh=hide nobl @@ -2712,7 +2701,7 @@ fun! s:LocalBrowseList() endwhile " cleanup any windows mess at end-of-line - silent! keepjumps %s/\r$//e + keepjumps silent! %s/\r$//e setlocal ts=32 " call Dret("LocalBrowseList") @@ -3043,8 +3032,12 @@ fun! netrw#Explore(indx,dosplit,style,...) endif endif - " NetrwStatusLine support - for exploring support + " NetrwStatusLine support let w:netrw_explore_indx= indx + if !exists("s:netrw_users_stl") + let s:netrw_users_stl= &stl + endif + set stl=%f\ %h%m%r%=%{NetrwStatusLine()} " call Decho("explorelist<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen) " sanity check @@ -3057,21 +3050,15 @@ fun! netrw#Explore(indx,dosplit,style,...) endif exe "let dirfile= w:netrw_explore_list[".indx."]" -" call Decho("dirfile=w:netrw_explore_list[indx=".indx."]= <".dirfile.">") +" call Decho("dirfile<".dirfile."> indx=".indx) let newdir= substitute(dirfile,'/[^/]*$','','e') " call Decho("newdir<".newdir.">") - " call Decho("calling LocalBrowse(newdir<".newdir.">)") call s:LocalBrowse(newdir) - if w:netrw_longlist == 0 || w:netrw_longlist == 1 - call search('^'.substitute(dirfile,"^.*/","","").'\>',"W") - else - call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w") - endif + call search(substitute(dirfile,"^.*/","",""),"W") let w:netrw_explore_mtchcnt = indx + 1 let w:netrw_explore_bufnr = bufnr(".") let w:netrw_explore_line = line(".") - call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}') " call Decho("explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line) else @@ -3090,74 +3077,13 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Dret("Explore") endfun -" --------------------------------------------------------------------- -" SetupNetrwStatusLine: {{{2 -fun! s:SetupNetrwStatusLine(statline) -" call Dfunc("SetupNetrwStatusLine(statline<".a:statline.">)") - - if !exists("s:netrw_setup_statline") - let s:netrw_setup_statline= 1 -" call Decho("do first-time status line setup") - - if !exists("s:netrw_users_stl") - let s:netrw_users_stl= &stl - endif - if !exists("s:netrw_users_ls") - let s:netrw_users_ls= &laststatus - endif - - " set up User9 highlighting as needed - let keepa= @a - redir @a - try - hi User9 - catch /^Vim\%((\a\+)\)\=:E411/ - if &bg == "dark" - hi User9 ctermfg=yellow ctermbg=blue guifg=yellow guibg=blue - else - hi User9 ctermbg=yellow ctermfg=blue guibg=yellow guifg=blue - endif - endtry - redir END - let @a= keepa - endif - - " set up status line (may use User9 highlighting) - " insure that windows have a statusline - " make sure statusline is displayed - let &stl=a:statline - set laststatus=2 -" call Decho("stl=".&stl) - redraw! - -" call Dret("SetupNetrwStatusLine : stl=".&stl) -endfun - " --------------------------------------------------------------------- " NetrwStatusLine: {{{2 fun! NetrwStatusLine() - - " vvv NetrwStatusLine() debugging vvv -" let g:stlmsg="" -" if !exists("w:netrw_explore_bufnr") -" let g:stlmsg="!X" -" elseif w:netrw_explore_bufnr != bufnr(".") -" let g:stlmsg="explore_bufnr!=".bufnr(".") -" endif -" if !exists("w:netrw_explore_line") -" let g:stlmsg=" !X" -" elseif w:netrw_explore_line != line(".") -" let g:stlmsg=" explore_line!={line(.)<".line(".").">" -" endif -" if !exists("w:netrw_explore_list") -" let g:stlmsg=" !X" -" endif - " ^^^ NetrwStatusLine() debugging ^^^ - +" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr(".")." Xline#".w:netrw_explore_line." line#".line(".") if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr(".") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") " restore user's status line - let &stl = s:netrw_users_stl - let &laststatus = s:netrw_users_ls + let &stl= s:netrw_users_stl if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif return "" @@ -3410,12 +3336,6 @@ fun! NetUserPass(...) " call Decho("a:0=".a:0." case >1: a:2<".a:2.">") let g:netrw_passwd=a:2 endif - - " surround password with double-quotes if it contains embedded blanks - if g:netrw_passwd !~ '^"' && g:netrw_passwd =~ ' ' - let g:netrw_passwd= '"'.g:netrw_passwd.'"' - endif - " call Dret("NetUserPass") endfun @@ -3472,21 +3392,22 @@ fun! s:NetOptionRestore() endif unlet w:netoptionsave - if exists("w:aikeep")| let &ai= w:aikeep|endif - if (has("netbeans_intg") || has("sun_workshop")) && exists("w:acdkeep") - let &acd= w:acdkeep - unlet w:acdkeep - endif - if exists("w:cinkeep") |let &cin = w:cinkeep |unlet w:cinkeep |endif - if exists("w:cinokeep")|let &cino = w:cinokeep|unlet w:cinokeep|endif - if exists("w:comkeep") |let &com = w:comkeep |unlet w:comkeep |endif - if exists("w:cpokeep") |let &cpo = w:cpokeep |unlet w:cpokeep |endif - if exists("w:dirkeep") |exe "lcd ".w:dirkeep |unlet w:dirkeep |endif - if exists("w:gdkeep") |let &gd = w:gdkeep |unlet w:gdkeep |endif - if exists("w:repkeep") |let &report = w:repkeep |unlet w:repkeep |endif - if exists("w:twkeep") |let &tw = w:twkeep |unlet w:twkeep |endif + let &ai = w:aikeep + if has("netbeans_intg") || has("sun_workshop") + let &acd = w:acdkeep + endif + let &cin = w:cinkeep + let &cino = w:cinokeep + let &com = w:comkeep + let &cpo = w:cpokeep + if exists("w:dirkeep") + exe "lcd ".w:dirkeep + endif + let &gd = w:gdkeep + let &report = w:repkeep + let &tw = w:twkeep if exists("w:swfkeep") - if &directory == "" && exists("w:swfkeep") + if &directory == "" " user hasn't specified a swapfile directory; " netrw will temporarily make the swapfile " directory the current local one. @@ -3498,6 +3419,17 @@ fun! s:NetOptionRestore() endif unlet w:swfkeep endif + unlet w:aikeep + unlet w:cinkeep + unlet w:cinokeep + unlet w:comkeep + unlet w:cpokeep + unlet w:gdkeep + unlet w:repkeep + unlet w:twkeep + if exists("w:dirkeep") + unlet w:dirkeep + endif " call Dret("NetOptionRestore") endfun @@ -3509,7 +3441,7 @@ endfun " example and as a fix for a Windows 95 problem: in my " experience, win95's ftp always dumped four blank lines " at the end of the transfer. -if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp +if has("win95") && g:netrw_win95ftp fun! NetReadFixup(method, line1, line2) " call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")") if method == 3 " ftp (no <.netrc>) @@ -3610,14 +3542,14 @@ fun! s:SetSort() return endif if seq == '*' - exe 'silent keepjumps '.w:netrw_bannercnt.',$v/^\d\{3}\//s/^/'.spriority.'/' + exe 'keepjumps silent '.w:netrw_bannercnt.',$v/^\d\{3}\//s/^/'.spriority.'/' else - exe 'silent keepjumps '.w:netrw_bannercnt.',$g/'.eseq.'/s/^/'.spriority.'/' + exe 'keepjumps silent '.w:netrw_bannercnt.',$g/'.eseq.'/s/^/'.spriority.'/' endif let priority = priority + 1 endwhile - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{3}\/\)\%(\d\{3}\/\)\+/\1/e' + exe 'keepjumps silent '.w:netrw_bannercnt.',$s/^\(\d\{3}\/\)\%(\d\{3}\/\)\+/\1/e' " call Dret("SetSort") endfun @@ -3655,14 +3587,14 @@ fun! s:CopyWinVars() endfun " --------------------------------------------------------------------- -" SetBufWinVars: (used by NetBrowse() and LocalBrowse()) {{{1 +" BufWinVars: (used by NetBrowse() and LocalBrowse()) {{{1 " To allow separate windows to have their own activities, such as " Explore **/pattern, several variables have been made window-oriented. " However, when the user splits a browser window (ex: ctrl-w s), these -" variables are not inherited by the new window. SetBufWinVars() and +" variables are not inherited by the new window. BufWinVars() and " UseBufWinVars() get around that. -fun! s:SetBufWinVars() -" call Dfunc("SetBufWinVars()") +fun! s:BufWinVars() +" call Dfunc("BufWinVars()") if exists("w:netrw_longlist") |let b:netrw_longlist = w:netrw_longlist |endif if exists("w:netrw_bannercnt") |let b:netrw_bannercnt = w:netrw_bannercnt |endif if exists("w:netrw_method") |let b:netrw_method = w:netrw_method |endif @@ -3673,7 +3605,7 @@ fun! s:SetBufWinVars() if exists("w:netrw_explore_bufnr") |let b:netrw_explore_bufnr = w:netrw_explore_bufnr |endif if exists("w:netrw_explore_line") |let b:netrw_explore_line = w:netrw_explore_line |endif if exists("w:netrw_explore_list") |let b:netrw_explore_list = w:netrw_explore_list |endif -" call Dret("SetBufWinVars") +" call Dret("BufWinVars") endfun " --------------------------------------------------------------------- diff --git a/runtime/compiler/eruby.vim b/runtime/compiler/eruby.vim index 5d85bf14f2..77292bce13 100644 --- a/runtime/compiler/eruby.vim +++ b/runtime/compiler/eruby.vim @@ -24,13 +24,22 @@ endif let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=eruby +if exists("eruby_compiler") && eruby_compiler == "eruby" + CompilerSet makeprg=eruby +else + CompilerSet makeprg=erb +endif -CompilerSet errorformat=eruby:\ %f:%l:%m, - \%E%f:%l:\ %m, - \%-Z%p^, - \%C%m, - \%-G%.%# +CompilerSet errorformat= + \eruby:\ %f:%l:%m, + \%+E%f:%l:\ parse\ error, + \%W%f:%l:\ warning:\ %m, + \%E%f:%l:in\ %*[^:]:\ %m, + \%E%f:%l:\ %m, + \%-C%\tfrom\ %f:%l:in\ %.%#, + \%-Z%\tfrom\ %f:%l, + \%-Z%p^, + \%-G%.%# let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 7d6383126a..fdd820f84e 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -1,4 +1,4 @@ -*diff.txt* For Vim version 7.0aa. Last change: 2005 Apr 26 +*diff.txt* For Vim version 7.0aa. Last change: 2005 Sep 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -218,7 +218,7 @@ It is an error if there is no change for the cursor to move to. ============================================================================== 4. Diff copying *copy-diffs* *E99* *E100* *E101* *E102* *E103* - + *merge* There are two commands to copy text from one buffer to another. The result is that the buffers will be equal within the specified range. @@ -235,6 +235,8 @@ that the buffers will be equal within the specified range. Modify another buffer to undo difference with the current buffer. Just like ":diffget" but the other buffer is modified instead of the current one. + When [bufspec] is omitted and there is more than one other + buffer in diff mode where 'modifiable' is set this fails. See below for [range]. *do* diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index ed6ee899ac..6c32f1653e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0aa. Last change: 2005 Sep 20 +*eval.txt* For Vim version 7.0aa. Last change: 2005 Sep 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2547,11 +2547,12 @@ getcmdpos() *getcmdpos()* getcmdtype() *getcmdtype()* Return the current command-line type. Possible return values are: - / Search forward command - ? Search backward command - : Ex-command mode - @ Input mode - > Debug mode + : normal Ex command + > debug mode command |debug-mode| + / forward search command + ? backward search command + @ |input()| command + - |:insert| or |:append| command Only works when editing the command line, thus requires use of |c_CTRL-\_e| or |c_CTRL-R_=|. Returns an empty string otherwise. @@ -2939,8 +2940,8 @@ input({prompt} [, {text} [, {completion}]]) *input()* : echo "Cheers!" :endif < - If the optional {text} is present, this is used for the - default reply, as if the user typed this. Example: > + If the optional {text} is present and not empty, this is used + for the default reply, as if the user typed this. Example: > :let color = input("Color? ", "white") < The optional {completion} argument specifies the type of @@ -4049,10 +4050,30 @@ soundfold({word}) the method can be quite slow. *spellbadword()* -spellbadword() Return the badly spelled word under or after the cursor. - The cursor is moved to the start of the bad word. - When no bad word is found in the cursor line an empty String - is returned and the cursor doesn't move. +spellbadword([{sentence}]) + Without argument: The result is the badly spelled word under + or after the cursor. The cursor is moved to the start of the + bad word. When no bad word is found in the cursor line the + result is an empty string and the cursor doesn't move. + + With argument: The result is the first word in {sentence} that + is badly spelled. If there are no spelling mistakes the + result is an empty string. + + The return value is a list with two items: + - The badly spelled word or an empty string. + - The type of the spelling error: + "bad" spelling mistake + "rare" rare word + "local" word only valid in another region + "caps" word should start with Capital + Example: > + echo spellbadword("the quik brown fox") +< ['quik', 'bad'] ~ + + The spelling information for the current window is used. The + 'spell' option must be set and the value of 'spelllang' is + used. *spellsuggest()* spellsuggest({word} [, {max}]) diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 30fe2d4f1f..f668c00936 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 7.0aa. Last change: 2005 Sep 18 +*insert.txt* For Vim version 7.0aa. Last change: 2005 Sep 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -988,20 +988,35 @@ are included. (X)HTML *ft-html-omni* -When using after CTRL-X CTRL-O after "<" it is completed with tag name -available in current context. Inside of tag completion aids to choose -proper attributes, and when possible choose appropriate attribute value -including class names for CSS styles. - -When used after " +last open tag with (b:unaryTagsStack has to be defined): > :echo htmlcomplete#GetLastOpenTag("b:unaryTagsStack") +CSS *ft-css-omni* + +Complete properties and their appropriate values according to CSS 2.1 +specification. + + ============================================================================== 8. Insert mode commands *inserting* diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index c33023a75e..618c76712e 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1,4 +1,4 @@ -*map.txt* For Vim version 7.0aa. Last change: 2005 Aug 16 +*map.txt* For Vim version 7.0aa. Last change: 2005 Sep 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -306,11 +306,12 @@ If you type a space, then "foo" will get inserted, plus the space. If you type "a", then "bar" will get inserted. {Vi does not allow ambiguous mappings} - *map_CTRL_C* -It's not possible to use a CTRL-C in the {lhs}. You just can't map CTRL-C. -The reason is that CTRL-C must always be available to break a running command. -Exception: When using the GUI version on MS-Windows CTRL-C can be mapped to -allow a Copy command to the clipboard. Use CTRL-Break to interrupt Vim. + *map_CTRL-C* +Using CTRL-C in the {lhs} is possible, but it will only work when Vim is +waiting for a key, not when Vim is busy with something. When Vim is busy +CTRL-C interrupts/breaks the command. +When using the GUI version on MS-Windows CTRL-C can be mapped to allow a Copy +command to the clipboard. Use CTRL-Break to interrupt Vim. *map_space_in_lhs* To include a space in {lhs} precede it with a CTRL-V (type two CTRL-Vs for diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index a1c18bed99..87429e0302 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -1,4 +1,4 @@ -*message.txt* For Vim version 7.0aa. Last change: 2005 Aug 01 +*message.txt* For Vim version 7.0aa. Last change: 2005 Sep 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -23,7 +23,7 @@ The number of remembered messages is fixed at 20. *g<* The "g<" command can be used to see the last page of previous command output. -This is especially useful if you accidentally typed at the hit-return +This is especially useful if you accidentally typed at the hit-enter prompt. Note: when you stopped the output with "q" at the more prompt only up to that point will be displayed. @@ -813,4 +813,8 @@ Any other key causes the meaning of the keys to be displayed. Note: The typed key is directly obtained from the terminal, it is not mapped and typeahead is ignored. +The |g<| command can be used to see the last page of previous command output. +This is especially useful if you accidentally typed at the hit-enter +prompt. + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 7cc8170438..39a6f40ce6 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.0aa. Last change: 2005 Sep 13 +*options.txt* For Vim version 7.0aa. Last change: 2005 Sep 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3647,9 +3647,11 @@ A jump table for the options with a short description can be found at |Q_op|. Pattern to be used to find an include command. It is a search pattern, just like for the "/" command (See |pattern|). The default value is for C programs. This option is used for the commands "[i", - "]I", "[d", etc. The 'isfname' option is used to recognize the file - name that comes after the matched pattern. See |option-backslash| - about including spaces and backslashes. + "]I", "[d", etc. + Normally the 'isfname' option is used to recognize the file name that + comes after the matched pattern. But if both "\zs" and "\ze" appear + in the pattern then the text spanned by them is used as the file name. + See |option-backslash| about including spaces and backslashes. *'includeexpr'* *'inex'* 'includeexpr' 'inex' string (default "") @@ -5160,6 +5162,9 @@ A jump table for the options with a short description can be found at |Q_op|. Minimal number of lines to scroll when the cursor gets off the screen (e.g., with "j"). Not used for scroll commands (e.g., CTRL-E, CTRL-D). Useful if your terminal scrolls very slowly. + When set to a negative number from -1 to -100 this is used as the + percentage of the window height. Thus -50 scrolls half the window + height. NOTE: This option is set to 1 when 'compatible' is set. *'scrolloff'* *'so'* diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 4d446f6927..d1ca623d70 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.0. Last change: Sep 12, 2005 +*pi_netrw.txt* For Vim version 7.0. Last change: Aug 25, 2005 VIM REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -25,7 +25,7 @@ 4. Transparent File Transfer............................|netrw-transparent| 5. Ex Commands..........................................|netrw-ex| 6. Variables and Options................................|netrw-var| -7. Directory Browsing...................................|netrw-browse| {{{1 +7. Directory Browser....................................|netrw-browse| {{{1 Maps...............................................|netrw-maps| Exploring..........................................|netrw-explore-cmds| Quick Reference Commands Table.....................|netrw-browse-cmds| @@ -40,7 +40,7 @@ Making A New Directory.............................|netrw-d| Deleting Files Or Directories......................|netrw-delete| Renaming Files Or Directories......................|netrw-move| - Hiding Files Or Directories........................|netrw-a| + Hiding Files Or Directories........................|g:netrw-a| Edit File Or Directory Hiding List.................|netrw-h| Browsing With A Horizontally Split Window..........|netrw-o| Preview Window.....................................|netrw-p| @@ -194,8 +194,8 @@ file using root-relative paths, use the full path: 2. Network-Oriented File Transfer *netrw-xfer* Network-oriented file transfer under Vim is implemented by a VimL-based script -() using plugin techniques. It currently supports both reading and -writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, +() using plugin techniques. It currently supports both reading +and writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, dav/cadaver, rsync, or sftp. http is currently supported read-only via use of wget or fetch. @@ -206,23 +206,24 @@ FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. > ex. vim ftp://hostname/path/to/file < -The characters preceding the colon specify the protocol to use; in the -example, its ftp. The script then formulates a command or a -series of commands (typically ftp) which it issues to an external program -(ftp, scp, etc) which does the actual file transfer/protocol. Files are read -from/written to a temporary file (under Unix/Linux, /tmp/...) which the - script will clean up. - -One may modify any protocol's implementing external application by setting a -variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to -"scp -q"). +The characters preceding the colon specify the protocol to use; +in the example, its ftp. The script then formulates +a command or a series of commands (typically ftp) which it issues +to an external program (ftp, scp, etc) which does the actual file +transfer/protocol. Files are read from/written to a temporary file +(under Unix/Linux, /tmp/...) which the script will +clean up. + +One may modify any protocol's implementing external application +by setting a variable (ex. scp uses the variable g:netrw_scp_cmd, +which is defaulted to "scp -q"). Ftp, an old protocol, seems to be blessed by numerous implementations. -Unfortunately, some implementations are noisy (ie., add junk to the end of the -file). Thus, concerned users may decide to write a NetReadFixup() function -that will clean up after reading with their ftp. Some Unix systems (ie., -FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is -not noisy and more convenient, actually, for to use. +Unfortunately, some implementations are noisy (ie., add junk to the end +of the file). Thus, concerned users may decide to write a NetReadFixup() +function that will clean up after reading with their ftp. Some Unix systems +(ie., FreeBSD) provide a utility called "fetch" which uses the ftp protocol +but is not noisy and more convenient, actually, for to use. Consequently, if "fetch" is executable, it will be used to do reads for ftp://... (and http://...) . See |netrw-var| for more about this. @@ -331,9 +332,8 @@ The script attempts to get passwords for ftp invisibly using |inputsecret()|, a built-in Vim function. See |netrw-uidpass| for how to change the password after one has set it. -Unfortunately there doesn't appear to be a way for netrw to feed a password to -scp. Thus every transfer via scp will require re-entry of the password. -However, |netrw-listhack| can help with this problem. +Unfortunately there doesn't appear to be a way for netrw to feed a password +to scp. Thus every transfer via scp will require re-entry of the password. ============================================================================== @@ -341,28 +341,21 @@ However, |netrw-listhack| can help with this problem. Network-oriented file transfers are available by default whenever |'nocompatible'| mode is enabled. The file resides in your -system's vim-plugin directory and is sourced automatically whenever you bring -up vim. I suggest that, at a minimum, you have at least the following in your -<.vimrc> customization file: > - set nocp - if version >= 600 - filetype plugin indent on - endif -< +system's vim-plugin directory and is sourced automatically whenever you +bring up vim. + ============================================================================== 4. Transparent File Transfer *netrw-transparent* Transparent file transfers occur whenever a regular file read or write (invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made. -Thus one may use files across networks just as simply as if they were local. > +Thus one may use files across networks as if they were local. > vim ftp://[user@]machine/path ... :wq -See |netrw-activate| for more on how to encourage your vim to use plugins -such as netrw. ============================================================================== 5. Ex Commands *netrw-ex* @@ -376,14 +369,15 @@ additional commands available. :[range]Nw {netfile} [{netfile}]... Write the specified lines to the {netfile}. -:Nread Read the specified lines into the current +:Nread + Read the specified lines into the current buffer from the file specified in b:netrw_lastfile. :Nread {netfile} {netfile}... Read the {netfile} after the current line. - *netrw-uidpass* + *netrw-uidpass* :call NetUserPass() If b:netrw_uid and b:netrw_passwd don't exist, this function query the user for them. @@ -407,11 +401,10 @@ additional commands available. The script uses several variables which can affect 's behavior. These variables typically may be set in the user's <.vimrc> file: -(also see |netrw-settings|) > - - ------------- - Netrw Options - ------------- +> + ------------- + Netrw Options + ------------- Option Meaning -------------- ----------------------------------------------- < @@ -434,7 +427,7 @@ behavior. These variables typically may be set in the user's <.vimrc> file: g:netrw_silent =0 transfers done normally =1 transfers done silently g:netrw_uid Holds current user-id for ftp. - =1 use alternate ftp (user uid password) + =1 use alternate ftp (user uid password) (see |netrw-options|) g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) =1 use WinNT/2K/XP's rcp, binary mode @@ -488,12 +481,12 @@ variables listed below, and may be modified by the user. ------------------------------------------------------------------------- < *netrw-ftp* -The first two options both help with certain ftp's that give trouble -otherwise. In order to best understand how to use these options if ftp is -giving you troubles, a bit of discussion follows on how netrw does ftp reads. +The first two options both help with certain ftp's that give trouble otherwise. +In order to best understand how to use these options if ftp is giving you +troubles, a bit of discussion follows on how netrw does ftp reads. -The g:netrw_..._cmd variables specify the external program to use handle the -associated protocol (rcp, ftp, etc), plus any options. +The g:netrw_..._cmd variables specify the external program to use handle +the associated protocol (rcp, ftp, etc), plus any options. The g:netrw_list_cmd's HOSTNAME entry will be changed via substitution with whatever the current request is for a hostname. @@ -526,8 +519,8 @@ userid and password. The transferred file is put into a temporary file. The temporary file is then read into the main editing session window that requested it and the temporary file deleted. -If your ftp doesn't accept the "user" command and immediately just demands a -userid, then try putting "let netrw_ftp=1" in your <.vimrc>. +If your ftp doesn't accept the "user" command and immediately just demands +a userid, then try putting "let netrw_ftp=1" in your <.vimrc>. *netrw-cadaver* To handle the SSL certificate dialog for untrusted servers, one may pull @@ -554,12 +547,12 @@ messages) you may write a NetReadFixup(tmpfile) function: endif endfunction > -The NetReadFixup() function will be called if it exists and thus allows you to -customize your reading process. As a further example, contains -just such a function to handle Windows 95 ftp. For whatever reason, Windows -95's ftp dumps four blank lines at the end of a transfer, and so it is -desirable to automate their removal. Here's some code taken from -itself: +The NetReadFixup() function will be called if it exists and thus allows +you to customize your reading process. As a further example, +contains just such a function to handle Windows 95 ftp. For whatever +reason, Windows 95's ftp dumps four blank lines at the end of a transfer, +and so it is desirable to automate their removal. Here's some code taken +from itself: > if has("win95") && g:netrw_win95ftp fun! NetReadFixup(method, line1, line2) @@ -572,7 +565,7 @@ itself: > ============================================================================== -7. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help* +7. Directory Browser *netrw-browse* *netrw-dir* *netrw-list* *netrw-help* MAPS *netrw-maps* ?................Help.......................................|netrw-help| @@ -739,7 +732,7 @@ NETRW BROWSER VARIABLES *netrw-browse-var* INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro* Netrw supports the browsing of directories on the local system and on remote -hosts, including listing files and directories, entering directories, editing +hosts, including generating listing directories, entering directories, editing files therein, deleting files/directories, making new directories, and moving (renaming) files and directories. The Netrw browser generally implements the previous explorer maps and commands for remote directories, although details @@ -750,15 +743,13 @@ ftp. The protocol in the url, if it is ftp, will cause netrw to use ftp in its remote browsing. Any other protocol will be used for file transfers, but otherwise the ssh protocol will be used to do remote directory browsing. -To use Netrw's remote directory browser, simply attempt to read a "file" with a +To enter the netrw directory browser, simply attempt to read a "file" with a trailing slash and it will be interpreted as a request to list a directory: vim [protocol]://[user@]hostname/path/ -For local directories, the trailing slash is not required. - -If you'd like to avoid entering the password in for remote directory listings -with ssh or scp, see |netrw-listhack|. +If you'd like to avoid entering the password in for directory listings, scp, +ssh interaction, etc, see |netrw-listhack|. *netrw-explore* *netrw-pexplore* *netrw-hexplore* *netrw-sexplore* @@ -792,8 +783,7 @@ By default, these commands use the current file's directory. However, one may explicitly provide a directory (path) to use. (Following needs v7.0 or later) *netrw-starstar* -When Explore, Sexplore, Hexplore, or Vexplore are used with a **, -such as: +When Explore, Sexplore, Hexplore, or Vexplore are used like > :Explore **/filename_pattern < @@ -807,8 +797,7 @@ The directory display is updated to show the subdirectory containing a matching file. One may then proceed to the next (or previous) matching files' directories by using Nexplore or Pexplore, respectively. If your console or gui produces recognizable shift-up or shift-down sequences, then you'll likely -find using shift-downarrow and shift-uparrow convenient. They're mapped by -netrw: +find the following mappings convenient: == Nexplore, and == Pexplore. @@ -833,12 +822,11 @@ refresh a local directory by using ":e .". GOING UP *netrw--* -To go up a directory, press - or press the when atop the ../ directory +To go up a directory, press - or his the when atop the ../ directory entry in the listing. -Netrw will use the command in |g:netrw_list_cmd| to perform the directory -listing operation after changing HOSTNAME to the host specified by the -user-provided url. By default netrw provides the command as: +Netrw will modify the command in |g:netrw_list_cmd| to perform the directory +listing operation. By default the command is: ssh HOSTNAME ls -FLa @@ -853,13 +841,7 @@ BROWSING *netrw-cr* Browsing is simple: move the cursor onto a file or directory of interest. Hitting the (the return key) will select the file or directory. Directories will themselves be listed, and files will be opened using the -protocol given in the original read request. - - CAVEAT: There are three forms of listing (see |netrw-i|). Netrw assumes - that two or more spaces delimit filenames and directory names for the long - and wide listing formats. Thus, if your filename or directory name has two - or more spaces embedded in it, or any trailing spaces, then you'll need to - use the "thin" format to select it. +protocol given in the original read request. OBTAINING A FILE *netrw-O* @@ -867,21 +849,7 @@ OBTAINING A FILE *netrw-O* When browsing a remote directory, one may obtain a file under the cursor (ie. get a copy on your local machine, but not edit it) by pressing the O key. Only ftp and scp are supported for this operation (but since these two are -available for browsing, that shouldn't be a problem). The status bar -will then show, on its right hand side, a message like "Obtaining filename". -The statusline will be restored after the transfer is complete. - -Netrw can also "obtain" a file using the local browser. Netrw's display -of a directory is not necessarily the same as Vim's "current directory", -unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select -a file using the local browser (by putting the cursor on it) and pressing -"O" will then "obtain" the file; ie. copy it to Vim's current directory. - -Related topics: - * To see what the current directory is, use |:pwd| - * To make the currently browsed directory the current directory, see |netrw-c| - * To automatically make the currently browsed directory the current - directory, see |g:netrw_keepdir|. +available for browsing, that shouldn't be a problem). THIN, LONG, AND WIDE LISTINGS *netrw-i* @@ -891,27 +859,21 @@ The "i" map cycles between the thin, long, and wide listing formats. The short listing format gives just the files' and directories' names. The long listing is either based on the "ls" command via ssh for remote -directories or displays the filename, file size (in bytes), and the time and -date of last modification for local directories. With the long listing -format, netrw is not able to recognize filenames which have trailing spaces. -Use the thin listing format for such files. +directories or displays the filename, file size (in bytes), and the +time and date of last modification for local directories. -The wide listing format has a multi-column display of the various files in the -netrw current directory, rather like the Unix "ls" presents. In this mode the -"b" and "B" maps are not available; instead, use Nb (|netrw-Nb|) and NB -(|netrw-NB|). The wide listing format uses two or more contiguous spaces to -delineate filenames; when using that format, netrw won't be able to recognize -or use filenames which have two or more contiguous spaces embedded in the name -or any trailing spaces. The thin listing format will, however, work with such -files. +The wide listing format has a multi-column display of the various +files in the netrw current directory, rather like the Unix "ls" presents. +In this mode the "b" and "B" maps are not available; instead, use +Nb (|netrw-Nb|) and NB (|netrw-NB|). MAKING A NEW DIRECTORY *netrw-d* -With the "d" map one may make a new directory either remotely (which depends -on the global variable g:netrw_mkdir_cmd) or locally (which depends on the -global variable g:netrw_local_mkdir). Netrw will issue a request for the new -directory's name. A bare at that point will abort the making of the +With the "d" map one may make a new directory either remotely (which +depends on the global variable g:netrw_mkdir_cmd) or locally (which depends on +the global variable g:netrw_local_mkdir). Netrw will issue a request for the +new directory's name. A bare at that point will abort the making of the directory. Attempts to make a local directory that already exists (as either a file or a directory) will be detected, reported on, and ignored. @@ -919,12 +881,12 @@ a file or a directory) will be detected, reported on, and ignored. DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* Deleting/removing files and directories involves moving the cursor to the -file/directory to be deleted and pressing "D". Directories must be empty -first before they can be successfully removed. If the directory is a softlink -to a directory, then netrw will make two requests to remove the directory -before succeeding. Netrw will ask for confirmation before doing the -removal(s). You may select a range of lines with the "V" command (visual -selection), and then pressing "D". +file/directory to be deleted and pressing "D". Directories must be empty first +before they can be successfully removed. If the directory is a softlink to a +directory, then netrw will make two requests to remove the directory before +succeeding. Netrw will ask for confirmation before doing the removal(s). +You may select a range of lines with the "V" command (visual selection), +and then pressing "D". The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd var