2010/02/04


これまでvimスクリプトをインストールするには、vim onlineでダウンロードして、書いてあるインストール手順に従って、時にはそのまま、時にはzipを解凍して.vim(windowsならvimfiles)に自前でコピーするのが一般的でした。おそらく自動化されている方もいるかもしれませんが、特有のスクリプト専用の更新ツールくらいかと思います。
Perlを知っている方ならばCPAN、rubyを知っている方ならばgemにあたる物がvimには無かったんです。
配布物が統一されていない為、無理だろうな...とも思ってました。
が、そこに登場したのがVimana(Vim script manager)です。
Vimana(3)             User Contributed Perl Documentation            Vimana(3)



NAME
       Vimana - Vim script manager.

DESCRIPTION
       Vimana is an easy to use system for searching , installing, and
       downloading vim script.

       Vimana provides a command-line interface such like "aptitude" programe
       on Debian linux, for you to search , download , install , upgrade
       scripts from <http://www.vim.org> (vimonline site).

       Vimana can install a vim script package to your vim runtime path
       automatically by inspecting the content of archive file or vim script.
       for example , if an archive file contains 'syntax','plugin','indent'
       directory , then these files should be installed to _______ directory.
       if it's a vim color scheme , then it should be put into ______________
       and prompt for setting the installed colorscheme as default.

       We plan to provide port files via git repository, vimrc customization
       and internationalization in future.

       ( In some modern Indian languages, vimXna or vimXn means "aircraft". )

       NOTE: Vimana only provides search,info,install commmands currently.

       * Getting started from Vimana::Manual.
c9s's Vimana at master - GitHub

Vimana is an easy to use system for searching , installing, and downloading vim script. Vimana provides a command-line interface such like aptitude programe on Debian linux, for you to search , download , install , upgrade scripts from http://www.vim.org (vimonline site).

http://github.com/c9s/Vimana
Vimanaはc9s(Cornelius)さんが作っているPerlスクリプトで、vimスクリプトの検索、情報表示、インストール、ダウンロード、削除が行えるツールです。vimスクリプトは拡張子がvimというだけで、一見そのスクリプトが単なるpluginなのか、はたまたsyntaxなのか、ftpluginなのか分かりません。さらに~/.vim以下の構造になっていればそのまま上書き出来るのですが、中にはvimスクリプトのみ配布されている物もあります。Vimanaはそれをパースして適当なフォルダにインストールしてくれます。
インストールは以下の様に行います。 # git clone git://github.com/c9s/Vimana
# cd Vimana
# perl Makefile.PL
# make
# make test
# make install
ご覧頂ければ分かる様にPerlで出来ています。これでvimanaコマンドがインストールされます。詳しい使い方は # perldoc Vimana::Manual
を参照して下さい。簡単な使い方は以下の通りです。
# vimana update まずインデックスを更新します。そして「gist」というキーワードで検索してみます。 # vimana search gist
regview.vim          - Interactively browse register contents
filetyperegisters    - Localize register contents based on filetype
stackreg             - Vz-like stackable registers
regredir.vim         - Vim plugin to redirect command output into a register
regreplop.vim        - operator to replace motion/visual with a register
registryedit         - Edit the win32 registry through vim.
clipbrd              - Clipboard and other register content editor.
fakeclip             - pseudo clipboard register for non-GUI version of Vim
destructive-paste    - Pastes the register, replacing text
tregisters           - List, edit, and run/execute registers/clipboards
operator-replace     - Operator to replace text with register content
gist.vim             - vimscript for gist
replacewithregister  - Replace text with the contents of a register.
サマリ一覧されて便利ですね。次に手前味噌ですが「gist.vim」をインストールしてみましょう。
# vimana install gist.vim
Plugin will be installed to vim runtime path: /home/mattn/.vim
Canonical name: gist.vim
Downloading from: http://www.vim.org/scripts/download_script.php?src_id=12283
Saving file to /tmp/vimana-imqqdp/gist.vim
Inspecting file content for script type.
Script type found: plugin.
Installing..
Copying /tmp/vimana-imqqdp/gist.vim to /home/mattn/.vim/plugin
Installation Done.
簡単すぎます。
ちなみにpluginフォルダ構成になっているスクリプトでも問題なくインストール出来ます。必要なくなったら # vimana remove gist.vim
とすればアンインストールもやってくれます。
すばらしい... c9s++
こういうのが欲しかったんだと思いました。

実は今日、c9sさんからVimanaのcommit権を貰いました。もちろんWindowsにポーティングさせて頂きました。
メインブランチにはまだ入っていませんが、windowsブランチに入っています。興味のある方はぜひインストールしてみてください。

