mercredi 17 juillet 2013

unite.vim and many files in a project

I'm using the ag command in conjunction with the unite.vim plugin.

If your project contains many files, for example 100k files, you might be experiencing slowness while using the unite.vim file_rec or file_rec/async sources. Vim might even use 100% of your cpu.

One solution is to populate the .agignore file so unite.vim will only be working with a reduced set of your project's file. Here's the little shell script, please fill in the correct values for your project:

#!/bin/sh

APP_DIR=path_to_your_project
AG_IGNORE_FILE=.agignore
# A list of directories or files you want unite.vim to inspect.
# You can put as many as you like, separated by a pipe.
WHITE_LIST='directory_1|directory_2|directory_3'

ls -1 $APP_DIR | grep --color=never -v -P "($WHITE_LIST)" > ~/$AG_IGNORE_FILE

1 commentaire:

Wriddhi a dit…

Few days ago i founded like this article on Insideblog