Is there a way to list all open buffers in Vim? I’d like to view the full file path to every open buffer and save the list to an external file, or yank it for pasting into another text document.
Solution
This was a very hard contest! All three of the suggestions below worked well. I went with Luc Hermitte’s and added this to my .vimrc
file:
noremap <silent> <leader>so :call writefile( map(filter(range(0,bufnr('$')), 'buflisted(v:val)'), 'fnamemodify(bufname(v:val), ":p")'), 'open_buffers.txt' )<CR>
So now typing ,so
will save all the full path of all open buffers to the current directory in the open_buffers.txt
file.