普段 Vim で Ruby を書いているのですが,そういえば Ruby を書くのを補助する Vim プラグイン少ないなぁと思って先月は Ruby プラグイン作成月間にしてみました. 本エントリでは僕が作成した3つのプラグインを紹介します. unite-ruby-require.vim require 対象の補完をする unite.vim ソース. neco-ruby-keyword-args neocomplcache で Ruby 2.0 のキーワード引数を補完 vim-textobj-ruby Ruby のブロックをテキストオブジェクト化 unite-ruby-require.vim Ruby で外部のソースを読み込むのに使う require ですが,標準だけでも大量のライブラリがあり,なかなか全部覚えるのは大変です. そこで,unite.vim で require の候補をインクリメ
MacVim-KaoriYa は ruby 1.8 と ruby 1.9.x に同時対応していて、環境変数に従って libruby.dylib が遅延動的ロードされます (参考)。 使用する ruby のバージョンを rvm などで適宜変更する環境を使っている場合、.vimrc に性的静的な設定をしてしまうと、シェルでは trunk だけど vim では 1.9.2 だったりして不便な場合があるでしょう *1。 もし、vim を起動したシェルでの現在の ruby コマンドと同じバージョンの ruby を vim でも使用したい場合は、以下のような設定を .vimrc に書き加えましょう。 *1:逆に、vim がリンクする ruby のバージョンがコロコロ変化する方が困るケースも確実にあると思います
音の鳴るエディタが便利だけど使うと Vim が死ぬほど重くなる。適当に軽量化した。 ~/bin/vim-key-sound.rb #!/usr/bin/env ruby open("#{ENV["HOME"]}/vim_audio_list",'a'){|x| x.puts ARGV[0]} 実際に音鳴らすやつ #!/usr/bin/env ruby require "coreaudio" require 'kconv' class SinWaveSounder LONG = 44000 scale = 2.0 ** (1 / 12.0) FREQUENCIES = 28.times.map do |i| 220 * (scale ** i) end def initialize dev = CoreAudio.default_output_device @buf = dev.output
音の鳴るエディタ - ✘╹◡╹✘の技術的解説。 おさらい 音の鳴るエディタ 眼を閉じた状態で"Hello"と入力して、画面を見ずに正しく"Hello"と入力されていることを確認したい。 そこで、キーを叩く度にそれぞれ固有の音が鳴るようにした。 プログラミングしながら演奏できる。 開発者集めてジャムセッションとかできると思う。 人月の神話っぽくならないように注意したい。 仕組み Vimはキーイベントが取れるので、キーを押したときにカーソルの下にある文字を取得して、それを非同期でRubyのプログラムに渡す。objective-c調べて書くの面倒だからRuby使った。Rubyの方は、文字列の文字コードと見て適当に半音階ずつの周波数を決める。a, b, c, d, ...と半音ずつ上がっていく。キーイベントでキーが取得できて非同期でシステムコマンド呼び出せるエディタだったら何でも使えると思うけど、
vim使っているrubyistで、これ入れていないのはヤバいプラグインまとめ 9個 (2013-10-04更新)RubyVimctags Rubyの開発効率を高めたい! vimでRubyやRails開発するときに、デフォルトの状態では非力ですよね。 開発効率を高める9つのプラグインを紹介します。 alpaca_tags ctagsの非同期生成 neosnippet Rails/sinatra/rspec等の補完 swtich.vim .present?:.brank?など対応するキーワードを切り替える rubocop 文法エラー、スタイルチェック vim-rails Railsプロジェクト用プラグイン unite-rails Railsプロジェクト用Unite-source vim-endwise if...endなど対応するキーワードの自動補完 rub
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く