The question is quite straightforward, so no further description is needed according to me.

I just add that I am running Ubuntu 13.04.

Any help is welcomed.

up vote 14 down vote accepted

In Midnight Commander go to Options menu / Configuration... command / Use internal edit checkbox and uncheck it. (Don't forget to execute the Save setup command if the Auto save setup option is off.)

Then set the EDITOR environment variable to Sublime. You may prefer to add one of these to your shell's resource file:

  • Global setting for all programs that use EDITOR (not recommended):

    EDITOR=sublime
    export EDITOR
    
  • Temporary setting for the given Midnight Commander session only:

    alias mc='EDITOR=sublime mc'
    

Same for the viewer, just you uncheck the Use internal view option and set the VIEWER environment variable instead.

  • why is it not recommended to set EDITOR=sublime globally? – MattDMo Jun 27 '13 at 16:07
  • 2
    Because other tools, for example crontab, are using it. Such tools may be used without X (for example from a virtual terminal in single user mode for maintenance operations) or by user who has no running X instance (for example through su -). So better keep EDITOR set to a text mode editor. – manatwork Jun 27 '13 at 16:12
  • Why 'EDITOR='sublime -w' does not work? (It seems MC ignore any supplyed options) – Eugen Konkov Sep 14 '15 at 9:31
  • worked like a charm, thanks! – Marco Klein Feb 2 at 8:34

Run MC as usual. On the command line right above the bottom row of menu selections type

select-editor

This should open a menu with a list of all of your installed editors. This is working for me on all my current Linux machines.

  • 1
    Doesn't work on OSX though. – T.Chmelevskij Jan 12 '17 at 10:19
  • Perfect on Debian! – mahatmanich Jun 21 '17 at 9:30

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.