How can I set gedit to be default editor in mc?

When I hit F4, gedit should be used rather than mc's default editor.

4 Answers 4


Set your EDITOR environment variable to gedit and go into mc's options and disable the internal editor.

  • Thanks! that worked. Do you happen to know how to use gedit also for VIEWING?
    – user36028
    Aug 21, 2010 at 11:03
  • How to pass options for editor? EDITOR='rsub --port 52697' seems does not work. MC run just editor without options (( Sep 14, 2015 at 9:34

As for the viewer, mc will use the one specified by the PAGER variable (“less” on my OS)


To extend the answer by Kevin Panko and to address the comment to that answer by Eugen Konkov, I would like to share my workaround for Midnight Commander ignoring arguments in $EDITOR. Instead of passing arguments in $EDITOR definition directly, one can define an editor command with arguments in a script and set $EDITOR to that script.

For example, to ensure that each instance of vim has a servername, I use:


/usr/local/bin/vim --servername VIM "$@"

To use gedit as editor in midnight commander one may run:

editor=gedit mc

Internal editor has to be disabled in mc options, of course.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .