5

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.

Kevin Panko
  • 7,346
  • 22
  • 44
  • 53
user36028
  • 173
  • 1
  • 5

4 Answers4

7

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

Kevin Panko
  • 7,346
  • 22
  • 44
  • 53
3

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

lorinc
  • 31
  • 1
1

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:

EDITOR="/path/editor-cmd.sh"

/path/editor-cmd.sh:
/usr/local/bin/vim --servername VIM "$@"
meekreau
  • 11
  • 1
0

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.