Friday, August 27, 2010

Re: Netrw and new file through ftp connection

> Please read  :help netrw-debug and make a debugging trace.  That way we
> can find out exactly what's happening.


Without any own setting, DEcho trace that :


---------
Decho Tab C:\Program Files\Vim\vim72\autoload\netrw.vim
---------
doing autoload/netrw.vim version v140
ssh is not executable
netrw#Nread(mode=2 fname<ftp://mylogin@ftpperso.free.fr/>) {
|netrw#NetrwSavePosn() {
||currently, win#1 line#1 col#1
||netrw#NetrwRestorePosn() a:0=0 winnr=1 line=1 col=1 hline=1 {
|||restore window: exe silent! 1wincmd w
|||restore topofscreen: exe norm! 1G0z
|||restore posn: exe norm! 1G01|
|||return netrw#NetrwRestorePosn }
||return netrw#NetrwSavePosn : winnr=1 line=1 col=1 hline=1 }
|netrw#NetRead(mode=2,...) a:0=1 v140 {
||s:NetrwOptionSave(vt<w:>) win#1 buf#1<ftp:\\mylogin@ftpperso.free.fr
\> winnr($)=1 {
|||w:netrw_optionsave doesn't exist
|||fo=tcq acd=0 diff=0
|||return s:NetrwOptionSave : win#1 buf#1 }
||s:NetrwSafeOptions() win#1 buf#1<ftp:\\mylogin@ftpperso.free.fr\>
winnr($)=1 {
|||win#1's ft=
|||s:NetrwCursorline() liststyle=0 g:netrw_cursorline=1
s:netrw_usercuc=0 s:netrw_usercul=0 {
||||setlocal cursorline
||||return s:NetrwCursorline : l:cursorline=1 l:cursorcolumn=0 }
|||ft<> ei=
|||fo=nroql2 acd=0
|||return s:NetrwSafeOptions }
||s:RestoreCursorline() currently, cul=1 cuc=0 win#1 buf#1 {
|||return s:RestoreCursorline : restored cul=0 cuc=0 }
||readcmd<%r> ichoice=1
||s:GetTempfile(fname<>) {
|||tmpfile<C:\Users\Admin\AppData\Local\Temp\VIAFE8D.tmp> : from
tempname()
|||tmpfile<C:/Users/Admin/AppData/Local/Temp/VIAFE8D.tmp> : chgd any \
-> /
|||tmpfile<C:/Users/Admin/AppData/Local/Temp/VIAFE8D.tmp>
s:netrw_tmpfile<C:/Users/Admin/AppData/Local/Temp/VIAFE8D.tmp>
|||o/s dependent fixed tempname<C:\Users\Admin\AppData\Local\Temp
\VIAFE8D.tmp>
|||ro=0 ma=1 mod=0 wrap=0
|||return s:GetTempfile <C:\Users\Admin\AppData\Local\Temp
\VIAFE8D.tmp> }
||no lastfile: choice<ftp://mylogin@ftpperso.free.fr/>
||choice<ftp://mylogin@ftpperso.free.fr/>
||NetrwMethod(a:choice<ftp://mylogin@ftpperso.free.fr/>) {
|||determine method:
|||ftp://...
|||g:netrw_machine<ftpperso.free.fr>
|||s:FileReadable(fname<C:\Users\Admin\.netrc>) {
||||return s:FileReadable 1 }
|||NetUserPass(a:1<mylogin>) {
||||a:0=1 case <=1:
||||return NetUserPass }
|||a:choice <ftp://mylogin@ftpperso.free.fr/>
|||b:netrw_method <3>
|||g:netrw_machine<ftpperso.free.fr>
|||g:netrw_port <>
|||g:netrw_uid <mylogin>
|||s:netrw_passwd <mypassword>
|||b:netrw_fname <>
|||return NetrwMethod : b:netrw_method=3 }
||s:GetTempfile(fname<>) {
|||tmpfile<C:\Users\Admin\AppData\Local\Temp\VIAFE8D.tmp> re-using
|||ro=0 ma=1 mod=0 wrap=0
|||return s:GetTempfile <C:\Users\Admin\AppData\Local\Temp
\VIAFE8D.tmp> }
||checking if NetrwBrowse() should handle choice<ftp://
mylogin@ftpperso.free.fr/> with netrw_list_cmd<>
||yes, choice matches '^.*[/]$'
||s:NetrwBrowse(islocal=0 dirname<ftp://mylogin@ftpperso.free.fr/>)
liststyle=0 v140 buf#1<ftp:\\mylogin@ftpperso.free.fr\> win#1 {
|||tab#1 win#1
|||redir<ls!>:
|||redir<ls!>: 1 %a "ftp:\\mylogin@ftpperso.free.fr\" ligne 1
|||redir<ls!>: 2u a- "Decho Tab" ligne 0
|||s:NetrwBookHistRead() {
||||sourcing .netrwhist
||||return s:NetrwBookHistRead }
|||s:NetrwOptionSave(vt<w:>) win#1 buf#1<ftp:\\mylogin@ftpperso.free.fr
\> winnr($)=1 {
||||w:netrw_optionsave=1
||||return s:NetrwOptionSave : options already saved }
|||s:UseBufWinVars() {
||||return s:UseBufWinVars }
|||NetrwMenu(domenu=1) {
||||initialize menu
||||return NetrwMenu }
|||s:NetrwGetBuffer(islocal=0 dirname<ftp://mylogin@ftpperso.free.fr/
>) liststyle=0 {
||||--re-use a buffer if possible--
||||--find buffer numnber of buffer named precisely the same as
dirname--
||||redir<ls!>:
||||redir<ls!>: 1 %a "ftp:\\mylogin@ftpperso.free.fr\" ligne 1
||||redir<ls!>: 2u a- "Decho Tab" ligne 0
|||| find buffer<ftp://mylogin@ftpperso.free.fr/>'s number
|||| bufnr(dirname<ftp://mylogin@ftpperso.free.fr/>)=1
|||| findbuf1: bufnum=bufnr('ftp://mylogin@ftpperso.free.fr/')=1
bufname(1
)<ftp:\\mylogin@ftpperso.free.fr\> (initial)
|||| handling approx match: bufnum#1<ftp:\\mylogin@ftpperso.free.fr\>
approx-dirname<ftp://mylogin@ftpperso.free.fr/>
|||| findbuf2: buflast=bufnr($)=2
|||| findbuf3: while [ibuf= 1]<=[buflast=2]: dirname<ftp://
mylogin@ftpperso.free.fr/> bname=bufname(1)<ftp://
mylogin@ftpperso.free.fr>
|||| findbuf3c: passes test 3 : dirname<ftp://
mylogin@ftpperso.free.fr/>=~^ftp://mylogin@ftpperso.free.fr/$
|||| findbuf4: bufnum=1 (ibuf=1 buflast=2)
||||--re-use buffer#1 (bufexists([bufnum=1])=1)
|||| reusing buffer#1<ftp:\\mylogin@ftpperso.free.fr\> using: b 1
||||s:NetrwListSettings(islocal=0) {
|||||setlocal bt=nofile nobl ma nonu nowrap noro
|||||exe sil! keepalt file ftp:\\mylogin@ftpperso.free.fr\
|||||redir<ls!>:
|||||redir<ls!>: 1u%a "ftp:\\mylogin@ftpperso.free.fr\" ligne 1
|||||redir<ls!>: 2u a- "Decho Tab" ligne 0
|||||exe setlocal ts=32
|||||return s:NetrwListSettings }
||||return s:NetrwGetBuffer 0 : re-using buffer#1, but its empty, so
refresh it }
|||2match none
|||set b:netrw_curdir to the new directory name: (buf#1)
|||b:netrw_curdir<ftp://mylogin@ftpperso.free.fr/>
|||remote only:
|||b:netrw_curdir<ftp://mylogin@ftpperso.free.fr/> dirname<ftp://
mylogin@ftpperso.free.fr/>
|||(normal) dirname<ftp://mylogin@ftpperso.free.fr/>
|||b:netrw_curdir<ftp://mylogin@ftpperso.free.fr/> (remote)
|||s:BrowserMaps(islocal=0) b:netrw_curdir<ftp://
mylogin@ftpperso.free.fr/> {
||||make remote maps
||||s:RemotePathAnalysis() {
|||||set up s:method <ftp>
|||||set up s:user <mylogin@>
|||||set up s:machine<ftpperso.free.fr>
|||||set up s:port <>
|||||set up s:path <>
|||||set up s:fname <mylogin@ftpperso.free.fr/>
|||||return s:RemotePathAnalysis }
||||s:SetRexDir(islocal=0 dirname<ftp://mylogin@ftpperso.free.fr/>) {
|||||return s:SetRexDir }
||||return s:BrowserMaps }
|||s:PerformListing(islocal=0) bufnr(%)=1<ftp:\
\mylogin@ftpperso.free.fr\> {
||||s:NetrwSafeOptions() win#1 buf#1<ftp:\\mylogin@ftpperso.free.fr\>
winnr($)=1 {
|||||win#1's ft=
|||||s:NetrwCursorline() liststyle=0 g:netrw_cursorline=1
s:netrw_usercuc=0 s:netrw_usercul=0 {
||||||setlocal cursorline
||||||return s:NetrwCursorline : l:cursorline=1 l:cursorcolumn=0 }
|||||ft<> ei=
|||||fo=nroql2 acd=0
|||||return s:NetrwSafeOptions }
||||setlocal noro ma
||||w:netrw_liststyle=0
||||s:NetrwBookHistHandler(chg=3 curdir<ftp://mylogin@ftpperso.free.fr/
>) cnt=0 histcnt=5 histmax=10 {
|||||(browsing) record curdir history
|||||NetrwBookmarkMenu() histcnt=5 menucnt=28 {
||||||removing Netrw.Bookmarks menu item(s)
||||||silent! menu 80.3.6 Netrw.History.ftp:\/\/mylogin@ftpperso\.free
\.fr\/^I:e ftp:\/\/mylogin@ftpperso\.free\.fr\/
||||||silent! menu 80.3.7 Netrw.History.ftp:\/\/mylogin@ftpperso\.free
\.fr\/phpscript\/^I:e ftp:\/\/mylogin@ftpperso\.free\.fr\/phpscript\/
||||||silent! menu 80.3.8 Netrw.History.ftp:\/\/mylogin@ftpperso\.free
\.fr\/^I:e ftp:\/\/mylogin@ftpperso\.free\.fr\/
||||||silent! menu 80.3.9 Netrw.History.ftp:\/\/mylogin@ftpperso\.free
\.fr\/uploads\/^I:e ftp:\/\/mylogin@ftpperso\.free\.fr\/uploads\/
||||||silent! menu 80.3.10 Netrw.History.ftp:\/\/mylogin@ftpperso\.free
\.fr\/^I:e ftp:\/\/mylogin@ftpperso\.free\.fr\/
||||||return NetrwBookmarkMenu }
|||||return s:NetrwBookHistHandler }
||||set up banner
||||handle specified sorting: g:netrw_sort_by<name>
||||directories will be sorted by name
||||s:netrwmftgt does not exist, don't make Copy/Move Tgt
||||handle hiding/showing (g:netrw_hide= g:netrw_list_hide<>)
||||bannercnt=8 (should index line just after banner) line($)=7
||||set up syntax highlighting
||||Get list of files - islocal=0
||||s:NetrwRemoteListing() b:netrw_curdir<ftp://
mylogin@ftpperso.free.fr/>) {
|||||s:RemotePathAnalysis() {
||||||set up s:method <ftp>
||||||set up s:user <mylogin@>
||||||set up s:machine<ftpperso.free.fr>
||||||set up s:port <>
||||||set up s:path <>
||||||set up s:fname <mylogin@ftpperso.free.fr/>
||||||return s:RemotePathAnalysis }
|||||b:netrw_method=3
|||||setting w:netrw_method<3>
|||||use ftp to get remote file listing
|||||listcmd<dir> (using g:netrw_ftp_list_cmd)
|||||NetrwRemoteFtpCmd(path<> listcmd<dir>) netrw_method=3 {
||||||line($)=7 bannercnt=8
||||||setlocal ma ff=unix noro
||||||exe silent! keepjumps 8,$d (clear off old non-banner lines)
||||||ftp#8: open ftpperso.free.fr
||||||ftp#9: user "mylogin" "mypassword"
||||||ftp#10: dir
||||||exe keepj 8,$!ftp -i -n
||||||return NetrwRemoteFtpCmd }
|||||raw listing: ./
|||||raw listing: ../
|||||raw listing: .htaccess
|||||raw listing: IMGP1813.MOV
|||||generate short listing
|||||line1=8 line2=9 line(.)=8
|||||normal ftp cleanup
|||||listing: ./
|||||listing: ../
|||||listing: .htaccess
|||||listing: IMGP1813.MOV
|||||return s:NetrwRemoteListing }
||||g:netrw_banner=1 w:netrw_bannercnt=8 (banner complete)
||||manipulate directory listing (hide)
||||g:netrw_hide=1 g:netrw_list_hide<>
||||manipulate directory listing (sort) : g:netrw_sort_by<name>
||||SetSort() bannercnt=8 {
|||||priority=1 spriority<001ÿ> seq<[\/]$> seqlist<\.h$,\.c$,\.cpp$,*,
\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$>
|||||priority=2 spriority<002ÿ> seq<\.h$> seqlist<\.c$,\.cpp$,*,\.o$,
\.obj$,\.info$,\.swp$,\.bak$,\~$>
|||||priority=3 spriority<003ÿ> seq<\.c$> seqlist<\.cpp$,*,\.o$,\.obj$,
\.info$,\.swp$,\.bak$,\~$>
|||||priority=4 spriority<004ÿ> seq<\.cpp$> seqlist<*,\.o$,\.obj$,
\.info$,\.swp$,\.bak$,\~$>
|||||priority=5 spriority<005ÿ> seq<*> seqlist<\.o$,\.obj$,\.info$,
\.swp$,\.bak$,\~$>
|||||priority=6 spriority<006ÿ> seq<\.o$> seqlist<\.obj$,\.info$,\.swp
$,\.bak$,\~$>
|||||priority=7 spriority<007ÿ> seq<\.obj$> seqlist<\.info$,\.swp$,
\.bak$,\~$>
|||||priority=8 spriority<008ÿ> seq<\.info$> seqlist<\.swp$,\.bak$,\~
$>
|||||priority=9 spriority<009ÿ> seq<\.swp$> seqlist<\.bak$,\~$>
|||||priority=10 spriority<010ÿ> seq<\.bak$> seqlist<\~$>
|||||priority=11 spriority<011ÿ> seq<\~$> seqlist<>
|||||return SetSort }
||||g:netrw_sort_direction=normal (bannercnt=8)
||||remove priority pattern prefix
||||modify display if wide/tree listing style
||||place cursor on top-left corner of file listing
||||record netrw_prvdir<ftp://mylogin@ftpperso.free.fr/>
||||s:SetBufWinVars() win#1 {
|||||return s:SetBufWinVars }
||||s:NetrwOptionRestore(vt<w:>) win#1 buf#1 winnr($)=1 {
|||||g:netrw_keepdir=1: getcwd<C:\Program Files\Vim\vim72> acd=0
|||||g:netrw_keepdir=1: getcwd<C:\Program Files\Vim\vim72> acd=0
|||||fo=tcq acd=0
|||||ro=0 ma=1 mod=0 wrap=0
|||||diff=0 win#1 w:netrw_diffkeep=doesn't exist
|||||return s:NetrwOptionRestore : win#1 buf#1 }
||||set display to netrw display settings (noma nomod etc)
||||return s:PerformListing : curpos<[0, 8, 1, 0]> }
|||ro=1 ma=0 mod=0 wrap=0
|||return s:NetrwBrowse : did PerformListing }
||return netrw#NetRead :3 getcwd<C:\Program Files\Vim\vim72> }
|netrw#NetrwRestorePosn() a:0=0 winnr=1 line=1 col=1 hline=1 {
||restore window: exe silent! 1wincmd w
||restore topofscreen: exe norm! 1G0z
||restore posn: exe norm! 1G01|
||return netrw#NetrwRestorePosn }
|return netrw#Nread }

and it works but I have to type my password.

------------------

With this line in my vimrc it fails.

let g:netrw_ftp_cmd= "c:/Windows/System32/ftp -s:" . $home . "/
ftpconnect.ftp ftpperso.free.fr"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: