Mcedit 1 6 4

Name

mcedit - Internal file editor of GNU Midnight Commander.

You can modify them to change the editor behavior, by editing the file. Unless specified, a 1 sets the option to on, and a 0 sets it to off, as is usual. Useinternaledit This option is ignored when invoking mcedit. Editortabspacing Interpret the tab character as being of this length. Call Of Duty: World at War 1.4 Patch. Fixes bugs and adds maps to Call of Duty: At War. MCEdit 0.1.7.1 free download.

Usage

mcedit [-bcCdfhstVx?] [+lineno] file

mcedit [-bcCdfhstVx?] file:lineno[:]

Description

mcedit is a link to mc, the main GNU Midnight Commander executable. Executing GNU Midnight Commander under this name requests staring the internaleditor and opening the file specified on the command line. The editor is based on the terminal version of cooledit - standalone editor for XWindow System.

Options

-C <keyword>=<FGcolor>,<BGcolor>:<keyword>= ...
Specify a different color set. See the Colors section in mc(1) for more information.
-d
Disable mouse support.
-f
Display the compiled-in search path for GNU Midnight Commander data files.
-t
Force using termcap database instead of terminfo. This option is only applicable if GNU Midnight Commander was compiled with S-Lang library with terminfosupport.
-V
Display the version of the program.
-x
Force xterm mode. Used when running on xterm-capable terminals (two screen modes, and able to send mouse escape sequences).

Features

The internal file editor is a full-featured full screen editor. It can edit files up to 64megabytes. It is possible to edit binary files. The features it presently supports are: block copy, move, delete, cut, paste; key for key undo; pull-downmenus; file insertion; macro commands; regular expression search and replace (and our own scanf-printf search and replace); shift-arrow text highlighting (ifsupported by the terminal); insert-overwrite toggle; word wrap; autoindent; tunable tab size; syntax highlighting for various file types; and an option to pipetext blocks through shell commands like indent and ispell.

Keys

The editor is easy to use and can be used without learning. The pull-down menu is invoked by pressingF9. You can learn other keys from the menu and from the button bar labels.

In addition to that, Shift combined with arrows does text highlighting (if supported by the terminal): Ctrl-Ins copies to the file~/.mc/cedit/cooledit.clip, Shift-Ins pastes from ~/.mc/cedit/cooledit.clip, Shift-Del cuts to ~/.mc/cedit/cooledit.clip, andCtrl-Del deletes highlighted text. Mouse highlighting also works on some terminals. To use the standard mouse support provided by your terminal, holdthe Shift key. Please note that the mouse support in the terminal doesn't share the clipboard with mcedit.

The completion key (usually Meta-Tab or Escape Tab) completes the word under the cursor using the words used earlier in the file.

To define a macro, press Ctrl-R and then type out the keys you want to be executed. Press Ctrl-R again when finished. You can then assign themacro to any key you like by pressing that key. The macro is executed when you press Ctrl-A and then the assigned key. The macro is also executed if youpress Meta, Ctrl, or Esc and the assigned key, provided that the key is not used for any other function. The macro commands are stored in the file~/.mc/cedit/cooledit.macros. Do NOT edit this file if you are going to use macros again in the same editing session, because mcedit caches macrokey defines in memory. 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 alsohave to restart other running editors for macros to take effect.

F19 will format C, C++, Java or HTML code when it is highlighted. An executable file called ~/.mc/cedit/edit.indent.rc will be created for youfrom the default template. Feel free to edit it if you need.

C-p will run ispell on a block of text in a similar way. The script file will be called ~/.mc/cedit/edit.spell.rc.

If some keys don't work, you can use Learn Keys in the Options menu.

Code Navigation

mcedit can be used to navigation through code with tags files created by etags orctags commands. If there is no file TAGS code navigation would not work. In example, in case of exuberant-ctags for C language command will be:

ctags -e --language-force=C -R ./

Meta-Enter show list box to select item under cursor (cusor should stand at end of word).

Meta-Minus where minus is symbol '-' go to previous function in navigation list (like a browser Back).

Meta-Equal where equal is symbol '=' go to next function in navigation list (like a browser Forward).

Syntax Highlighting

mcedit supports syntax highlighting. This means that keywords and contexts (likeC comments, string constants, etc) are highlighted in different colors. The following section explains the format of the file ~/.mc/cedit/Syntax. Ifthis file is missing, system-wide /usr/share/mc/syntax/Syntax is used. The file ~/.mc/cedit/SyntaxMcedit 1.6.4 download is rescanned on opening of a any new editorfile. The file contains rules for highlighting, each of which is given on a separate line, and define which keywords will be highlighted to what color.

The file is divided into sections, each beginning with a line with the file command. The sections are normally put into separate files using theinclude command.

The file command has three arguments. The first argument is a regular expression that is applied to the file name to determine if the followingsection applies to the file. The second argument is the description of the file type. It is used in cooledit; future versions of mcedit may useit as well. The third optional argument is a regular expression to match the first line of text of the file. The rules in the following section apply if eitherthe file name or the first line of text matches.

A section ends with the start of another section. Each section is divided into contexts, and each context contains rules. A context is a scope within thetext that a particular set of rules belongs to. For instance, the text within a C style comment (i.e. between /* and */) has its own color. Thisis a context, although it has no further rules inside it because there is probably nothing that we want highlighted within a C comment.

A trivial C programming section might look like this:Each context starts with a line of the form:

context [exclusive] [wholewholerightwholeleft] [linestart] delim [linestart] delim[foreground] [background]

The first context is an exception. It must start with the command

