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:

Vim & mc

When I worked at Valve Software, I had a chance to watch a physics simulations engineer work on some stuff. I did notice some of the tools he used: midnight commander and vim. I decided to give them a go and really learn them. It’s been about a week since I started learning vim and mc. So far they are great and I never have to take my hand off the keyboard to work. The learning curve is a little high, but there are tons of resources out there. Also, the fact that you can customize vim a lot is really useful. I didn’t really like the color themes that came with the standard vim install, so someone recommended I check this site out: color scheme test

One cool thing that I haven’t tried yet is the viemu. Basically it allows you to use vim controls from within visual studio. The only thing I would use visual studio for is intellisense to get to know an API better. But I also found out that someone created an intellisense type of plugin for vim anyways. I’m not ready for it yet, but it may prove useful in the future.

On a side note, although you can use vim, I recommend gVim instead, simply for the wider array of color scheme support. Currently I work from within mc and I have mc execute my windows binary of gVim. So far it seems to work pretty well. Periodically when I exit out of gVim, cygwin isn’t the top window, which is annoying. Alt-tab fixes that issue though.