Vimでコンパイル

Posted by Ken on 14th, 2009

Vimで編集中のコードをコンパイルして実行したり – Tech Labo
http://d.hatena.ne.jp/techlabo/20080330/1206866935
Vimでコンパイル。
.vimrcに以下を書いておけばよい。

command! Python call s:Python()
nmap :P ython
function! s:Python()
:w
:!python %
endfunction

なるほど。

上記ページにはCやPerlのもありました。

Vimの簡易設定

Posted by Ken on 14th, 2009

Pythonのコードを書くにはこんな感じがよさそう。
Pythonに限らず、プラグインの対応状況からいくとPerlやRubyでも使えそう。

sudo aptitude install vim-full

.vimrc
set nu sw=4 ts=4 sts=4 hlsearch showmatch backspace=indent,eol,start
let g:treeExplVertical=1

autocmd BufRead,BufNewFile *.py syntax on
autocmd BufRead,BufNewFile *.py set ai sw=2 ts=2 sts=2
autocmd BufRead,BufNewFile *.py imap
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class

autocomplpop.vim – vimグループ
http://vim.g.hatena.ne.jp/keyword/autocomplpop.vim
“.”(ドット)を打つと補完してくれます。

vtreeexplorer – tree based file explorer – the original : vim online
http://www.vim.org/scripts/script.php?script_id=184
こっちはvimの左側にファイルをツリー表示してくれる。
.vimrc内の”let g:treeExplVertical=1″はこのオプション。

Search


SUBSCRIBE

  • 最近のコメント

  • カテゴリー

  • タグ

    しろいくも オトノハコ ハルフウェイ マンガ 岩岡 ヒサエ 帰省 広告 望遠鏡 桜井亜美 花粉症 Amazon Android au BeagleBoard blog CMS Compiz Fusion Django DVD Google HT-03A iPhone ISMS Linux LUMIX LUMIX G1 MacBook MySQL Workbench OpenX Poken Python server Software Design SOY CMS TinyMCE Ubuntu Ubuntu 9.04 Vim VirtualBox WordPress wwwsqldesigner XenServer XMind