Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Switching editors of Midnight Commander v4.x to Geany


    I need some serious help here. I've been trying to fix MC v4.8.14's default editor to Geany. Yet I've looked everywhere, and everyone's post is at least 2 years out of date (Pre v3 I believe.) So nothing works right.

    I've gone though the .config/mc.ext file manually and though F9/C/E and changed all entries of 'Vi' to 'Geany' but it still edits text files with VI. Which I have no experience with, and cannot use. If anything I could use Nano if necessary but I cannot switch it at all.

    Can anyone help?

    Thanks

  2. #2
    Linux Guru
    Join Date
    Dec 2013
    Posts
    2,747
    first, you have to set
    Code:
    use_internal_edit=0
    then, type
    Code:
    $ echo $EDITOR
    in a terminal.
    probably says vi.

    so now type
    Code:
    $ EDITOR=geany
    $ mc
    and try to edit a file.
    works on my system.

    problem is, you have to tell mc every time to use geany.
    you could
    Code:
    export EDITOR=geany
    in your .profile or .bash_profile, which is probably not a good idea because other applications use that variable, too, and expect a non-gui editor there.
    probably better to write a small wrapper around mc and place it in $HOME/bin:
    Code:
    #!/bin/sh
    EDITOR=geany
    mc "$@" &

  3. #3
    -->
    Thanks nihili !

    Your solution wasn't exactly what I needed but with your advice, and a bit of tinkering, I got it working right.

    The configuration file on my Debian 8.1/KDE 4.13 system is:

    ~/.config/mc/mc.ext

    At the very bottom of the file I put in your

    use_internal_edit=0

    Then changed:

    Code:
    # Default target for anything not described above
    default/*
    	Open=
    	View=
    
    to 
    
    # Default target for anything not described above
    default/*
    	Open=geany %f
    	View=
    Now clicking on a .TXT file pulls geany right up, with the text file ready to edit.

$spacer_open
$spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •