Midnight Commander not saving changes??


Forum: Apps
Topic: Midnight Commander not saving changes??
started by: Phinger

Posted by Phinger on Dec. 14 2005,20:59
Im using Midnight Commander to edit my /etc/lilo.conf
I "su" to ensure I can make the changes, and open the file. I can go to the line I need to change, and put in what I want, but I try to hit F2 to save and all I get is a "<F2>" printed in the line, or an audible "beep". Same for "F10" to exit. All I get is a beep!
What am I doing wrong?

Posted by mikshaw on Dec. 14 2005,22:55
Try going to "Options -> learn keys" to tell mc how it should be mapping its keys.
Posted by cbagger01 on Dec. 15 2005,17:19
DSL does not use the default Midnight Commander text editor program called "mcedit".

Instead, it uses vi for the text editor.

Try some vi editor commands.   They should work.

Posted by Phinger on Dec. 16 2005,21:03
I tried the "options-learn keys". The F2 wasnt mapped, but this didn't solve the problem.
Quote
DSL does not use the default Midnight Commander text editor program called "mcedit".

Instead, it uses vi for the text editor.

Try some vi editor commands.   They should work

I didn't go the "mcedit" route, I went to midnight commander in the right-click menu under "editors". I'll try VI.

Posted by mikshaw on Dec. 17 2005,04:46
Quote (Phinger @ Dec. 16 2005,16:03)
I didn't go the "mcedit" route, I went to midnight commander in the right-click menu under "editors". I'll try VI.

You may have misunderstood what cbagger said.  If you press F4 to edit in DSL's mc, you will be editing in vim regardless of whether you want to or not, so you will have to do :w to save and :wq to save and quit.
Posted by Headhunter on Dec. 20 2005,09:43
Quote (mikshaw @ Dec. 16 2005,23:46)
[quote=Phinger,Dec. 16 2005,16:03]w to save and :wq to save and quit.

How do I get to print "w" or "wq" in VI?? When I write it with the keyboard it prints this in then file.. Is there a buttom to push?? Whitch one??

Thx in forhand...

Posted by mikshaw on Dec. 20 2005,16:59
If it prints what you type in the file buffer, you are in insert mode.  Press Esc to get back to normal mode (for entering commands) and type :w to write the file or :wq to to write and quit. The colon tells vim that the following will be a command rather than a control/navigation key.
< http://vimdoc.sourceforge.net/ >

You can also change your mc editor using the EDITOR environment variable.  Open up ~/.bashrc and add "export EDITOR=nano" to use nano instead of vim.  Keep in mind this won't affect shells that are currently open, so you'll probably want to restart X (exit fluxbox then type 'startx').

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.