How do I find out the name of the files in the buffers in vim.Is there any command that returns the name of the file?
bufname() command returns the filespec of the passed-in buffer number. To get all buffers (like
:ls), you can iterate with
for bufNr in range(1, bufnr('$')) ... The returned filespec may be relative to the current directory; you can use
fnamemodify() to turn it into an absolute filespec.