[]Gist.vim

gistを友人に進められて使ってみたが、細々したコード群を管理するのには本当に便利。ただ任意のリビジョンを消せないのが不便。デリート機能付けてくれないだろうか。

Gist.vim

vim上でソースコードをgistとやりとりできるplugin。

インストール方法

まずgitとcurlをインストール

[cc line_numbers="off"]
$ sudo apt-get install git-core
$ sudo apt-get install curl
[/cc]

Gist.vimをダウンロード。

後の設定は親切な人が書いてくれた以下の説明が詳しい。

gitを使ったことがないのでconfigファイルの設定の部分は非常に助かった。

[cc line_numbers="off"]
1. Vim をインストールしておく
2. "~/.vim/plugin" がなければ掘っておく
3. mattn 氏作の Gist.vim を "~/.vim/plugin" にダウンロードする
http://www.vim.org/scripts/script.php?script_id=2423
4. github のアカウントを取得しておく ( 取っておいた方が後々便利 )
5. github にログイン
6. Account Settings の Administrative Information の Username と API Token をコピっておく
7. $ git config --global github.user Username
8. $ git config --global github.token API Token
9. .vimrc に以下の行を追加
let g:gist_clip_command = 'xclip -selection clipboard'
let g:gist_detect_filetype = 1
let g:gist_open_browser_after_post = 1
let g:gist_browser_command = 'firefox %URL% &'
10. vim 上でテキストを編集する
( ファイル名を指定して Vim を起動すればこのテキストのようにファイル名をつけることができる )
11. :Gist コマンドで gist に post
12. その他のコマンドは Gist.vim のページを参照
http://www.vim.org/scripts/script.php?script_id=2423
[/cc]

http://gist.github.com/414330