Midnight Commander colors and themes

Midnight Commander theme howtoMidnight Commander is the most pupular file manager on unix like systems. It's fast and it has all features what you need. But it's only blue and we know, that everyone loves the eyecandy, everyone likes customizing his/her own desktop. But is there any way to custimize the mc?
Yes, and I try to show you, how can you create your theme.

You can change the Midnight Commander colors if you edit the ~/.mc/ini file, where you have to add a new section, named [Colors]. You should define the new colors in this section, for example:

base_color=lightgray,green:normal=green,default:selected=white,gray ...

As you see, it has a simple syntax:

<keyword>=<foregroundcolor>,<backgroundcolor>:<keyword>= ...

The colors are optional, so you can use this:

base_color=lightgray,green:normal=green:selected=,gray ...

It's not the exactly the same as the first version!

Fine, you can change some colors of the filemanager, but which are the keywords? These are:

  • Base colors: normal, selected, marked, markselect, errors, input, reverse, gauge
  • Menu colors: menu, menusel, menuhot, menuhotsel
  • Dialog colors: dnormal, dfocus, dhotnormal, dhotfocus
  • Help colors: helpnormal, helpitalic, helpbold, helplink, helpslink
  • Viewer color: viewunderline
  • Special highlighting colors: executable, directory, link, stalelink, device, special, core
  • Editor colors: editnormal, editbold, editmarked

And which are the colors? I don't know all, but here are some of them:
white, gray, blue, green, yellow, magenta, cyan, red, brown, birghtgreen, brightblue, brightmagenta, brightcyan, brightred, default

Here is the config, what I use:

themed midnight commander

Screenshot about my redesigned Midnight Commander

On the screenshot you can see, that the directory color is blue, the files are green, the executable files are birghtgreen and the selected line is white on a gray background.

And another one, what I use recently:

themed midnight commander

Screenshot about my redesigned Midnight Commander

And here is a small shell script, which will help for you to test your new theme:

mc --colors normal=green,default:selected=brightmagenta,gray:marked=yellow,default:markselect=yellow,gray:directory=blue,default:executable=brightgreen,default:link=cyan,default:device=brightmagenta,default:special=lightgray,default:errors=red,default:reverse=green,default:gauge=green,default:input=white,gray:dnormal=green,gray:dfocus=brightgreen,gray:dhotnormal=cyan,gray:dhotfocus=brightcyan,gray:menu=green,default:menuhot=cyan,default:menusel=green,gray:menuhotsel=cyan,default:helpnormal=cyan,default:editnormal=green,default:editbold=blue,default:editmarked=gray,blue:stalelink=red,default

Save it as mccolortest.sh, make it executable with the chmod +x mccolortest.sh command, and run it with the ./mccolortest.sh command. If you want to change a color, just edit this file. When you done, copy the colors and paste it below the [Colors] section in the ~/.mc/ini. If it doesn't exists, make it yourself.

For more information of the mc redesigning check its manual page.


On the same subject:


Also, you should know that most modern terminal applications allow you to redefine the exact shade of those 16 colors.

Some of them (such as the Gnome or KDE terminals) may have a place under their preferences where you can redefine the colors.

Older terminals, such as aterm, use ~/.Xdefaults for this. You can edit that file and add lines like this: "aterm*color1: OrangeRed" (without the quotes). What I've done with that is tell aterm that the "color1" (which was red) should now be "OrangeRed". See /usr/share/X11/rgb.txt for valid color names. You can use *color0 through *color15. So when you'll say "red" in MC's ini file, and if you use aterm, it will get replaced by color1 in ~/.Xdefaults and changed to OrangeRed. (Sorry, I don't remember the mappings between the names used by MC and 0-15 in Xdefaults by heart.)


Don't be silly. Mp3 is just music, txt is text, doc is document. The only thing, which is not exactly determinable is the executables, but whatever, it has +x flag.


Midnight Commander supports this starting from 4.7.0-pre3 version.


hei ajnasz, your color theme so very nice, keep my eye on my pc longer than usual. Well, i don't have much time to do more explore with this tricks. I think your taste so cool. If you have any kind of theme, i should be try it. :-)




I am using MC on my router ASUS WL-500GP and I am developing php scripts on it. but as I see MC in openwrt (kmaikaze 8.09) does not use syntax-highlighting and it is very unconfortable.
Do you know how could I turn it on? I have already downloaded php.syntax file and put it into /usr/share/syntax dir but it does not seem to work. is it possible that some support is not compiled into my version or the syntax file must be compiled to another format?
Br Zé.


I found it. in ~/.mc/cedit/Syntax must be this:
file ..\*\\.(php|PHP)$ PHP\sFile
include php.syntax

and in the same dir php.syntax file must be placed. (copied out from a source distrib)


Also, in 4.8.3 here, I copied the first example scheme line and my colors are different. I can't even set the background of the select bar to gray (or "grey"): it gets replaced with black. Also, the panel headings remain blue here, unlike the (first) screenshot, and I can see no corresponding tag in the line anyway.

Good intro, regardless. Someone should post a pointer to a more up-to-date one, though, as Google seems to find this old thread within the top few hits. Király! ;)



The colors are depends on the color settings of your terminal. I don't have those settings anymore which was when I posted this article, but here is my current. If I'm right, it's similar to that. Put it into your .Xdefaults

*background: #000000
*foreground: #EEEEEC

! Default
! 0: black
*color0: #1C1C1C
*color8: #333333
! 1: red
*color1: #C14242
*color9: #EF2929
! 2: green
*color2: #6AA037
*color10: #9DCF70
! 3: yellow
*color3: #CFAB2F
*color11: #FCDA4F
! 4: blue
*color4: #2D578A
*color12: #729FCF
! 5: magenta
*color5: #A85EB4
*color13: #AD7FA8
! 6: cyan
*color6: #2F8D8F
*color14: #34E2E2
! 7: white
*color7: #D3D7CF
*color15: #EEEEEC

Thank you for theme. I tried your last theme and it is exactly what I was searching for.