LoginSignup
3
3

More than 5 years have passed since last update.

Unite.vimで特定のパス指定して file_rec を実行する

Last updated at Posted at 2016-02-07

デフォルトのfile_recオプションはカレントディレクトリが対象となるので、
ファイル数が多くなり非常に重くなってしまうことが多い。

下記のようにunite#startという関数を使えば、
ディレクトリのパスを指定してfile_recを使うことができる。

:call unite#start([['file_rec/async', '/path/to/my_directory']]);

また個人的にタブを新しく開いて実行して欲しかったのと、
vim-railsを使っているので下記のように設定した。
optionを渡すにはunite#start#standardを使えば行ける。

:call unite#start#standard([['file_rec/async', b:rails_root.'/app/my_directory']], {"tab":1});

指定できるオプションは下記のソースコード173行目で定義されている。
https://github.com/Shougo/unite.vim/blob/master/autoload/unite/variables.vim

この設定のおかげで unite-rails がcontrollersなど特定のディレクトリしか指定できなかったのが解決できた。。。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3