Warm tip: This article is reproduced from stackoverflow.com, please click
vim zsh neovim fzf

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

发布于 2020-04-10 10:19:08

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.

Questioner
Kohei Murakami
Viewed
81
phd 2020-02-02 00:06

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.