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