diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-06-24 21:56:24 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-06-24 21:56:24 +0000 |
commit | 446cb837a017fc1c1b144cb5c2a35cb90abfbbcf (patch) | |
tree | 6c1fe56f2db8d4adbeee792b181b0659c4d1f216 /runtime | |
parent | 3577c6fafb77da5419cd1001dac56f204d480bdc (diff) |
updated for version 7.2a
Diffstat (limited to 'runtime')
104 files changed, 12992 insertions, 5007 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index b4753c27fb..6064a6570d 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,22 +1,19 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: May 05, 2007 -" Version: 109 +" Date: Jun 12, 2008 +" Version: 125 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim -" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1 +" Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, " netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided -" *as is* and comes with no warranty of any kind, either +" *as is* and come with no warranty of any kind, either " expressed or implied. By using this plugin, you agree that " in no event will the copyright holder be liable for any damages " resulting from the use of this software. -" of this software. -" COMBAK: worked with tmpfile s:GetTempname() in NetRead() NetWrite() -" !!NEEDS DEBUGGING && TESTING!!! -"redraw!|call inputsave()|call input("Press <cr> to continue")|call inputrestore() +"redraw!|call DechoSep()|call inputsave()|call input("Press <cr> to continue")|call inputrestore() " " But be doers of the Word, and not only hearers, deluding your own selves {{{1 " (James 1:22 RSV) @@ -30,11 +27,20 @@ if !exists("s:NOTE") let s:WARNING = 1 let s:ERROR = 2 endif -let g:loaded_netrw = "v109" +let g:loaded_netrw = "v125" + +" sanity checks if v:version < 700 call netrw#ErrorMsg(s:WARNING,"you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw",1) finish endif +if !exists("*shellescape") + call netrw#ErrorMsg(s:ERROR,"you need to upgade your vim so that it has shellescape()",64) +endif +if !exists("*fnameescape") + call netrw#ErrorMsg(s:ERROR,"you need to upgade your vim so that it has fnameescape()",65) +endif + let s:keepcpo= &cpo setlocal cpo&vim "DechoTabOn @@ -115,6 +121,18 @@ endif " --------------------------------------------------------------------- " Default values for netrw's global variables {{{2 +" Cygwin Detection ------- {{{3 +if !exists("g:netrw_cygwin") + if has("win32") || has("win95") || has("win64") || has("win16") + if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$' + let g:netrw_cygwin= 1 + else + let g:netrw_cygwin= 0 + endif + else + let g:netrw_cygwin= 0 + endif +endif " Default values - a-c ---------- {{{3 if !exists("g:netrw_alto") let g:netrw_alto= &sb @@ -128,26 +146,25 @@ endif if !exists("g:netrw_chgwin") let g:netrw_chgwin = -1 endif -if !exists("g:netrw_cygwin") - if has("win32") || has("win95") || has("win64") || has("win16") - if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$' - let g:netrw_cygwin= 1 - else - let g:netrw_cygwin= 0 - endif - else - let g:netrw_cygwin= 0 - endif -else - let g:netrw_cygwin= 0 +if !exists("g:netrw_compress") + let g:netrw_compress= "gzip" +endif +if !exists("g:netrw_ctags") + let g:netrw_ctags= "ctags" endif -" Default values - d-f ---------- {{{3 +" Default values - d-g ---------- {{{3 if !exists("g:NETRW_DIRHIST_CNT") let g:NETRW_DIRHIST_CNT= 0 endif +if !exists("g:netrw_decompress") + let g:netrw_decompress= { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , ".tar" : "tar -xf"} +endif if !exists("g:netrw_dirhistmax") let g:netrw_dirhistmax= 10 endif +if !exists("g:netrw_fastbrowse") + let g:netrw_fastbrowse= 1 +endif if !exists("g:netrw_ftp_browse_reject") let g:netrw_ftp_browse_reject='^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not\|No such file\|: connect to address [0-9a-fA-F:]*: No route to host$' endif @@ -198,9 +215,35 @@ if !exists("g:netrw_list_hide") let g:netrw_list_hide= "" endif " Default values - lh-lz ---------- {{{3 +if !exists("g:netrw_localcopycmd") + if has("win32") || has("win95") || has("win64") || has("win16") + if g:netrw_cygwin + let g:netrw_localcopycmd= "cp" + else + let g:netrw_localcopycmd= "copy" + endif + elseif has("unix") || has("macunix") + let g:netrw_localcopycmd= "cp" + else + let g:netrw_localcopycmd= "" + endif +endif if !exists("g:netrw_local_mkdir") let g:netrw_local_mkdir= "mkdir" endif +if !exists("g:netrw_localmovecmd") + if has("win32") || has("win95") || has("win64") || has("win16") + if g:netrw_cygwin + let g:netrw_localmovecmd= "mv" + else + let g:netrw_localmovecmd= "move" + endif + elseif has("unix") || has("macunix") + let g:netrw_localmovecmd= "mv" + else + let g:netrw_localmovecmd= "" + endif +endif if !exists("g:netrw_local_rmdir") let g:netrw_local_rmdir= "rmdir" endif @@ -215,6 +258,9 @@ if g:netrw_liststyle == s:LONGLIST && g:netrw_scp_cmd !~ '^pscp' let g:netrw_list_cmd= g:netrw_list_cmd." -l" endif " Default values - m-r ---------- {{{3 +if !exists("g:netrw_markfileesc") + let g:netrw_markfileesc= '*./[\~' +endif if !exists("g:netrw_maxfilenamelen") let g:netrw_maxfilenamelen= 32 endif @@ -224,6 +270,19 @@ endif if !exists("g:netrw_mkdir_cmd") let g:netrw_mkdir_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME mkdir" endif +if !exists("g:netrw_mousemaps") + if exists("&mouse") && &mouse =~ '[anh]' + let g:netrw_mousemaps= 1 + else + let g:netrw_mousemaps= 0 + endif +endif +if !exists("g:netrw_retmap") + let g:netrw_retmap= 0 +endif +if !exists("g:netrw_preview") + let g:netrw_preview= 0 +endif if !exists("g:netrw_scpport") let g:netrw_scpport= "-P" endif @@ -243,27 +302,11 @@ if !exists("g:netrw_rmf_cmd") let g:netrw_rmf_cmd = g:netrw_ssh_cmd." USEPORT HOSTNAME rm -f" endif " Default values - s ---------- {{{3 + " set up shell quoting character if exists("g:netrw_silent") && g:netrw_silent != 0 - let g:netrw_silentxfer= "silent " + let s:netrw_silentxfer= "silent " else - let g:netrw_silentxfer= "" -endif -if !exists("g:netrw_fastbrowse") - let g:netrw_fastbrowse= 1 -endif -if !exists("g:netrw_shq") - if exists("&shq") && &shq != "" - let g:netrw_shq= &shq - elseif has("win32") || has("win95") || has("win64") || has("win16") - if g:netrw_cygwin - let g:netrw_shq= "'" - else - let g:netrw_shq= '"' - endif - else - let g:netrw_shq= "'" - endif -" call Decho("g:netrw_shq<".g:netrw_shq.">") + let s:netrw_silentxfer= "" endif if !exists("g:netrw_sort_by") " alternatives: date size @@ -274,7 +317,10 @@ if !exists("g:netrw_sort_direction") let g:netrw_sort_direction= "normal" endif if !exists("g:netrw_sort_sequence") - let g:netrw_sort_sequence= '[\/]$,\.h$,\.c$,\.cpp$,\.[a-np-z]$,*,\.info$,\.swp$,\.o$\.obj$,\.bak$' + let g:netrw_sort_sequence= '[\/]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$' +endif +if !exists("g:netrw_special_syntax") + let g:netrw_special_syntax= 0 endif if !exists("g:netrw_ssh_browse_reject") let g:netrw_ssh_browse_reject='^total\s\+\d\+$' @@ -290,6 +336,9 @@ endif if !exists("g:netrw_timefmt") let g:netrw_timefmt= "%c" endif +if !exists("g:netrw_xstrlen") + let g:netrw_xstrlen= 1 +endif if !exists("g:NetrwTopLvlMenu") let g:NetrwTopLvlMenu= "Netrw." endif @@ -304,17 +353,14 @@ if !exists("g:netrw_winsize") endif " --------------------------------------------------------------------- " Default values for netrw's script variables: {{{2 -if !exists("s:netrw_cd_escape") - let s:netrw_cd_escape="[]#*$%'\" ?`!&();<>\\" -endif if !exists("g:netrw_fname_escape") - let g:netrw_fname_escape= ' ?&;' + let g:netrw_fname_escape= ' ?&;%' endif -if !exists("g:netrw_tmpfile_escape") - let g:netrw_tmpfile_escape= ' ?&;' +if !exists("g:netrw_glob_escape") + let g:netrw_glob_escape= '[]*?`{~$' endif -if !exists("s:netrw_glob_escape") - let s:netrw_glob_escape= '[]*?`{~$' +if !exists("g:netrw_tmpfile_escape") + let g:netrw_tmpfile_escape= ' &;' endif " BufEnter event ignored by decho when following variable is true @@ -327,184 +373,201 @@ endif " ============================== " ------------------------------------------------------------------------ -" NetSavePosn: saves position of cursor on screen {{{2 -fun! netrw#NetSavePosn() -" call Dfunc("netrw#NetSavePosn()") - " Save current line and column - let w:netrw_winnr= winnr() - let w:netrw_line = line(".") - let w:netrw_col = virtcol(".") - - " Save top-of-screen line - norm! H0 - let w:netrw_hline= line(".") - - call netrw#NetRestorePosn() -" call Dret("netrw#NetSavePosn : winnr=".w:netrw_winnr." line=".w:netrw_line." col=".w:netrw_col." hline=".w:netrw_hline) -endfun - -" ------------------------------------------------------------------------ -" NetRestorePosn: restores the cursor and file position as saved by NetSavePosn() {{{2 -fun! netrw#NetRestorePosn() -" call Dfunc("netrw#NetRestorePosn() winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : -1)." line=".(exists("w:netrw_line")? w:netrw_line : -1)." col=".(exists("w:netrw_col")? w:netrw_col : -1)." hline=".(exists("w:netrw_hline")? w:netrw_hline : -1)) - let eikeep= &ei - set ei=all - if expand("%") == "NetrwMessage" - exe s:winBeforeErr."wincmd w" - endif - - " restore window - if exists("w:netrw_winnr") -" call Decho("restore window: exe silent! ".w:netrw_winnr."wincmd w") - exe "silent! ".w:netrw_winnr."wincmd w" - endif - if v:shell_error == 0 - " as suggested by Bram M: redraw on no error - " allows protocol error messages to remain visible - redraw!< |