Shougo/unite.vim — pull request #200 by zhaocai (2013-05-01 00:00:05+00:00)
Title: Feature: lazy mru

## Major change to file_mru/directory_mru

The change is motivated for the performance penalty when I set large number to the limit of file_mru. After I check the code, I am quite sure the original MRUs needs revitalization.

### The biggest problem

#### **Before**:

Save to file on every event including `BufEnter, BufWinEnter, BufFilePost, BufWritePost`. This is quite an overhead.

#### **Now**:

1. Use `VimLeavePre` event to save.
2. Set default update interval (10min by default) to save.

Updates made by external (other vim instance) are merged during the process of save().

### Two lists for the lazy mind

Two lists for each mru are maintained - short one for quick start; long one for history keep.

The long list can be loaded with `is_draw` key or add args including `*` or `all`, `long`, `_`.

I wanted the feature for a while ago. I usually set a large number for the mru limit because I do need to find some old files from time to time. But it is slow to always load 1000+ candidates.

### code overhaul

The code for file_mru and directory_mru are almost the same. So I moduarlized and merged the code.

### Other changes

1. I renamed file_mru and directory_mru to `mru/file` and `mru/directory` becasue I changed the file name to `mru.vim`. Then I have some trouble to get `unite.vim` (lazy loaded) to find the `file_mru` source.

Please check the code. I will add the doc later.