なおc9sさんは台湾の方です(英語は話せますが)。もしVimanaについて要望などあれば私が日本語窓口させて頂きます。

Posted at by



2010/01/28


vimの入力補完って大変便利なんですが、例えば「あーあの芸能人、名前分かるけどどの漢字だったっけ...」なんて事がたまにあります。
芸能人の名前辞書用意持ってる人なんて見たことないですね。たいがいこういう時はGoogle先生にたよるのが一般的です。
今日はGoogleサジェスト(Google検索で数文字打ったら出てくるあの候補)からvimの補完を行えるスクリプトを書いてみました。

例えばこんな事が出来ます。
googlesuggest-complete-vim1
おもむろに「takasu」と打って、<c-x><c-u>とタイプします。
googlesuggest-complete-vim2

Yes! 高須クリニック!


えっ2番?...うるさい!

便利ですね!

また「watasinonamaeha」(私の名前は)と打って<c-x><c-u>すると...
私の名前はキムサムスン
誰ですか!キムサムスン!

例えば「naitu」なら...
ナイツ お笑い
「www」なら...
www.yahoo.co.jp
「gm」だけで...
gmailへようこそ
... えっ ...

びっ...「vimp」ならば...
vimperator
そして「puri」で...
プリキュア

便利過ぎます!

もうIMEいりません!

どうかお役立て下さい!
mattn's googlesuggest-complete-vim at master - GitHub

complete function using google suggest API. perhaps, you should input japanese without IME.

http://github.com/mattn/googlesuggest-complete-vim
Posted at by




長きに渡り活躍したWIDEプロジェクトのIRCサーバが役割を終えようとしています。そして惜しまれる中、livedoorがIRCサーバの提供をかって出てくれました。
livedoor ラボ「EDGE」 開発日誌 : livedoorからIRCnetへIRCサーバを提供します - livedoor Blog(ブログ)

WIDEプロジェクトIRCワーキンググループによるIRCサーバ運用終了について
という発表がありましたが IPv6を応援し、IRCをこよなく愛するlivedoorは、IRCnetへIRCサーバを提供することを決定しました。
※IPv4とIPv6で利用可能なデュアルスタック環境を用意する予定
※接続数などの仕様は現行と同じです

現在、関係各所と調整を行っているところですが近日中に接続先情報などはお知らせ出来ると思いますので、お待ちください。

宜しくお願いいたします。

http://blog.livedoor.jp/edge_labs/archives/1092902.html
すばらしいですね。これを期にIRCユーザがまた増え出すといいですね。
ぜんぜん関係ないですが、今日はvimからIRC出来るスクリプトを書いてみました。IRCプロトコルを喋るのではなく、freenode.netのウェブインタフェースを叩いています。
curlコマンドを使っているのでお使いのvimがperl拡張(if_perl)やpython拡張(if_python)、ruby拡張(if_ruby)でコンパイルされている必要はありません。Windowsでも動きます。
生のIRCと違い、プロキシさえ通れば防火壁内の人でもvimからIRC出来ます。
一つ問題があるとすれば、クライアントサーバをサポートしたvimである事と起動方法が難しい事。クライアントサーバはUNIX系OSであればgvimで、Windowsであればコマンドライン版でもOKです。クライアントサーバをサポートしているかどうかは、一つvimを起動しておいて
# vim --serverlist とする事で確認出来ます。vimは内部で非同期に生成したプロセスとやりとりするのが苦手なので、vimを2つ使っています。
以下起動手順。
  1. 新しく端末を開きvimを起動する
  2. さらに新しく端末を開きもう一つvimを起動する
  3. 片方のvimで「:Irc」と入力します。
  4. もう片方のvimで「:IrcServer #mychannel mynick」と入力します。
場合により上記vimをgvimで置き換えて下さい。
これで「IrcServer」と入力した側がIRCサーバとなり、「Irc」と入力した側がIRCクライアントになります。内部でremote_expr()による通信をしています。
実際にはサーバがremote_expr()でコンテキスト、発言者、メッセージを飛ばし、受け側であるクライアント側がバッファに追加しています。
Linux版で試した所、若干とろい気もしますが十分楽しめます。(ネタとして)

pureirc-vim
一人で寂しいよー。
どうぞ遊んでやって下さい。
mattn's pureirc-vim at master - GitHub

vimscript for IRC. This make possible to access freenode.net from vim via HTTP protocol. it don't require if_xxx. using 'curl'

http://github.com/mattn/pureirc-vim
Posted at by