context default [foreground] [background]

otherwise mcedit will report an error. The linestart option specifies that delim must start at the beginning of a line. Thewhole option tells that delim must be a whole word. To specify that a word must begin on the word boundary only on the left side, you can use thewholeleft option, and similarly a word that must end on the word boundary is specified by wholeright.

The set of characters that constitute a whole word can be changed at any point in the file with the wholechars command. The left and right set ofcharacters can be set separately with

wholechars [leftright] characters

The exclusive option causes the text between the delimiters to be highlighted, but not the delimiters themselves.

Each rule is a line of the form:

keyword [wholewholerightwholeleft] [linestart] string foreground [background]

Context or keyword strings are interpreted, so that you can include tabs and spaces with the sequences t and s. Newlines and backslashes are specifiedwith n and respectively. Since whitespace is used as a separator, it may not be used as is. Also, * must be used to specify an asterisk. The * itself is awildcard that matches any length of characters. For example,colors all C single character constants green. You also could useto color string constants, but the matched string would not be allowed to span across multiple newlines. The wildcard may be used within context delimitersas well, but you cannot have a wildcard as the last or first character.

Important to note is the lineThis line defines a keyword containing the backslash and newline characters. Since the keywords are matched before the context delimiters, this keywordprevents the context from ending at the end of the lines that end in a backslash, thus allowing C preprocessor directive to continue across multiple lines.

The possible colors are: black, gray, red, brightred, green, brightgreen, brown, yellow, blue, brightblue, magenta, brightmagenta, cyan, brightcyan,lightgray and white. If the syntax file is shared with cooledit, it is possible to specify different colors for mcedit and cooledit byseparating them with a slash, e.g.mcedit uses the color before the slash. See cooledit(1) for supported cooledit colors.

Comments may be put on a separate line starting with the hash sign (#).

Because of the simplicity of the implementation, there are a few intricacies that will not be dealt with correctly but these are a minor irritation. On thewhole, a broad spectrum of quite complicated situations are handled with these simple rules. It is a good idea to take a look at the syntax file to see some ofthe nifty tricks you can do with a little imagination. If you cannot get by with the rules I have coded, and you think you have a rule that would be useful,please email me with your request. However, do not ask for regular expression support, because this is flatly impossible.

A useful hint is to work with as much as possible with the things you can do rather than try to do things that this implementation cannot deal with. Alsoremember that the aim of syntax highlighting is to make programming less prone to error, not to make code look pretty.

Colors

The default colors may be changed by appending to the

Mcedit 1 7 10

MC_COLOR_TABLE environment variable.Foreground and background colors pairs may be specified for example with:

Options

Most options can now be set from the editors options dialog box. See the Options menu. Thefollowing options are defined in ~/.mc/ini and have obvious counterparts in the dialog box. You can modify them to change the editor behavior, byediting the file. Unless specified, a 1 sets the option to on, and a 0 sets it to off, as is usual.
editor_line_state
show state line of editor now it show number of file line (in future it can show things like folding, breakpoints, etc.). M-n toglle this option.
editor_visible_spaces
Toggle show visible trailing spaces (TWS), if editor_visible_spaces=1 TWS showed as '.'
editor_visible_tabs
Toggle show visible tabs, if editor_visible_tabs=1 tabs showed as '<---->'
editor_persistent_selections
Do not remove block selection after moving the cursor.
editor_cursor_beyond_eol
Allow moving cursor beyond the end of line.
editor_syntax_highlighting
enable syntax highlighting.
editor_edit_confirm_save
show confirm dialog on save.
editor_option_typewriter_wrap
to be described
editor_option_auto_para_formatting
to be described
editor_option_save_position
save file position on exit.
source_codepage
symbol representation of codepage name for file (i.e. CP1251, ~ - default).
editor_wordcompletion_collect_entire_file
Search autocomplete candidates in entire of file or just from begin of file to cursor position (0)

Miscellaneous

You can use scanf search and replace to search and replace a C format string. First take alook at the sscanf and sprintf man pages to see what a format string is and how it works. Here's an example: suppose that you want to replace alloccurrences of an open bracket, three comma separated numbers, and a close bracket, with the word apples, the third number, the word oranges andthen the second number. You would fill in the Replace dialog box as follows: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 thenumber given, which is not always a real match. Scanf also treats whitespace as being elastic. Note that the scanf format %[ is very useful for scanningstrings, and whitespace.

The editor also displays non-us characters (160+). When editing binary files, you should set display bits to 7 bits in the Midnight Commander optionsmenu to keep the spacing clean.

Files

/usr/share/mc/mc.hlp
The default system-wide setup for GNU Midnight Commander, used only if
the user's own ~/.mc/ini file is missing.

/usr/share/mc/mc.lib

The default system-wide syntax files for mcedit, used only if
the corresponding user's own ~/.mc/cedit/ file is missing.

$HOME/.mc/ini

from here instead of the system-wide setup file.

$HOME/.mc/cedit/

user's own syntax files are located.

License

This program is distributed under the terms of the GNU General Public License as published bythe Free Software Foundation. See the built-in help of the Midnight Commander for details on the License and the lack of warranty.

Availability

Mcedit 1.6.4

The latest version of this program can be found at http://midnight-commander.org/.

See Also

cooledit(1), mc(1), gpm(1), terminfo(1), scanf(3).

Authors

Paul Sheer (psheer@obsidian.co.za) is the original author of the Midnight Commander's internaleditor.

Bugs

MceditBugs should be reported to mc-devel@gnome.org

Referenced By

mcview

Mcedit 1.6.4 Download

(1)