<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>uprush &#187; file explore</title>
	<atom:link href="http://uprush.net/tag/file-explore/feed/" rel="self" type="application/rss+xml" />
	<link>http://uprush.net</link>
	<description>YiFeng's Blog</description>
	<lastBuildDate>Wed, 03 Feb 2010 14:34:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Vimでシステム開発 &#8212; FileとBufferのExplore</title>
		<link>http://uprush.net/2009/05/vim%e3%81%a7%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e9%96%8b%e7%99%ba-file%e3%81%a8buffer%e3%81%aeexplore/</link>
		<comments>http://uprush.net/2009/05/vim%e3%81%a7%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e9%96%8b%e7%99%ba-file%e3%81%a8buffer%e3%81%aeexplore/#comments</comments>
		<pubDate>Sun, 17 May 2009 13:14:48 +0000</pubDate>
		<dc:creator>uprush</dc:creator>
				<category><![CDATA[vim]]></category>
		<category><![CDATA[file explore]]></category>

		<guid isPermaLink="false">http://blog.uprush.net/?p=241</guid>
		<description><![CDATA[開発を行う際、色んなファイルをエクスプローします。今回はVimの File Explore Plugを紹介します。


 File の Explore

Vim 7.0以前のバージョンでは、ファイルのエクスプローはexplorer.vimプラグインより提供しましたが、Vim 7.0から、netrw.vimプラグインが標準な実装となりました。今回はこのnetrwを紹介します。
netrwはVim 7.0の標準プラグインで、別でインストール必要がありません。
まずはnetrwの機能を試して見ましょう。Vimでフォルダを開こうとする時、Vimは自動的にnetrwを使ってフォルダを開きます（フォルダも特殊なファイルの一種）。
例、Vimで下記コマンドを実行すると、以下の画面が表示されます。&#160;  &#160; 


:e&#160;~src/vim71/src&#160;&#160;

:e ~src/vim71/src

&#160;

:e ~src/vim71/src


:e ~src/vim71/src


上記ウィンドはファイル・エクスプローラとよく似ています。ファイルとフォルダの作成、削除、リネームができます。フォルダの上Enterを押せば、該当 フォルダに移動します。ファイルの上Enterを押せば、Vimがそのファイルを開きます。netrwで、ファイルのソート順と表示スタールも変更できま す。

netrw のよく使うコマンド



&#60;F1&#62;
ヘルプを表示


&#60;CR&#62;
カーソルの下はフォルダであればフォルダへ移動、ファイルであればファイルを開く


-
上へ


c
Vimの作業フォルダを現在表示しているフォルダにする


d
フォルダを作成する


D
ファイルまたはフォルダを削除する


i
表示スタイルを切り替える


R
ファイルまたはフォルダの名前を変更する


s
ソート順を切り替える


x
指定されたアプリケーションでファイルを開く



ほかの機能、例えばブックマーク、ファイルの隠しなどについては、netrwのヘルプを参照してください。
先は「:e ~src/vim71/src」コマンドでnetrwを起動しましたが、「:Explore」コマンドもファイル・エクスプローラを開くことができます。私のvimrcにはこう書いてあります。   

let&#160;g:netrw_list_hide=&#160;&#8217;^\..*,&#160;*.swp&#8217;&#160;
nmap&#160;&#60;BS&#62;&#160;:Explore&#60;cr&#62;&#160;

let g:netrw_list_hide= &#8217;^\..*, *.swp&#8217; nmap &#60;BS&#62; :Explore

&#160;
そうすると、BackSpaceキーを押せば、今開いたファイルのあるフォルダを開き、隠しファイル（.xxx）とswpファイルが表示されません。
ローカル端末のファイル・エクスプローはnetrwの機能の一部に過ぎません、netrwのメイン機能はリモート・ファイルのエクスプローです。 netrwを利用し、ftp、ssh、httpなどのプロトコルでリモート端末のファイルとフォルダをエクスプローできます。詳しくはnetrwのヘルプ で。
&#160;

BufferのExplore

開発する際、数多いのバッファを開きます。特にtagを利用して異なるファイルの間でジャンプする時、気づかないうちに色んなファイルの開きました。バッファ内容を見るのは「:ls」コマンドを利用します。
もっと便利な方法があります、BufExplorerプラグインを利用します。
http://vim.sourceforge.net/scripts/script.php?script_id=42 からBufExplorerをダウンロードし、~/.vim フォルダに解凍します（Windowsの場合は$VIM/vimfilesまたは$HOME/vimfiles）。
Vimを起動して、ヘルプtagを生成します。  &#160; 


:helptags&#160;~/.vim/doc&#160;

:helptags ~/.vim/doc

&#160;
その後、「:help bufexplorer」コマンドでBufExplorerのヘルプを表示します。
BufExplorerの使用はシンプルです。



:BufExplorer
バッファ一覧を表示する


,be
「:BufExplorer」コマンドのショットカット



バッファ一覧の項目上Enterを押せば、該当バッファを編集します。
BufExplorerのイメージ

&#160;
もう一つminibufexplというプラグインがあります、このプラグインは画面の上部に小さいウィンドを開いてバッファの一覧を表示します。私は画面を分割のは好きでないから、minibufexplを使っていません。
minibufexplのイメージ

&#160;
関連ヘルプ

:help&#160;netrw-browse&#160;
:help&#160;bufexplorer&#160;

:help netrw-browse :help bufexplorer

&#160;
]]></description>
		<wfw:commentRss>http://uprush.net/2009/05/vim%e3%81%a7%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e9%96%8b%e7%99%ba-file%e3%81%a8buffer%e3%81%aeexplore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
