Midnight Commander trick

After using midnight commander for a while, I realized I couldn’t open any other file except for .h and .cpp files. Finding this odd, I realized that it wasn’t gvim’s fault, but instead midnight commander’s fault. By default, pressing <ENTER> on the keyboard results in executing the file (or attempting to if it is a script). I found this bothersome as I hardly ever execute scripts through mc. So I changed the default action from “execute” to “edit.” This is done by editing the “/usr/share/mc/mc.ext” file. At the very bottom, make sure the lines read something like this:

Leave a Reply

You must be logged in to post a comment.