vimzshneovimfzf

How to fzf recent files of vim/nvim, not inside vim but from terminal


I know how to fzf.vim, but I'd like to open from terminal.

Grepping history or viminfo may be achieve thst, but I wonder if there is any smart way.


Solution

  • This is how you can save the list of recent files from vim to a file:

    vim -c "call append(0, v:oldfiles)" -c "write vim-oldfiles.tmp" -c exit
    

    Put v:oldfiles (the list of recent files saved in ~/.viminfo) into the first (new and empty at the start) buffer, write the buffer to a file, exit.

    Now you can pass the content of file to fzf.