Open multiple files from ranger in vim

rangervim

When I highlight multiple files in ranger from the same dir, I can open them all in vim with r and than 0 or @ and than add vim. But if I highlight files from different dirs, than this doesn't work. Any ideas why and how to get it working?

Bonus question: I would like to open all files with vims -o flag (to split vertical), but that doesn't work either, not even on files in the same dir.

Best Answer

To copy/move multiple files, just mark them with Space then use "dd/yy". If you want to operate on multiple files stored in different directories, you may use "ya/da" to add them to the list of files to be copied/moved before pasting them.

(Note that the copy/cut buffers can be used for other operations as well, by using the "%c" macro in your commands. For example, adding files to the cut/copy buffer using "ya"/"da" then using the :shell -w printf %c | xargs rm command allows you to delete multiple files in multiple directories. Remember to clear the buffer once you're done using "ud"/"uy".)

So add the files with ya and then use a mapping like xv:

map xv shell vim %c