Linux Mastering Development

How to open new files in a same Vim instance from Midnight Commander?

In Midnight Commander, if Options > Configuration > Use internal edit is unset, MC uses my default editor (which I have set to Vim) instead of Mcedit when I press F4. That is good, but it blocks the file-manager until I exit Vim. To workaround that, I have put

 Open=xterm -e vim %f &

in the extension file (~/.config/mc/mc.ext) and then if I press Enter on a selected text file, it is opened in a new terminal with Vim and I can keep using MC to navigate.

However, after some time I end up with various terminals opened, each with a file, and cycling through them with AltTab becomes cumbersome. Is there a way to open every new file in a new tab/buffer of a single existing Vim instance, so that I don’t get a bunch of terminal windows?

Leave a Reply

Your email address will not be published. Required fields are marked *