comparison runtime/doc/pi_netrw.txt @ 12:bdeee1504ac1

updated for version 7.0004
author vimboss
date Fri, 02 Jul 2004 15:38:35 +0000
parents 4424b47a0797
children 631143ac4a01
comparison
equal deleted inserted replaced
11:4424b47a0797 12:bdeee1504ac1
15 3. Activation..........................................|netrw-activate| 15 3. Activation..........................................|netrw-activate|
16 4. Transparent File Transfer...........................|netrw-transparent| 16 4. Transparent File Transfer...........................|netrw-transparent|
17 5. Ex Commands.........................................|netrw-ex| 17 5. Ex Commands.........................................|netrw-ex|
18 6. Variables and Options...............................|netrw-var| 18 6. Variables and Options...............................|netrw-var|
19 7. Remote Directory Browser............................|netrw-browse| 19 7. Remote Directory Browser............................|netrw-browse|
20 ?..........Help....................................|netrw-help|
21 <cr>.......Browsing................................|netrw-cr|
22 <c-l>......Refreshing the Listing..................|netrw-c-l|
23 <del>......Removing Files or Directories...........|netrw-delete|
24 D..........Removing Files or Directories...........|netrw-D|
25 R..........Renaming Files or Directories...........|netrw-R|
26 -..........Going Up................................|netrw--|
27 a..........Hiding Files or Directories.............|netrw-a|
28 h..........Edit File/Directory Hiding..............|netrw-h|
29 o..........Browsing with a Horizontal Split........|netrw-o|
30 r..........Reversing Sorting Order.................|netrw-r|
31 s..........Selecting Sorting Style.................|netrw-s|
32 v..........Browsing with a Vertical Split..........|netrw-v|
33 x..........Customizing Browsing....................|netrw-x|
20 8. Debugging...........................................|netrw-debug| 34 8. Debugging...........................................|netrw-debug|
21 9. History.............................................|netrw-history| 35 9. History.............................................|netrw-history|
22 10. Credits.............................................|netrw-credits| 36 10. Credits.............................................|netrw-credits|
23 37
24 The functionality mentioned here is done via using |standard-plugin| 38 The functionality mentioned here is done via using |standard-plugin|
412 g:netrw_rsync_cmd variable ="rsync -a" 426 g:netrw_rsync_cmd variable ="rsync -a"
413 g:netrw_scp_cmd variable ="scp -q" 427 g:netrw_scp_cmd variable ="scp -q"
414 g:netrw_sftp_cmd variable ="sftp" > 428 g:netrw_sftp_cmd variable ="sftp" >
415 ------------------------------------------------------------------------- 429 -------------------------------------------------------------------------
416 < 430 <
431 *netrw-ftp*
417 The first two options both help with certain ftp's that give trouble otherwise. 432 The first two options both help with certain ftp's that give trouble otherwise.
418 In order to best understand how to use these options if ftp is giving you 433 In order to best understand how to use these options if ftp is giving you
419 troubles, a bit of discussion follows on how netrw does ftp reads. 434 troubles, a bit of discussion follows on how netrw does ftp reads.
420 435
421 The g:netrw_..._cmd variables specify the external program to use handle 436 The g:netrw_..._cmd variables specify the external program to use handle
452 The temporary file is then read into the main editing session window that 467 The temporary file is then read into the main editing session window that
453 requested it and the temporary file deleted. 468 requested it and the temporary file deleted.
454 469
455 If your ftp doesn't accept the "user" command and immediately just demands 470 If your ftp doesn't accept the "user" command and immediately just demands
456 a userid, then try putting "let netrw_ftp=1" in your <.vimrc>. 471 a userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
472
473 *netrw-cadaver*
474 To handle the SSL certificate dialog for untrusted servers, one may pull
475 down the certificate and place it into /usr/ssl/cert.pem. This operation
476 renders the server treatment as "trusted".
457 477
458 *netrw-fixup* 478 *netrw-fixup*
459 If your ftp for whatever reason generates unwanted lines (such as AUTH 479 If your ftp for whatever reason generates unwanted lines (such as AUTH
460 messages) you may write a NetReadFixup(tmpfile) function: 480 messages) you may write a NetReadFixup(tmpfile) function:
461 > 481 >
491 endfunction 511 endfunction
492 endif 512 endif
493 > 513 >
494 514
495 ============================================================================== 515 ==============================================================================
496 7. Remote Directory Browser *netrw-browse* *netrw-dir* *netrw-list* 516 7. Remote Directory Browser *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
497 > 517 >
498 ------- -----------
499 Command Explanation 518 Command Explanation
500 ------- ----------- 519 ------- -----------
520 ? Causes Netrw to issue help
501 <cr> Netrw will enter the directory or read the file 521 <cr> Netrw will enter the directory or read the file
502 <del> Netrw will attempt to remove the file/directory 522 <del> Netrw will attempt to remove the file/directory
523 <c-l> Causes Netrw to refresh the directory listing
503 D Netrw will attempt to remove the file(s)/directory(ies) 524 D Netrw will attempt to remove the file(s)/directory(ies)
504 R Netrw will attempt to rename the file(s)/directory(ies) 525 R Netrw will attempt to rename the file(s)/directory(ies)
505 - Makes Netrw go up one directory 526 - Makes Netrw go up one directory
506 a Show all of a directory (temporarily ignore g:netrw_list_hide) 527 a Show all of a directory (temporarily ignore g:netrw_list_hide)
528 h Edit file hiding list
507 o Enter the file/directory under the cursor in a new browser 529 o Enter the file/directory under the cursor in a new browser
508 window. A horizontal split is used. 530 window. A horizontal split is used.
531 r Reverse sorting order
532 s Select sorting style: by name, time, or file size
509 v Enter the file/directory under the cursor in a new browser 533 v Enter the file/directory under the cursor in a new browser
510 window. A vertical split is used. 534 window. A vertical split is used.
511 x Apply a function to a file. 535 x Apply a function to a file.
512 <c-l> Causes Netrw to refresh the directory listing
513 ? Causes Netrw to issue help
514 < 536 <
515 *netrw-browse-var* 537 *netrw-browse-var*
516 > 538 >
517 --- ----------- 539 --- -----------
518 Var Explanation 540 Var Explanation
522 g:netrw_rmf_cmd supports removing softlinks to directories 544 g:netrw_rmf_cmd supports removing softlinks to directories
523 g:netrw_rmdir_cmd supports removing directories 545 g:netrw_rmdir_cmd supports removing directories
524 g:netrw_winsize specify initial size of new o/v windows 546 g:netrw_winsize specify initial size of new o/v windows
525 g:netrw_list_hide comma separated list of patterns for 547 g:netrw_list_hide comma separated list of patterns for
526 hiding files 548 hiding files
527 < 549 g:netrw_sort_by sort by "name", "time", or "size"
550 g:netrw_sort_direction sorting direction: "normal" or "reverse"
551 g:netrw_sort_sequence when sorting by name, first sort by the
552 comma-separated pattern sequence
553 <
554 INTRODUCTION TO REMOTE DIRECTORY BROWSING
555
528 Netrw supports the browsing of directories on remote hosts, including 556 Netrw supports the browsing of directories on remote hosts, including
529 generating listing directories, entering directories, editing files 557 generating listing directories, entering directories, editing files therein,
530 therein, deleting files/directories, and moving (renaming) files and 558 deleting files/directories, and moving (renaming) files and directories. The
531 directories. 559 Netrw browser generally implements the file explorer methods but for remote
560 directories, although details (such as pertinent global variable names)
561 necessarily differ.
532 562
533 To enter the netrw directory browser, simply attempt to read a "file" with a 563 To enter the netrw directory browser, simply attempt to read a "file" with a
534 trailing slash and it will be interpreted as a request to list a directory: 564 trailing slash and it will be interpreted as a request to list a directory:
535 565
536 vim [protocol]://[user@]hostname/path/ 566 vim [protocol]://[user@]hostname/path/
537 567
538 Netrw will modify the command in g:netrw_list_cmd to perform the directory 568
569 REFRESHING THE LISTING *netrw-c-l*
570
571 To refresh the directory listing, press ctrl-l (<c-l>) or hit the <cr>
572 when atop the ./ directory entry in the listing.
573
574
575 GOING UP *netrw--*
576
577 To go up a directory, press - or his the <cr> when atop the ../ directory
578 entry in the listing.
579
580 Netrw will modify the command in *g:netrw_list_cmd* to perform the directory
539 listing operation. By default the command is: 581 listing operation. By default the command is:
540 582
541 ssh HOSTNAME ls -FLa 583 ssh HOSTNAME ls -FLa
542 584
543 where the HOSTNAME becomes the [user@]hostname as requested by the attempt 585 where the HOSTNAME becomes the [user@]hostname as requested by the attempt
544 to read. Naturally, the user may override this command with whatever is 586 to read. Naturally, the user may override this command with whatever is
545 preferred. The NetList function which implements remote directory 587 preferred. The NetList function which implements remote directory
546 browsing expects that directories will be flagged by a trailing slash. 588 browsing expects that directories will be flagged by a trailing slash.
547 589
590
591 BROWSING *netrw-cr*
592
548 Browsing is simple: move the cursor onto a file or directory of interest. 593 Browsing is simple: move the cursor onto a file or directory of interest.
549 Hitting the <cr> (the return key) will select the file or directory. 594 Hitting the <cr> (the return key) will select the file or directory.
550 Directories will themselves be listed, and files will be opened using the 595 Directories will themselves be listed, and files will be opened using the
551 protocol given in the original read request. 596 protocol given in the original read request.
552 597
553 *netrw-delete* *netrw-remove* 598
599 REMOVING FILES OR DIRECTORIES *netrw-delete* *netrw-remove* *netrw-D*
554 600
555 Deleting/removing files and directories involves moving the cursor to the 601 Deleting/removing files and directories involves moving the cursor to the
556 file/directory to be deleted and pressing "D". Directories must be empty 602 file/directory to be deleted and pressing "D". Directories must be empty first
557 first before they can be successfully removed. If the directory is a softlink 603 before they can be successfully removed. If the directory is a softlink to a
558 to a directory, then netrw will make two requests to remove the directory 604 directory, then netrw will make two requests to remove the directory before
559 before succeeding. Netrw will ask for confirmation before doing the 605 succeeding. Netrw will ask for confirmation before doing the removal(s).
560 removal(s). You may select a range of lines with the "V" command (visual 606 You may select a range of lines with the "V" command (visual selection),
561 selection), and then pressing "D". 607 and then pressing "D".
562 608
563 The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are 609 *g:netrw_rm_cmd*
564 used to control the attempts to remove files and directories. The 610 The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used
565 g:netrw_rm_cmd is used with files, and its default value is: 611 to control the attempts to remove files and directories. The g:netrw_rm_cmd
612 is used with files, and its default value is:
566 613
567 g:netrw_rm_cmd: ssh HOSTNAME rm 614 g:netrw_rm_cmd: ssh HOSTNAME rm
568 615
569 The g:netrw_rmdir_cmd is used with directories. Its default value is: 616 *g:netrw_rmdir_cmd*
617 The g:netrw_rmdir_cmd variable is used to support the removal of directories.
618 Its default value is:
570 619
571 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir 620 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
572 621
622 *g:netrw_rmf_cmd*
573 If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt 623 If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
574 to remove it again using the g:netrw_rmf_cmd. Its default value is: 624 to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
575 625
576 g:netrw_rmf_cmd: ssh HOSTNAME rm -f 626 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
577 627
578 *netrw-x* 628
579 629 RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename*
580 The Netrw executor applies a user-defined function to a file, based on its
581 extension. Of course, the handler function must exist for it to be called.
582 >
583 Ex. mypgm.html x -> NetrwFileHandler_html("scp://user@host/some/path/mypgm.html")
584 <
585 See the <NetrwFileHandlers.vim>
586
587 *netrw-move* *netrw-rename*
588 630
589 Renaming/moving files and directories involves moving the cursor to the 631 Renaming/moving files and directories involves moving the cursor to the
590 file/directory to be moved (renamed) and pressing "R". You will then be 632 file/directory to be moved (renamed) and pressing "R". You will then be
591 queried for where you want the file/directory to be moved. You may select a 633 queried for where you want the file/directory to be moved. You may select a
592 range of lines with the "V" command (visual selection), and then pressing "R". 634 range of lines with the "V" command (visual selection), and then pressing "R".
593 635
594 The g:netrw_rename_cmd is used to implement renaming. By default its 636 The g:netrw_rename_cmd variable is used to implement renaming. By default its
595 value is: 637 value is:
596 638
597 ssh HOSTNAME mv 639 ssh HOSTNAME mv
598 640
599 *netrw-list-hack* 641
642 HIDING FILES OR DIRECTORIES *g:netrw_a* *g:netrw_list_hide*
643
644 The "a" map lets the browser ignore the g:netrw_list_hide variable. Normally
645 the g:netrw_list_hide variable holds a comma separated list of patterns which
646 will be hidden (removed) from the directory listing.
647
648
649 EDIT FILE OR DIRECTORY HIDING *netrw-h*
650
651 The "h" map brings up a requestor allowing the user to change the
652 file/directory hiding list.
653
654
655 BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o*
656
657 Normally one enters a file or directory using the <cr>. However, the "o"
658 map allows one to open a new window to hold the new directory listing or
659 file. A horizontal split is used. (also see |netrw-v|)
660
661
662 SELECTING SORTING STYLE *netrw-s*
663
664 One may select the sorting style by name, time, or (file) size. The
665 "s" map allows one to circulate among the three choices; the directory
666 listing will automatically be refreshed to reflect the selected style.
667
668
669 REVERSING SORTING ORDER *netrw-r*
670
671 One may toggle between normal and reverse sorting order by pressing the
672 "r" key.
673
674
675 BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
676
677 Normally one enters a file or directory using the <cr>. However, the "v"
678 map allows one to open a new window to hold the new directory listing or
679 file. A vertical split is used. (also see |netrw-o|)
680
681
682 CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x*
683
684 One may "enter" a file with a special handler, thereby firing up a browser or
685 other application, for example, on a file by hitting the "x" key. Presumably
686 one could write handlers that would start OpenOffice programs (oowriter), etc,
687 based on the file's extension coupled with the user's hitting the "x" key atop
688 the file.
689
690 The Netrw executor applies a user-defined function to a file, based on its
691 extension. Of course, the handler function must exist for it to be called!
692 >
693 Ex. mypgm.html x ->
694 NetrwFileHandler_html("scp://user@host/some/path/mypgm.html")
695 <
696 See the <plugin/NetrwFileHandlers.vim> for an example of how to handle an html
697 file with mozilla.
698
699
700 IMPROVING DIRECTORY BROWSING *netrw-list-hack*
701
702 Especially with the remote directory browser, constantly entering the password
703 is tedious.
704
600 For Linux/Unix systems, I suggest looking into 705 For Linux/Unix systems, I suggest looking into
601 706
602 http://hacks.oreilly.com/pub/h/66 707 http://hacks.oreilly.com/pub/h/66
603 708
604 It gives a tip for setting up password-less use of ssh and scp, and discusses 709 It gives a tip for setting up password-less use of ssh and scp, and discusses