I have a bunch of splits up right now, and it took me a while to find these files (basically I'm chasing down a bug through 50 interconnected files).

Is there a command like :ls > /tmp/filelist that will write out the current splits/buffers that I have open to a file?


1 Answer 1


You may try the following 3 commands:

:redir > filelist.txt | :ls | :redir END

redi[r][!] > {file} Redirect messages to file {file}. The messages which are the output of commands are written to that file, until redirection ends.

To stop the messages and commands from being echoed to the screen, put the commands in a function and call it with :silent call Function(). An alternative is to use the verbosefile option, this can be used in combination with :redir. The difference with :redir is that verbose messages are not displayed when verbosefile is set.

See: :help redir.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.