Mercurial > vim
comparison runtime/autoload/netrw.vim @ 841:c2cae213194d v7.0e07
updated for version 7.0e07
author | vimboss |
---|---|
date | Sun, 23 Apr 2006 22:40:29 +0000 |
parents | 1f3b1021f002 |
children | a209672376fd |
comparison
equal
deleted
inserted
replaced
840:2c885fab04e3 | 841:c2cae213194d |
---|---|
1 " netrw.vim: Handles file transfer and remote directory listing across a network | 1 " netrw.vim: Handles file transfer and remote directory listing across a network |
2 " AUTOLOAD PORTION | 2 " AUTOLOAD PORTION |
3 " Date: Apr 21, 2006 | 3 " Date: Apr 21, 2006 |
4 " Version: 91 | 4 " Version: 92 |
5 " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> | 5 " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> |
6 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim | 6 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim |
7 " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 | 7 " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 |
8 " Permission is hereby granted to use and distribute this code, | 8 " Permission is hereby granted to use and distribute this code, |
9 " with or without modifications, provided that this copyright | 9 " with or without modifications, provided that this copyright |
21 | 21 |
22 " Exception for &cp: {{{1 | 22 " Exception for &cp: {{{1 |
23 if &cp || exists("g:loaded_netrw") | 23 if &cp || exists("g:loaded_netrw") |
24 finish | 24 finish |
25 endif | 25 endif |
26 let g:loaded_netrw = "v91" | 26 let g:loaded_netrw = "v92" |
27 if v:version < 700 | 27 if v:version < 700 |
28 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None | 28 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None |
29 finish | 29 finish |
30 endif | 30 endif |
31 let s:keepcpo= &cpo | 31 let s:keepcpo= &cpo |
3521 endif | 3521 endif |
3522 call s:CopyWinVars() | 3522 call s:CopyWinVars() |
3523 endif | 3523 endif |
3524 norm! 0 | 3524 norm! 0 |
3525 | 3525 |
3526 if a:1 =~ '\*/' | 3526 if a:1 =~ '^\*/' |
3527 " Explore */pattern | 3527 " Explore */pattern |
3528 let pattern= substitute(a:1,'^\*/\(.*\)$','\1','') | 3528 let pattern= substitute(a:1,'^\*/\(.*\)$','\1','') |
3529 " call Decho("Explore */".pattern) | 3529 " call Decho("Explore */pat: a:1<".a:1."> -> pattern<".pattern.">") |
3530 elseif a:1 =~ '^\*\*//' | |
3531 " Explore **//pattern | |
3532 let pattern = substitute(a:1,'^\*\*//','','') | |
3533 let starstarpat = 1 | |
3534 " call Decho("Explore **//pat: a:1<".a:1."> -> pattern<".pattern.">") | |
3530 endif | 3535 endif |
3531 | 3536 |
3532 if a:1 == "" && a:indx >= 0 | 3537 if a:1 == "" && a:indx >= 0 |
3533 " Explore Hexplore Vexplore Sexplore | 3538 " Explore Hexplore Vexplore Sexplore |
3534 " call Decho("Explore Hexplore Vexplore Sexplore") | 3539 " call Decho("Explore Hexplore Vexplore Sexplore") |
3554 if has("path_extra") | 3559 if has("path_extra") |
3555 if !exists("w:netrw_explore_indx") | 3560 if !exists("w:netrw_explore_indx") |
3556 let w:netrw_explore_indx= 0 | 3561 let w:netrw_explore_indx= 0 |
3557 endif | 3562 endif |
3558 let indx = a:indx | 3563 let indx = a:indx |
3559 " call Decho("input indx=".indx) | 3564 " call Decho("set indx=".indx) |
3560 " | 3565 " |
3561 if indx == -1 | 3566 if indx == -1 |
3567 "Nexplore | |
3562 if !exists("w:netrw_explore_list") " sanity check | 3568 if !exists("w:netrw_explore_list") " sanity check |
3563 echohl WarningMsg | echo "***netrw*** using Nexplore or <s-down> improperly; see help for netrw-starstar" | echohl None | 3569 echohl WarningMsg | echo "***netrw*** using Nexplore or <s-down> improperly; see help for netrw-starstar" | echohl None |
3564 call inputsave()|call input("Press <cr> to continue")|call inputrestore() | 3570 call inputsave()|call input("Press <cr> to continue")|call inputrestore() |
3565 " call Dret("Explore") | 3571 " call Dret("Explore") |
3566 return | 3572 return |
3567 endif | 3573 endif |
3568 let indx= w:netrw_explore_indx + 1 | 3574 let indx = w:netrw_explore_indx |
3569 " call Decho("indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx) | 3575 let curfile= w:netrw_explore_list[indx] |
3576 while indx < w:netrw_explore_listlen && curfile == w:netrw_explore_list[indx] | |
3577 let indx= indx + 1 | |
3578 " call Decho("indx=".indx) | |
3579 endwhile | |
3580 " call Decho("Nexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx) | |
3570 | 3581 |
3571 elseif indx == -2 | 3582 elseif indx == -2 |
3583 "Pexplore | |
3572 if !exists("w:netrw_explore_list") " sanity check | 3584 if !exists("w:netrw_explore_list") " sanity check |
3573 echohl WarningMsg | echo "***netrw*** using Pexplore or <s-up> improperly; see help for netrw-starstar" | echohl None | 3585 echohl WarningMsg | echo "***netrw*** using Pexplore or <s-up> improperly; see help for netrw-starstar" | echohl None |
3574 call inputsave()|call input("Press <cr> to continue")|call inputrestore() | 3586 call inputsave()|call input("Press <cr> to continue")|call inputrestore() |
3575 " call Dret("Explore") | 3587 " call Dret("Explore") |
3576 return | 3588 return |
3577 endif | 3589 endif |
3578 let indx= w:netrw_explore_indx - 1 | 3590 let indx = w:netrw_explore_indx |
3579 " call Decho("indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx) | 3591 let curfile= w:netrw_explore_list[indx] |
3592 while indx > 0 && curfile == w:netrw_explore_list[indx] | |
3593 let indx= indx - 1 | |
3594 endwhile | |
3595 " call Decho("Pexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx) | |
3580 | 3596 |
3581 else | 3597 else |
3598 " Explore -- initialize | |
3582 " build list of files to Explore with Nexplore/Pexplore | 3599 " build list of files to Explore with Nexplore/Pexplore |
3583 let w:netrw_explore_indx = 0 | 3600 " call Decho("Explore -- initialize") |
3601 let w:netrw_explore_indx= 0 | |
3584 if !exists("b:netrw_curdir") | 3602 if !exists("b:netrw_curdir") |
3585 let b:netrw_curdir= getcwd() | 3603 let b:netrw_curdir= getcwd() |
3586 endif | 3604 endif |
3587 " call Decho("b:netrw_curdir<".b:netrw_curdir.">") | 3605 " call Decho("b:netrw_curdir<".b:netrw_curdir.">") |
3588 if exists("pattern") | 3606 if exists("pattern") |
3589 " call Decho("building list based on pattern<".pattern."> cwd<".getcwd().">") | 3607 " call Decho("building list based on pattern<".pattern."> cwd<".getcwd().">") |
3590 exe "vimgrep /".pattern."/gj ".b:netrw_curdir."/*" | 3608 if exists("starstarpat") |
3591 let w:netrw_explore_list = map(getqflist(),'b:netrw_curdir.bufname(v:val.bufnr)') | 3609 exe "vimgrep /".pattern."/gj "."**/*" |
3610 let s:netrw_curdir= b:netrw_curdir | |
3611 let w:netrw_explore_list = map(getqflist(),'s:netrw_curdir."/".bufname(v:val.bufnr)') | |
3612 else | |
3613 exe "vimgrep /".pattern."/gj ".b:netrw_curdir."/*" | |
3614 if (has("win32") || has("win95") || has("win64") || has("win16")) | |
3615 let w:netrw_explore_list = map(getqflist(),'bufname(v:val.bufnr)') | |
3616 else | |
3617 let w:netrw_explore_list = map(getqflist(),'b:netrw_curdir.bufname(v:val.bufnr)') | |
3618 endif | |
3619 endif | |
3592 else | 3620 else |
3593 " call Decho("building list based on ".b:netrw_curdir."/".a:1) | 3621 " call Decho("building list based on ".b:netrw_curdir."/".a:1) |
3594 let w:netrw_explore_list= split(expand(b:netrw_curdir."/".a:1),'\n') | 3622 let w:netrw_explore_list= split(expand(b:netrw_curdir."/".a:1),'\n') |
3595 endif | 3623 endif |
3596 | 3624 |