.TH mcedit 1 "30 January 1997" .\"SKIP_SECTION" .SH NAME mcedit \- Full featured terminal text editor for Unix-like systems. .\"SKIP_SECTION" .SH USAGE .B mcedit [ file [\-bcCdfhstVx?]] .SH DESCRIPTION .LP Mcedit is a link to .B mc, the Midnight Commander, forcing it to immediately start its internal editor. The editor is a terminal version of the .B cooledit standalone X Window editor. .\".\"DONT_SPLIT" .SH OPTIONS .TP .I "\-b" Forces black and white display. .TP .I "\-c" Force color mode on terminals where .B mcedit defaults to black and white. .TP .I "\-C =,:= ..." Used to specify a different color set, where .I keyword is one of normal, selected, marked, markselect, errors, reverse menu, menusel, menuhot, menuhotsel and gauge. The colors are optional and are one of black, gray, red, brightred, green, brightgreen, brown, yellow, blue, brightblue, magenta, brightmagenta, cyan, brightcyan, lightgray and white. See the .B Colors section in .B mc.1 for more information. .TP .I "\-d" Disables mouse support. .TP .I "\-f" Displays the compiled-in search paths for Midnight Commander files. .TP .I "\-t" Used only if the code was compiled with Slang and terminfo: it makes the Midnight Commander use the value of the .B TERMCAP variable for the terminal information instead of the information on the system wide terminal database .TP .I "\-V" Displays the version of the program. .TP .I "\-x" Forces xterm mode. Used when running on xterm-capable terminals (two screen modes, and able to send mouse escape sequences). .PP .SH Features The internal file editor provides most of the features of common full screen editors. It has an extensible file size limit of sixteen megabytes and edits binary files flawlessly. The features it presently supports are: Block copy, move, delete, cut, paste; .I "key for key undo"; pull-down menus; file insertion; macro definition; regular expression search and replace (and our own scanf-printf search and replace); shift-arrow MSW-MAC text highlighting (for the linux console only); insert-overwrite toggle; word-wrap; a variety of tabbing options; and an option to pipe text blocks through shell commands like indent and ispell. .PP .SH Keys The editor is very easy to use and requires no tutoring. To see what keys do what, just consult the appropriate pull-down menu. Other keys are: Shift movement keys do text highlighting (Linux console only). .B Ctrl-Ins copies to the file .BR "~/cedit/cooledit.clip", and .B Shift-Ins pastes from .BR "~/cedit/cooledit.clip". .B Shift-Del cuts to .BR "~/cedit/cooledit.clip", and .B Ctrl-Del deletes highlighted text - all linux console only. The completion key (see .BR "mc.1") also does a hard return without an automatic indent. Mouse highlighting also works, and you can override the mouse as usual by holding down the shift key while dragging the mouse to let normal terminal mouse highlighting work. To define a macro, press .B Ctrl-R and then type out the key strokes you want to be executed. Press .B Ctrl-R again when finished. You can then assign the macro to any key you like by pressing that key. The macro is executed when you press .B Ctrl-A and then the assigned key. The macro is also executed if you press Meta, Ctrl, or Esc and the assigned key, provided that the key is not used for any other function. Once defined, the macro commands go into the file .BR "~/cedit/cooledit.macros". Do NOT edit this file unless you are not going to use macros again in the same editing session, because .B Mcedit caches macro key defines in memory. .B Mcedit now overwrites a macro if a macro with the same key already exists, so you won't have to edit this file. You will also have to restart other running editors for macros to take effect. .B F19 will format C code when it is highlighted. For this to work, make an executable file called .B cedit/edit.indent.rc in your home directory containing the following: .IP .nf #!/bin/sh # Use $HOME instead of ~ if this doesn't work. # You may also have to use a different redirection # syntax for some machines. /usr/bin/indent -kr -pcs ~/cedit/cooledit.block >& /dev/null cat /dev/null > ~/cedit/cooledit.error .fi .PP .B C-p will run ispell on a block of text in a similar way. The file is .B cedit/edit.spell.rc .IP .nf #!/bin/sh # Use $HOME instead of ~ if this doesn't work. # You may also have to use a different redirection # syntax for some machines. /usr/local/bin/ispell ~/cedit/cooledit.block >& /dev/null cat /dev/null > ~/cedit/cooledit.error .fi .PP .SH Redefining Keys Keys may be redefined from the Midnight Commander options menu. .PP .SH OPTIONS The following options are defined in .B ".mc.ini". You can modifiy them to change the editor behaviour, by editing the file. An options dialog box is presently not supported, but will be in the future. Unless specified, a 1 sets the option to on, and a 0 sets it to off, as is usual. .TP .I use_internal_edit This option is ignored when envoking .B mcedit. .TP .I editor_word_wrap_line_length Sets the maximum length of the line before a newline is inserted automatically; 0 means off. .TP .I editor_key_emulation 1 for .B Emacs keys, and 0 for normal .B Cooledit keys. .TP .I editor_tab_spacing Interpret the tab character as being of this length. Default is 8. You should avoid using other than 8 since most other editors and text viewers assume a tab spacing of 8. Use .B editor_fake_half_tabs to simulate a smaller tab spacing. .TP .I editor_fill_tabs_with_spaces Never insert a tab space. Rather insert spaces (ascii 20h) to fill to the desired tab size. .TP .I editor_return_does_auto_indent Pressing return will tab across to match the indentation of the first line above that has text on it. .TP .I editor_backspace_through_tabs Make a single backspace delete all the space to the left margin if there is no text between the cursor and the left margin. .TP .I editor_fake_half_tabs This will emulate a half tab for those who want to program with a tab spacing of 4, but do not want the tab size changed from 8 (so that the code will be formatted the same when displayed by other programs). When editing between text and the left margin, moving and tabbing will be as though a tab space were 4, while actually using spaces and normal tabs for an optimal fill. When editing anywhere else, a normal tab is inserted. .TP .I editor_option_save_mode (0, 1 or 2.) The save mode (see the options menu also) allows you to change the method of saving a file. Quick save (0) saves the file by immediately, truncating the disk file to zero length (i.e. erasing it) and the writing the editor contents to the file. This method is fast, but dangerous, since a system error during a file save will leave the file only partially written, possibly rendering the data irretrievable. When saving, the safe save (1) option enables creation of a temporary file into which the file contents are first written. In the event of an problem, the original file is untouched. When the temporary file is successfully written, it is renamed to the name of the original file, thus replacing it. The safest method is create backups (2). Where a backup file is created before any changes are made. You can specify your own backup file extension in the dialog. Note that saving twice will replace your backup as well as your original file. .PP .SH Miscellaneous (Scanf search and replace have previously not worked properly. With this release, problems with search and replace have been fixed.) You can use scanf search and replace to search and replace a C format string. First take a look at the .B sscanf and .B sprintf man pages to see what a format string is and how it works. An example is as follows: Suppose you want to replace all occurances of say, an open bracket, three comma seperated numbers, and a close bracket, with the word .I apples, the third number, the word .I oranges and then the second number, you would fill in the Replace dialog box as follows: .nf .B Enter search string (%d,%d,%d) .B Enter replace string apples %d oranges %d .B Enter replacement argument order 3,2 .fi The last line specifies that the third and then the second number are to be used in place of the first and second. It is advisable to use this feature with Prompt On Replace on, because a match is thought to be found whenever the number of arguments found matches the number given, which is not always a real match. Scanf also treats whitespace as being elastic. Note that the scanf format %[ is very useful for scanning strings, and whitespace. The editor also displays non-us characters (160+). When editing binary files, you should set .B display bits to 7 bits in the Midnight Commander options menu to keep the spacing clean. .PP .SH FILES @prefix@/lib/mc.hlp .IP The help file for the program. .PP @prefix@/lib/mc/mc.ini .IP The default system-wide setup for the Midnight Commander, used only if the user lacks his own ~/.mc.ini file. .PP @prefix@/lib/mc/mc.lib .IP Global settings for the Midnight Commander. Settings in this file are global to any Midnight Commander, it is useful to define site-global .\"LINK2 terminal settings. .\"Terminal databases" .PP $HOME/.mc.ini .IP User's own setup. If this file is present then the setup is loaded from here instead of the system-wide startup file. .PP $HOME/cedit/ .IP User's own temporary directory where block commands are processed and saved. .PP .\"SKIP_SECTION" .SH LICENSE This program is distributed under the terms of the GNU General Public License as published by the Free Software Foundation. See the built-in help of the Midnight Commander for details on the License and the lack of warranty. .SH AVAILABILITY The latest version of this program can be found at ftp.nuclecu.unam.mx in the directory /linux/local and from Europe at sunsite.mff.cuni.cz in the directory /GNU/mc and at ftp.teuto.de in the directory /lmb/mc. The X Window version can be found at sunsite.unc.edu in /pub/Linux/apps/editors/X or at argeas.argos.hol.gr in /pub/unix/cooledit. .SH SEE ALSO cooledit(1), mc(1), gpm(1), terminfo(1), scanf(3). .PP .SH AUTHORS Paul Sheer (psheer@icon.co.za) is the developer of the Midnight Commander's internal editor. .PP .SH BUGS See the file .B README.edit in the distribution for more information.