mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
updated for version 7.0157
This commit is contained in:
parent
8349fd7c7e
commit
61036991ab
@ -1,7 +1,7 @@
|
|||||||
" netrw.vim: Handles file transfer and remote directory listing across a network
|
" netrw.vim: Handles file transfer and remote directory listing across a network
|
||||||
" AUTOLOAD PORTION
|
" AUTOLOAD PORTION
|
||||||
" Date: Sep 29, 2005
|
" Date: Oct 12, 2005
|
||||||
" Version: 72
|
" Version: 73
|
||||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||||
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
||||||
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
||||||
@ -23,22 +23,74 @@
|
|||||||
if &cp || exists("g:loaded_netrw")
|
if &cp || exists("g:loaded_netrw")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
let g:loaded_netrw = "v73"
|
||||||
if v:version < 700
|
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
|
echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_netrw = "v72"
|
|
||||||
let s:keepcpo = &cpo
|
let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
" call Decho("doing autoload/netrw.vim")
|
" call Decho("doing autoload/netrw.vim")
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Default values for global netrw variables {{{1
|
" Default values for netrw's global protocol variables {{{1
|
||||||
if !exists("g:netrw_ftpmode")
|
if !exists("g:netrw_dav_cmd")
|
||||||
let g:netrw_ftpmode= "binary"
|
let g:netrw_dav_cmd = "cadaver"
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_win95ftp")
|
if !exists("g:netrw_fetch_cmd")
|
||||||
let g:netrw_win95ftp= 1
|
if executable("fetch")
|
||||||
|
let g:netrw_fetch_cmd = "fetch -o"
|
||||||
|
else
|
||||||
|
let g:netrw_fetch_cmd = ""
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_ftp_cmd")
|
||||||
|
let g:netrw_ftp_cmd = "ftp"
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_http_cmd")
|
||||||
|
if executable("wget")
|
||||||
|
let g:netrw_http_cmd = "wget -q -O"
|
||||||
|
elseif executable("fetch")
|
||||||
|
let g:netrw_http_cmd = "fetch -o"
|
||||||
|
else
|
||||||
|
let g:netrw_http_cmd = ""
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_rcp_cmd")
|
||||||
|
let g:netrw_rcp_cmd = "rcp"
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_rsync_cmd")
|
||||||
|
let g:netrw_rsync_cmd = "rsync"
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_scp_cmd")
|
||||||
|
let g:netrw_scp_cmd = "scp -q"
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_sftp_cmd")
|
||||||
|
let g:netrw_sftp_cmd = "sftp"
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_ssh_cmd")
|
||||||
|
let g:netrw_ssh_cmd= "ssh"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||||
|
\ && exists("g:netrw_use_nt_rcp")
|
||||||
|
\ && g:netrw_use_nt_rcp
|
||||||
|
\ && executable( $SystemRoot .'/system32/rcp.exe')
|
||||||
|
let s:netrw_has_nt_rcp = 1
|
||||||
|
let s:netrw_rcpmode = '-b'
|
||||||
|
else
|
||||||
|
let s:netrw_has_nt_rcp = 0
|
||||||
|
let s:netrw_rcpmode = ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" Default values for netrw's global variables {{{1
|
||||||
|
" Default values - a-c ---------- {{{2
|
||||||
|
if !exists("g:netrw_alto")
|
||||||
|
let g:netrw_alto= 0
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_altv")
|
||||||
|
let g:netrw_altv= 0
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_cygwin")
|
if !exists("g:netrw_cygwin")
|
||||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||||
@ -51,14 +103,15 @@ if !exists("g:netrw_cygwin")
|
|||||||
let g:netrw_cygwin= 0
|
let g:netrw_cygwin= 0
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_list_cmd")
|
" Default values - d-f ---------- {{{2
|
||||||
if executable("ssh")
|
if !exists("g:NETRW_DIRHIST_CNT")
|
||||||
" provide a default listing command
|
let g:NETRW_DIRHIST_CNT= 0
|
||||||
let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
|
|
||||||
else
|
|
||||||
" call Decho("ssh is not executable, can't do remote directory exploring with ssh")
|
|
||||||
let g:netrw_list_cmd= ""
|
|
||||||
endif
|
endif
|
||||||
|
if !exists("g:netrw_dirhistmax")
|
||||||
|
let g:netrw_dirhistmax= 10
|
||||||
|
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
|
endif
|
||||||
if !exists("g:netrw_ftp_list_cmd")
|
if !exists("g:netrw_ftp_list_cmd")
|
||||||
if has("unix") || exists("g:netrw_cygwin")
|
if has("unix") || exists("g:netrw_cygwin")
|
||||||
@ -67,75 +120,96 @@ if !exists("g:netrw_ftp_list_cmd")
|
|||||||
let g:netrw_ftp_list_cmd= "dir"
|
let g:netrw_ftp_list_cmd= "dir"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_rm_cmd")
|
if !exists("g:netrw_ftpmode")
|
||||||
let g:netrw_rm_cmd = "ssh HOSTNAME rm"
|
let g:netrw_ftpmode= "binary"
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_rmf_cmd")
|
" Default values - h-lh ---------- {{{2
|
||||||
let g:netrw_rmf_cmd = "ssh HOSTNAME rm -f"
|
if !exists("g:netrw_hide")
|
||||||
|
let g:netrw_hide= 1
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_rmdir_cmd")
|
if !exists("g:netrw_keepdir")
|
||||||
let g:netrw_rmdir_cmd = "ssh HOSTNAME rmdir"
|
let g:netrw_keepdir= 1
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_list_cmd")
|
||||||
|
if executable(g:netrw_ssh_cmd)
|
||||||
|
" provide a default listing command
|
||||||
|
let g:netrw_list_cmd= g:netrw_ssh_cmd." HOSTNAME ls -FLa"
|
||||||
|
else
|
||||||
|
" call Decho(g:netrw_ssh_cmd." is not executable, can't do remote directory exploring)
|
||||||
|
let g:netrw_list_cmd= ""
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_list_hide")
|
||||||
|
let g:netrw_list_hide= ""
|
||||||
|
endif
|
||||||
|
" Default values - lh-lz ---------- {{{2
|
||||||
|
if !exists("g:netrw_local_mkdir")
|
||||||
|
let g:netrw_local_mkdir= "mkdir"
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_local_rmdir")
|
||||||
|
let g:netrw_local_rmdir= "rmdir"
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_longlist")
|
||||||
|
let g:netrw_longlist= 0
|
||||||
|
endif
|
||||||
|
if g:netrw_longlist < 0 || g:netrw_longlist > 2
|
||||||
|
" sanity check
|
||||||
|
let g:netrw_longlist= 0
|
||||||
|
endif
|
||||||
|
if g:netrw_longlist == 1
|
||||||
|
let g:netrw_list_cmd= g:netrw_list_cmd." -l"
|
||||||
|
endif
|
||||||
|
" Default values - m-r ---------- {{{2
|
||||||
|
if !exists("g:netrw_maxfilenamelen")
|
||||||
|
let g:netrw_maxfilenamelen= 32
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_mkdir_cmd")
|
||||||
|
let g:netrw_mkdir_cmd= g:netrw_ssh_cmd." HOSTNAME mkdir"
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_rename_cmd")
|
if !exists("g:netrw_rename_cmd")
|
||||||
let g:netrw_rename_cmd= "ssh HOSTNAME mv"
|
let g:netrw_rename_cmd= g:netrw_ssh_cmd." HOSTNAME mv"
|
||||||
endif
|
endif
|
||||||
|
if !exists("g:netrw_rm_cmd")
|
||||||
|
let g:netrw_rm_cmd = g:netrw_ssh_cmd." HOSTNAME rm"
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_rmdir_cmd")
|
||||||
|
let g:netrw_rmdir_cmd = g:netrw_ssh_cmd." HOSTNAME rmdir"
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_rmf_cmd")
|
||||||
|
let g:netrw_rmf_cmd = g:netrw_ssh_cmd." HOSTNAME rm -f"
|
||||||
|
endif
|
||||||
|
" Default values - s ---------- {{{2
|
||||||
if exists("g:netrw_silent") && g:netrw_silent != 0
|
if exists("g:netrw_silent") && g:netrw_silent != 0
|
||||||
let g:netrw_silentxfer= "silent "
|
let g:netrw_silentxfer= "silent "
|
||||||
else
|
else
|
||||||
let g:netrw_silentxfer= ""
|
let g:netrw_silentxfer= ""
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_winsize")
|
|
||||||
let g:netrw_winsize= ""
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_list_hide")
|
|
||||||
let g:netrw_list_hide= ""
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_sort_by")
|
if !exists("g:netrw_sort_by")
|
||||||
" alternatives: date size
|
" alternatives: date size
|
||||||
let g:netrw_sort_by= "name"
|
let g:netrw_sort_by= "name"
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_sort_sequence")
|
|
||||||
let g:netrw_sort_sequence= '[\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$'
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_sort_direction")
|
if !exists("g:netrw_sort_direction")
|
||||||
" alternative: reverse (z y x ...)
|
" alternative: reverse (z y x ...)
|
||||||
let g:netrw_sort_direction= "normal"
|
let g:netrw_sort_direction= "normal"
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_longlist")
|
if !exists("g:netrw_sort_sequence")
|
||||||
let g:netrw_longlist= 0
|
let g:netrw_sort_sequence= '[\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$'
|
||||||
endif
|
|
||||||
if g:netrw_longlist == 0 || g:netrw_longlist == 2
|
|
||||||
let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
|
|
||||||
else
|
|
||||||
let g:netrw_longlist= 1
|
|
||||||
let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa -l"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_list_cmd")
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_timefmt")
|
|
||||||
let g:netrw_timefmt= "%c"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_local_rmdir")
|
|
||||||
let g:netrw_local_rmdir= "rmdir"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_local_mkdir")
|
|
||||||
let g:netrw_local_mkdir= "mkdir"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_mkdir_cmd")
|
|
||||||
let g:netrw_mkdir_cmd= "ssh HOSTNAME mkdir"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_hide")
|
|
||||||
let g:netrw_hide= 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
|
endif
|
||||||
if !exists("g:netrw_ssh_browse_reject")
|
if !exists("g:netrw_ssh_browse_reject")
|
||||||
let g:netrw_ssh_browse_reject='^total\s\+\d\+$'
|
let g:netrw_ssh_browse_reject='^total\s\+\d\+$'
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_keepdir")
|
" Default values - t-w ---------- {{{2
|
||||||
let g:netrw_keepdir= 1
|
if !exists("g:netrw_timefmt")
|
||||||
|
let g:netrw_timefmt= "%c"
|
||||||
endif
|
endif
|
||||||
|
if !exists("g:netrw_win95ftp")
|
||||||
|
let g:netrw_win95ftp= 1
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_winsize")
|
||||||
|
let g:netrw_winsize= ""
|
||||||
|
endif
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" Default values for netrw's script variables: {{{1
|
||||||
if !exists("s:netrw_cd_escape")
|
if !exists("s:netrw_cd_escape")
|
||||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||||
let s:netrw_cd_escape="#% "
|
let s:netrw_cd_escape="#% "
|
||||||
@ -150,75 +224,12 @@ if !exists("s:netrw_glob_escape")
|
|||||||
let s:netrw_glob_escape= '[]*?`{~$'
|
let s:netrw_glob_escape= '[]*?`{~$'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_alto")
|
|
||||||
let g:netrw_alto= 0
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_altv")
|
|
||||||
let g:netrw_altv= 0
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_maxfilenamelen")
|
|
||||||
let g:netrw_maxfilenamelen= 32
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_dirhistmax")
|
|
||||||
let g:netrw_dirhistmax= 10
|
|
||||||
endif
|
|
||||||
if !exists("g:NETRW_DIRHIST_CNT")
|
|
||||||
let g:NETRW_DIRHIST_CNT= 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
" BufEnter event ignored by decho when following variable is true
|
" BufEnter event ignored by decho when following variable is true
|
||||||
" Has a side effect that doau BufReadPost doesn't work, so
|
" Has a side effect that doau BufReadPost doesn't work, so
|
||||||
" files read by network transfer aren't appropriately highlighted.
|
" files read by network transfer aren't appropriately highlighted.
|
||||||
"let g:decho_bufenter = 1 "Decho
|
"let g:decho_bufenter = 1 "Decho
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
|
||||||
" Default values for global protocol variables {{{1
|
|
||||||
if !exists("g:netrw_rcp_cmd")
|
|
||||||
let g:netrw_rcp_cmd = "rcp"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_ftp_cmd")
|
|
||||||
let g:netrw_ftp_cmd = "ftp"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_scp_cmd")
|
|
||||||
let g:netrw_scp_cmd = "scp -q"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_sftp_cmd")
|
|
||||||
let g:netrw_sftp_cmd = "sftp"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_http_cmd")
|
|
||||||
if executable("wget")
|
|
||||||
let g:netrw_http_cmd = "wget -q -O"
|
|
||||||
elseif executable("fetch")
|
|
||||||
let g:netrw_http_cmd = "fetch -o"
|
|
||||||
else
|
|
||||||
let g:netrw_http_cmd = ""
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_dav_cmd")
|
|
||||||
let g:netrw_dav_cmd = "cadaver"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_rsync_cmd")
|
|
||||||
let g:netrw_rsync_cmd = "rsync"
|
|
||||||
endif
|
|
||||||
if !exists("g:netrw_fetch_cmd")
|
|
||||||
if executable("fetch")
|
|
||||||
let g:netrw_fetch_cmd = "fetch -o"
|
|
||||||
else
|
|
||||||
let g:netrw_fetch_cmd = ""
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
|
||||||
\ && exists("g:netrw_use_nt_rcp")
|
|
||||||
\ && g:netrw_use_nt_rcp
|
|
||||||
\ && executable( $SystemRoot .'/system32/rcp.exe')
|
|
||||||
let s:netrw_has_nt_rcp = 1
|
|
||||||
let s:netrw_rcpmode = '-b'
|
|
||||||
else
|
|
||||||
let s:netrw_has_nt_rcp = 0
|
|
||||||
let s:netrw_rcpmode = ''
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
" NetSavePosn: saves position of cursor on screen {{{1
|
" NetSavePosn: saves position of cursor on screen {{{1
|
||||||
fun! netrw#NetSavePosn()
|
fun! netrw#NetSavePosn()
|
||||||
@ -656,6 +667,10 @@ endfun
|
|||||||
fun! s:NetGetFile(readcmd, fname, method)
|
fun! s:NetGetFile(readcmd, fname, method)
|
||||||
" call Dfunc("NetGetFile(readcmd<".a:readcmd.">,fname<".a:fname."> method<".a:method.">)")
|
" call Dfunc("NetGetFile(readcmd<".a:readcmd.">,fname<".a:fname."> method<".a:method.">)")
|
||||||
|
|
||||||
|
" record remote filename
|
||||||
|
let rfile= bufname("%")
|
||||||
|
" call Decho("rfile<".rfile.">")
|
||||||
|
|
||||||
if exists("*NetReadFixup")
|
if exists("*NetReadFixup")
|
||||||
" for the use of NetReadFixup (not otherwise used internally)
|
" for the use of NetReadFixup (not otherwise used internally)
|
||||||
let line2= line("$")
|
let line2= line("$")
|
||||||
@ -678,9 +693,6 @@ fun! s:NetGetFile(readcmd, fname, method)
|
|||||||
if a:readcmd[0] == '0'
|
if a:readcmd[0] == '0'
|
||||||
" get file into buffer
|
" get file into buffer
|
||||||
|
|
||||||
" record remote filename
|
|
||||||
let rfile= bufname(".")
|
|
||||||
" call Decho("remotefile<".rfile.">")
|
|
||||||
" call Dredir("ls!","starting buffer list")
|
" call Dredir("ls!","starting buffer list")
|
||||||
|
|
||||||
" rename the current buffer to the temp file (ie. fname)
|
" rename the current buffer to the temp file (ie. fname)
|
||||||
@ -1064,7 +1076,7 @@ fun! s:NetBrowse(dirname)
|
|||||||
endif
|
endif
|
||||||
elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == ''
|
elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == ''
|
||||||
if !exists("g:netrw_quiet")
|
if !exists("g:netrw_quiet")
|
||||||
echohl Error | echo "***netrw*** this system doesn't support remote directory listing via ssh" | echohl None
|
echohl Error | echo "***netrw*** this system doesn't support remote directory listing via ".g:netrw_list_cmd | echohl None
|
||||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1540,6 +1552,9 @@ fun! s:NetBrowseRm(usrhost,path) range
|
|||||||
let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
||||||
call inputrestore()
|
call inputrestore()
|
||||||
echohl NONE
|
echohl NONE
|
||||||
|
if ok == ""
|
||||||
|
let ok="no"
|
||||||
|
endif
|
||||||
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
||||||
if ok =~ 'a\%[ll]'
|
if ok =~ 'a\%[ll]'
|
||||||
let all= 1
|
let all= 1
|
||||||
@ -1566,6 +1581,9 @@ fun! s:NetBrowseRm(usrhost,path) range
|
|||||||
call inputsave()
|
call inputsave()
|
||||||
let ok= input("Confirm deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
let ok= input("Confirm deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
||||||
call inputrestore()
|
call inputrestore()
|
||||||
|
if ok == ""
|
||||||
|
let ok="no"
|
||||||
|
endif
|
||||||
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
||||||
if ok =~ 'a\%[ll]'
|
if ok =~ 'a\%[ll]'
|
||||||
let all= 1
|
let all= 1
|
||||||
@ -1722,7 +1740,7 @@ fun! s:NetBrowseX(fname,remote)
|
|||||||
exe "w! ".fname
|
exe "w! ".fname
|
||||||
q
|
q
|
||||||
endif
|
endif
|
||||||
" call Decho("exten<".exten."> "."NetrwFileHandler_".exten."():exists=".exists("*NetrwFileHandler_".exten))
|
" call Decho("exten<".exten."> "."netrwFileHandlers#NFH_".exten."():exists=".exists("*netrwFileHandlers#NFH_".exten))
|
||||||
|
|
||||||
" set up redirection
|
" set up redirection
|
||||||
if &srr =~ "%s"
|
if &srr =~ "%s"
|
||||||
@ -1738,19 +1756,22 @@ fun! s:NetBrowseX(fname,remote)
|
|||||||
exe 'silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"'
|
exe 'silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"'
|
||||||
let ret= v:shell_error
|
let ret= v:shell_error
|
||||||
|
|
||||||
elseif has("unix") && executable("kfmclient")
|
|
||||||
" call Decho("exe silent !kfmclient exec '".escape(fname,'%#')."' ".redir)
|
|
||||||
exe "silent !kfmclient exec '".escape(fname,'%#')."' ".redir
|
|
||||||
let ret= v:shell_error
|
|
||||||
|
|
||||||
elseif has("unix") && executable("gnome-open")
|
elseif has("unix") && executable("gnome-open")
|
||||||
" call Decho("exe silent !gnome-open '".escape(fname,'%#')."' ".redir)
|
" call Decho("exe silent !gnome-open '".escape(fname,'%#')."' ".redir)
|
||||||
exe "silent !gnome-open '".escape(fname,'%#')."'".redir
|
exe "silent !gnome-open '".escape(fname,'%#')."'".redir
|
||||||
let ret= v:shell_error
|
let ret= v:shell_error
|
||||||
|
|
||||||
elseif exten != "" && exists("*NetrwFileHandler_".exten)
|
elseif has("unix") && executable("kfmclient")
|
||||||
" call Decho("let ret= NetrwFileHandler_".exten.'("'.fname.'")')
|
" call Decho("exe silent !kfmclient exec '".escape(fname,'%#')."' ".redir)
|
||||||
exe "let ret= NetrwFileHandler_".exten.'("'.fname.'")'
|
exe "silent !kfmclient exec '".escape(fname,'%#')."' ".redir
|
||||||
|
let ret= v:shell_error
|
||||||
|
|
||||||
|
else
|
||||||
|
call netrwFileHandlers#Init()
|
||||||
|
if exten != "" && exists("*netrwFileHandlers#NFH_".exten)
|
||||||
|
" call Decho("let ret= netrwFileHandlers#NFH_".exten.'("'.fname.'")')
|
||||||
|
exe "let ret= netrwFileHandlers#NFH_".exten.'("'.fname.'")'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
redraw!
|
redraw!
|
||||||
|
|
||||||
@ -2349,6 +2370,8 @@ fun! s:NetObtain()
|
|||||||
".........................................
|
".........................................
|
||||||
else
|
else
|
||||||
" scp: Method#4
|
" scp: Method#4
|
||||||
|
let curdir = expand("%")
|
||||||
|
let path = substitute(curdir,'scp://[^/]\+/','','e')
|
||||||
if exists("g:netrw_port") && g:netrw_port != ""
|
if exists("g:netrw_port") && g:netrw_port != ""
|
||||||
let useport= " -P ".g:netrw_port
|
let useport= " -P ".g:netrw_port
|
||||||
else
|
else
|
||||||
@ -2356,11 +2379,11 @@ fun! s:NetObtain()
|
|||||||
endif
|
endif
|
||||||
if g:netrw_cygwin == 1
|
if g:netrw_cygwin == 1
|
||||||
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
|
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
|
||||||
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(fname,' ?&')." .")
|
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".path.escape(fname,' ?&')." .")
|
||||||
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(fname,' ?&')." ."
|
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".path.escape(fname,' ?&')." ."
|
||||||
else
|
else
|
||||||
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(fname,' ?&')." .")
|
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".path.escape(fname,' ?&')." .")
|
||||||
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(fname,' ?&')." ."
|
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".path.escape(fname,' ?&')." ."
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -2825,7 +2848,12 @@ fun! s:LocalBrowseRm(path) range
|
|||||||
let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
||||||
call inputrestore()
|
call inputrestore()
|
||||||
echohl NONE
|
echohl NONE
|
||||||
|
if ok == ""
|
||||||
|
let ok="no"
|
||||||
|
endif
|
||||||
|
" call Decho("response: ok<".ok.">")
|
||||||
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
||||||
|
" call Decho("response: ok<".ok."> (after sub)")
|
||||||
if ok =~ 'a\%[ll]'
|
if ok =~ 'a\%[ll]'
|
||||||
let all= 1
|
let all= 1
|
||||||
endif
|
endif
|
||||||
@ -2846,6 +2874,9 @@ fun! s:LocalBrowseRm(path) range
|
|||||||
let ok= input("Confirm deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
let ok= input("Confirm deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
||||||
call inputrestore()
|
call inputrestore()
|
||||||
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
||||||
|
if ok == ""
|
||||||
|
let ok="no"
|
||||||
|
endif
|
||||||
if ok =~ 'a\%[ll]'
|
if ok =~ 'a\%[ll]'
|
||||||
let all= 1
|
let all= 1
|
||||||
endif
|
endif
|
||||||
@ -3034,6 +3065,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
|
|||||||
" call Decho("calling NetBrowse(newdir<".newdir.">)")
|
" call Decho("calling NetBrowse(newdir<".newdir.">)")
|
||||||
call s:NetBrowse(newdir)
|
call s:NetBrowse(newdir)
|
||||||
else
|
else
|
||||||
|
if newdir == ""|let newdir= "."|endif
|
||||||
" call Decho("calling LocalBrowse(newdir<".newdir.">)")
|
" call Decho("calling LocalBrowse(newdir<".newdir.">)")
|
||||||
call s:LocalBrowse(newdir)
|
call s:LocalBrowse(newdir)
|
||||||
endif
|
endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
*pi_netrw.txt* For Vim version 7.0. Last change: Sep 29, 2005
|
*pi_netrw.txt* For Vim version 7.0. Last change: Oct 03, 2005
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
|
VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
|
||||||
|
|
||||||
@ -663,12 +663,13 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
|
|||||||
: connect to address [0-9a-fA-F:]*
|
: connect to address [0-9a-fA-F:]*
|
||||||
: No route to host$'
|
: No route to host$'
|
||||||
|
|
||||||
*g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
|
*g:netrw_ftp_list_cmd* options for passing along to ftp for directory
|
||||||
messages, banners, and whatnot that one doesn't
|
listing. Defaults:
|
||||||
want masquerading as "directories" and "files".
|
unix or g:netrw_cygwin set: : "ls -lF"
|
||||||
Use this pattern to remove such embedded
|
otherwise "dir"
|
||||||
messages. By default its value is:
|
|
||||||
'^total\s\+\d\+$'
|
*g:netrw_hide* if true, the hiding list is used
|
||||||
|
default: =0
|
||||||
|
|
||||||
*g:netrw_keepdir* =1 (default) keep current directory immune from
|
*g:netrw_keepdir* =1 (default) keep current directory immune from
|
||||||
the browsing directory.
|
the browsing directory.
|
||||||
@ -683,16 +684,11 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
|
|||||||
|
|
||||||
*g:netrw_longlist* if =1, then long listing will be default
|
*g:netrw_longlist* if =1, then long listing will be default
|
||||||
|
|
||||||
*g:netrw_ftp_list_cmd* options for passing along to ftp for directory
|
|
||||||
listing. Defaults:
|
|
||||||
unix or g:netrw_cygwin set: : "ls -lF"
|
|
||||||
otherwise "dir"
|
|
||||||
|
|
||||||
*g:netrw_list_hide* comma separated pattern list for hiding files
|
*g:netrw_list_hide* comma separated pattern list for hiding files
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
*g:netrw_local_mkdir* command for making a local directory
|
*g:netrw_local_mkdir* command for making a local directory
|
||||||
default: "ssh HOSTNAME mkdir"
|
default: "mkdir"
|
||||||
|
|
||||||
*g:netrw_local_rmdir* remove directory command (rmdir)
|
*g:netrw_local_rmdir* remove directory command (rmdir)
|
||||||
default: "rmdir"
|
default: "rmdir"
|
||||||
@ -716,9 +712,6 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
|
|||||||
*g:netrw_rmf_cmd* command for removing softlinks
|
*g:netrw_rmf_cmd* command for removing softlinks
|
||||||
default: "ssh HOSTNAME rm -f"
|
default: "ssh HOSTNAME rm -f"
|
||||||
|
|
||||||
*g:netrw_hide* if true, the hiding list is used
|
|
||||||
default: =0
|
|
||||||
|
|
||||||
*g:netrw_sort_by* sort by "name", "time", or "size"
|
*g:netrw_sort_by* sort by "name", "time", or "size"
|
||||||
default: "name"
|
default: "name"
|
||||||
|
|
||||||
@ -730,6 +723,18 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
|
|||||||
default: '[\/]$,*,\.bak$,\.o$,\.h$,
|
default: '[\/]$,*,\.bak$,\.o$,\.h$,
|
||||||
\.info$,\.swp$,\.obj$'
|
\.info$,\.swp$,\.obj$'
|
||||||
|
|
||||||
|
*g:netrw_ssh_cmd* One may specify an executable command
|
||||||
|
to use instead of ssh for remote actions
|
||||||
|
such as listing, file removal, etc.
|
||||||
|
default: ssh
|
||||||
|
|
||||||
|
*g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
|
||||||
|
messages, banners, and whatnot that one doesn't
|
||||||
|
want masquerading as "directories" and "files".
|
||||||
|
Use this pattern to remove such embedded
|
||||||
|
messages. By default its value is:
|
||||||
|
'^total\s\+\d\+$'
|
||||||
|
|
||||||
*g:netrw_timefmt* specify format string to strftime() (%c)
|
*g:netrw_timefmt* specify format string to strftime() (%c)
|
||||||
default: "%c"
|
default: "%c"
|
||||||
|
|
||||||
@ -833,7 +838,7 @@ refresh a local directory by using ":e .".
|
|||||||
|
|
||||||
GOING UP *netrw--*
|
GOING UP *netrw--*
|
||||||
|
|
||||||
To go up a directory, press - or press the <cr> when atop the ../ directory
|
To go up a directory, press "-" or press the <cr> when atop the ../ directory
|
||||||
entry in the listing.
|
entry in the listing.
|
||||||
|
|
||||||
Netrw will use the command in |g:netrw_list_cmd| to perform the directory
|
Netrw will use the command in |g:netrw_list_cmd| to perform the directory
|
||||||
@ -1072,24 +1077,24 @@ handler varies:
|
|||||||
* for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
|
* for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
|
||||||
* for KDE (with kfmclient): kfmclient is used.
|
* for KDE (with kfmclient): kfmclient is used.
|
||||||
* for Gnome (with gnome-open): gnome-open is used.
|
* for Gnome (with gnome-open): gnome-open is used.
|
||||||
* otherwise the NetrwFileHandler plugin is used.
|
* otherwise the netrwFileHandler plugin is used.
|
||||||
|
|
||||||
The file's suffix is used by these various approaches to determine an
|
The file's suffix is used by these various approaches to determine an
|
||||||
appropriate application to use to "handle" these files. Such things as
|
appropriate application to use to "handle" these files. Such things as
|
||||||
OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
|
OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
|
||||||
*.eps) can be handled.
|
*.eps) can be handled.
|
||||||
|
|
||||||
The NetrwFileHandler applies a user-defined function to a file, based on its
|
The netrwFileHandler applies a user-defined function to a file, based on its
|
||||||
extension. Of course, the handler function must exist for it to be called!
|
extension. Of course, the handler function must exist for it to be called!
|
||||||
>
|
>
|
||||||
Ex. mypgm.html x ->
|
Ex. mypgm.html x ->
|
||||||
NetrwFileHandler_html("scp://user@host/some/path/mypgm.html")
|
netrwFileHandler_html("scp://user@host/some/path/mypgm.html")
|
||||||
<
|
<
|
||||||
See the <plugin/NetrwFileHandlers.vim> for an example of how to handle an html
|
See the <plugin/netrwFileHandlers.vim> for an example of how to handle an html
|
||||||
file with mozilla.
|
file with mozilla.
|
||||||
|
|
||||||
One may write custom NetrwFileHandlers; please look at the
|
One may write custom netrwFileHandlers; please look at the
|
||||||
plugin/NetrwFileHandlers.vim script for examples. If its likely to be
|
plugin/netrwFileHandlers.vim script for examples. If its likely to be
|
||||||
generally useful, please feel free to forward a copy to me for future
|
generally useful, please feel free to forward a copy to me for future
|
||||||
inclusion in the distribution.
|
inclusion in the distribution.
|
||||||
|
|
||||||
@ -1279,6 +1284,12 @@ which is loaded automatically at startup (assuming :set nocp).
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
10. History *netrw-history*
|
10. History *netrw-history*
|
||||||
|
|
||||||
|
v73: * bugfix -- scp://host/path/file was getting named incorrectly
|
||||||
|
* netrw detects use of earlier-than-7.0 version of vim and issues
|
||||||
|
a pertinent error message.
|
||||||
|
* netrwSettings.vim is now uses autoloading. Only
|
||||||
|
<netrwPlugin.vim> is needed as a pure plugin
|
||||||
|
(ie. always loaded).
|
||||||
v72: * bugfix -- formerly, one could prevent the loading of netrw
|
v72: * bugfix -- formerly, one could prevent the loading of netrw
|
||||||
by "let g:loaded_netrw=1"; when autoloading became supported,
|
by "let g:loaded_netrw=1"; when autoloading became supported,
|
||||||
this feature was lost. It is now restored.
|
this feature was lost. It is now restored.
|
||||||
@ -1415,7 +1426,7 @@ which is loaded automatically at startup (assuming :set nocp).
|
|||||||
* special file viewing with:
|
* special file viewing with:
|
||||||
(windows) rundll32 url.dll (gnome) gnome-open (kde)
|
(windows) rundll32 url.dll (gnome) gnome-open (kde)
|
||||||
kfmclient If none of these are on the executable path, then
|
kfmclient If none of these are on the executable path, then
|
||||||
NetrwFileHandlers.vim is used.
|
netrwFileHandlers.vim is used.
|
||||||
* directory bookmarking during both local and remote browsing
|
* directory bookmarking during both local and remote browsing
|
||||||
implemented
|
implemented
|
||||||
* one may view all, use the hiding list to suppress, or use the
|
* one may view all, use the hiding list to suppress, or use the
|
||||||
|
43
runtime/syntax/trustees.vim
Normal file
43
runtime/syntax/trustees.vim
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: trustees
|
||||||
|
" Maintainer: Nima Talebi <nima@it.net.au>
|
||||||
|
" Last Change: 2005-10-12
|
||||||
|
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syntax case match
|
||||||
|
syntax sync minlines=0 maxlines=0
|
||||||
|
|
||||||
|
" Errors & Comments
|
||||||
|
syntax match tfsError /.*/
|
||||||
|
highlight link tfsError Error
|
||||||
|
syntax keyword tfsSpecialComment TODO XXX FIXME contained
|
||||||
|
highlight link tfsSpecialComment Todo
|
||||||
|
syntax match tfsComment ~\s*#.*~ contains=tfsSpecialComment
|
||||||
|
highlight link tfsComment Comment
|
||||||
|
|
||||||
|
" Operators & Delimiters
|
||||||
|
highlight link tfsSpecialChar Operator
|
||||||
|
syntax match tfsSpecialChar ~[*!+]~ contained
|
||||||
|
highlight link tfsDelimiter Delimiter
|
||||||
|
syntax match tfsDelimiter ~:~ contained
|
||||||
|
|
||||||
|
" Trustees Rules - Part 1 of 3 - The Device
|
||||||
|
syntax region tfsRuleDevice matchgroup=tfsDeviceContainer start=~\[/~ end=~\]~ nextgroup=tfsRulePath oneline
|
||||||
|
highlight link tfsRuleDevice Label
|
||||||
|
highlight link tfsDeviceContainer PreProc
|
||||||
|
|
||||||
|
" Trustees Rules - Part 2 of 3 - The Path
|
||||||
|
syntax match tfsRulePath ~/[-_a-zA-Z0-9/]*~ nextgroup=tfsRuleACL contained contains=tfsDelimiter
|
||||||
|
highlight link tfsRulePath String
|
||||||
|
|
||||||
|
" Trustees Rules - Part 3 of 3 - The ACLs
|
||||||
|
syntax match tfsRuleACL ~\(:\(\*\|[+]\{0,1\}[a-zA-Z0-9/]\+\):[RWEBXODCU!]\+\)\+$~ contained contains=tfsDelimiter,tfsRuleWho,tfsRuleWhat
|
||||||
|
syntax match tfsRuleWho ~\(\*\|[+]\{0,1\}[a-zA-Z0-9/]\+\)~ contained contains=tfsSpecialChar
|
||||||
|
highlight link tfsRuleWho Identifier
|
||||||
|
syntax match tfsRuleWhat ~[RWEBXODCU!]\+~ contained contains=tfsSpecialChar
|
||||||
|
highlight link tfsRuleWhat Structure
|
Loading…
x
Reference in New Issue
Block a user