From d56b533f98989c105d275c78f7de5830b25e825e Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 28 Jul 2015 23:22:16 +0900 Subject: [PATCH] Updated Examples (vim) (markdown) --- Examples-(vim).md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Examples-(vim).md b/Examples-(vim).md index 306e1bb..c700fc3 100644 --- a/Examples-(vim).md +++ b/Examples-(vim).md @@ -60,6 +60,8 @@ nnoremap :call fzf#run({ ### Simple MRU search +#### `v:oldfiles` + ```vim command! FZFMru call fzf#run({ \'source': v:oldfiles, @@ -68,6 +70,23 @@ command! FZFMru call fzf#run({ \}) ``` +#### Filtered `v:oldfiles` and open buffers + +```vim +command! FZFMru call fzf#run({ +\ 'source': reverse(s:all_files()), +\ 'sink': 'edit', +\ 'options': '-m --no-sort -x', +\ 'down': '40%' }) + +function! s:all_files() + return extend( + \ filter(copy(v:oldfiles), + \ "v:val !~ 'fugitive:\\|NERD_tree\\|^/tmp/\\|.git/'"), + \ map(filter(range(1, bufnr('$')), 'buflisted(v:val)'), 'bufname(v:val)')) +endfunction +``` + ### Jump to tags ```vim