Rubyインターフェースを使い、ファイルのパスをゴニョゴニョするための一連のユーティリティ関数を書いてみた。それぐらい Vim script で書けよ、というものが大半*1だけど、一度使ってみたかったということもあり、練習も兼ねて。ていうか、色々と楽でいいやw*2 if has("ruby") function! util#path_expand(path) ruby << EOF path = File.expand_path(VIM.evaluate('a:path')) path.gsub!(/(["\\])/) { '\\' + $1 } VIM.command('let path = "' + path + '"') EOF return path endfunction function! util#path_split(path) ruby << EOF dir, base