{
    "mode": "man",
    "parameter": "mcedit",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/mcedit/1/json",
    "generated": "2026-05-30T06:05:49Z",
    "synopsis": "mcedit [-bcCdfhstVx?] [+lineno] [file1] [file2] ...\nmcedit [-bcCdfhstVx?] file1:lineno[:] file2:lineno[:] ...",
    "sections": {
        "NAME": {
            "content": "mcedit - Internal file editor of GNU Midnight Commander.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "mcedit [-bcCdfhstVx?] [+lineno] [file1] [file2] ...\n\nmcedit [-bcCdfhstVx?] file1:lineno[:] file2:lineno[:] ...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "mcedit  is  a  link to mc, the main GNU Midnight Commander executable. Executing GNU Midnight\nCommander under this name runs the internal editor and opens files specified on  the  command\nline.  The editor is based on the terminal version of cooledit - standalone editor for X Win‐\ndow System.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "Most options can be set from Options dialog box.  See the Options menu.   The  following  op‐\ntions  are  defined in ~/.config/mc/ini and have obvious counterparts in the dialog box.  You\ncan modify them to change the editor behavior, by editing the file.  Unless  specified,  a  1\nsets the option to on, and a 0 sets it to off, as usual.\n\nuseinternaledit\nThis option is ignored when invoking mcedit.\n\neditortabspacing\nInterpret  the  tab character as being of this length.  Default is 8. You should avoid\nusing other than 8 since most other editors and text viewers assume a tab  spacing  of\n8. Use editorfakehalftabs to simulate a smaller tab spacing.\n\neditorfilltabswithspaces\nNever  insert  a tab character. Rather insert spaces (ascii 32) to fill to the desired\ntab size.\n\neditorreturndoesautoindent\nPressing return will tab across to match the indentation of the first line above  that\nhas text on it.\n\neditorbackspacethroughtabs\nMake  a  single  backspace delete all the space to the left margin if there is no text\nbetween the cursor and the left margin.\n\neditorfakehalftabs\nThis will emulate a half tab for those who want to program with a tab  spacing  of  4,\nbut  do  not  want the tab size changed from 8 (so that the code will be formatted the\nsame when displayed by other programs). When editing between text and the left margin,\nmoving  and  tabbing will be as though a tab space were 4, while actually using spaces\nand normal tabs for an optimal fill.  When editing anywhere else, a normal tab is  in‐\nserted.\n\neditoroptionsavemode\nPossible  values  0, 1 and 2.  The save mode (see the options menu also) allows you to\nchange the method of saving a file.  Quick save (0) saves the file immediately,  trun‐\ncating  the  disk  file  to zero length (i.e.  erasing it) and then writing the editor\ncontents to the file.  This method is fast, but dangerous, since a system error during\na  file  save  will leave the file only partially written, possibly rendering the data\nirretrievable.  When saving, the safe save (1) option enables creation of a  temporary\nfile  into  which the file contents are first written.  In the event of a problem, the\noriginal file is untouched.  When the temporary file is successfully  written,  it  is\nrenamed  to  the  name  of the original file, thus replacing it.  The safest method is\ncreate backups (2): a backup file is created before any changes  are  made.   You  can\nspecify your own backup file extension in the dialog.  Note that saving twice will re‐\nplace your backup as well as your original file.\n\neditorwordwraplinelength\nLine length to wrap at. Default is 72.\n\neditorbackupextension\nSymbol to add to name of backup files. Default is \"~\".\n\neditorlinestate\nShow state line of editor. Currently it shows current line number (in  the  future  it\nmight show things like folding, breakpoints, etc.). M-n toggles this option.\n\neditorvisiblespaces\nToggle  \"show visible trailing spaces\".  If editorvisiblespaces=1, they are shown as\n'.'\n\neditorvisibletabs\nToggle \"show visible tabs\".  If editorvisibletabs=1, tabs are shown as '<---->'\n\neditorpersistentselections\nDo not remove block selection after cursor movement.\n\neditordropselectiononcopy\nReset selection after copy to clipboard.\n\neditorcursorbeyondeol\nAllow moving cursor beyond the end of line.\n\neditorcursorafterinsertedblock\nAllow moving cursor after inserted block.\n\neditorsyntaxhighlighting\nenable syntax highlighting.\n\neditoreditconfirmsave\nShow confirmation dialog on save.\n\neditoroptiontypewriterwrap\nto be described\n\neditoroptionautoparaformatting\nto be described\n\neditoroptionsaveposition\nSave file position on exit.\n\nsourcecodepage\nSymbol representation of codepage name for file (i.e. CP1251, ~ - default).\n\neditorgroupundo\nCombine UNDO actions for several of the same type  of  action  (inserting/overwriting,\ndeleting, navigating, typing)\n\neditorwordcompletioncollectentirefile\nSearch  autocomplete  candidates  in entire file (1) or just from beginning of file to\ncursor position (0).\n\neditorwordcompletioncollectallfiles\nSearch autocomplete candidates from all loaded files (1, default), not only  from  the\ncurrently edited one (0).\n\nspelllanguage\nSpelling  language  (en,  en-variant0, ru, etc) installed with aspell package (a full\nlist can be obtained using 'aspell' utility).  Use spelllanguage =  NONE  to  disable\naspell support. Default value is 'en'. Option must be located in the [Misc] section.\n\neditorstopformatchars\nSet of characters to stop paragraph formatting. If one of those characters is found in\nthe beginning of line, that line and all following lines  of  paragraph  will  be  un‐\ntouched. Default value is \"-+*\\,.;:&>\".\n\neditorstatefullfilename\nShow  full  path  name  in the status line. If disabled, only base name of the file is\nshown.\n",
            "subsections": []
        },
        "FEATURES": {
            "content": "The internal file editor is a full-featured windowed editor.  It can edit  several  files  at\nthe  same  time.  Maximum  size  of  each file is 64 megabytes. It is possible to edit binary\nfiles. The features it presently supports are: block copy, move, delete, cut, paste; key  for\nkey  undo; pull-down menus; file insertion; macro commands; regular expression search and re‐\nplace; shift-arrow text highlighting (if supported by the terminal); insert-overwrite toggle;\nautoindent;  tunable  tab  size; syntax highlighting for various file types; and an option to\npipe text blocks through shell commands like indent and ispell.\n\nEach file is opened in its own window in full-screen mode. Window control in mcedit is  simi‐\nlar  to  the window control in other multi-window program: double click on window title maxi‐\nmizes the window to full-screen or restores window size and position;  left-click  on  window\ntitle  and  mouse  drag moves the window in editor area; left-click on low-right frame corner\nand mouse drag resizes the window. These actions can be made using \"Window\" menu.\n",
            "subsections": []
        },
        "KEYS": {
            "content": "The editor is easy to use and can be used without learning.  The pull-down menu is invoked by\npressing F9.  You can learn other keys from the menu and from the button bar labels.\n\nIn  addition  to that, Shift combined with arrows does text highlighting (if supported by the\nterminal): Ctrl-Ins copies to the file ~/.cache/mc/mcedit/mcedit.clip, Shift-Ins pastes  from\n~/.cache/mc/mcedit/mcedit.clip,   Shift-Del   cuts   to  ~/.cache/mc/mcedit/mcedit.clip,  and\nCtrl-Del deletes highlighted text.  Mouse highlighting also works on some terminals.  To  use\nthe  standard  mouse support provided by your terminal, hold the Shift key.  Please note that\nthe mouse support in the terminal doesn't share the clipboard with mcedit.\n\nThe completion key (usually Meta-Tab or Escape Tab) completes the word under the cursor using\nthe words used in the file.\n",
            "subsections": []
        },
        "MACRO": {
            "content": "To  define  a  macro, press Ctrl-R and then type out the keys you want to be executed.  Press\nCtrl-R again when finished.  The macro can be assigned to any key by pressing that key.   The\nmacro is executed when you press the assigned key.\n\nThe macro commands are stored in section [editor] it the file ~/.local/share/mc/mc.macros.\n\nExternal scripts (filters) can be assigned into the any hotkey by edit mc.macros like follow‐\ning:\n\n[editor]\nctrl-W=ExecuteScript:25;\n\nThis means that ctrl-W hotkey initiates the ExecuteScript(25)  action,  then  editor  handler\ntranslates this into execution of ~/.local/share/mc/mcedit/macros.d/macro.25.sh shell script.\n\nExternal scripts are stored in ~/.local/share/mc/mcedit/macros.d/ directory and must be named\nas macro.XXXX.sh where XXXX is the number from 0 to 9999.  See Edit Menu File for more detail\nabout format of the script.\n\nFollowing macro definition and directives can be used:\n\n#silent\nIf this directive is set, then script starts without interactive subshell.\n\n%c     The cursor column position number.\n\n%i     The indent of blank space, equal the cursor column.\n\n%y     The syntax type of current file.\n\n%b     The block file name.\n\n%f     The current file name.\n\n%n     Only the current file name without extension.\n\n%x     The extension of current file name.\n\n%d     The current directory name.\n\n%F     The current file in the unselected panel.\n\n%D     The directory name of the unselected panel.\n\n%t     The currently tagged files.\n\n%T     The tagged files in the unselected panel.\n\n%u and %U\nSimilar  to  the %t and %T macros, but in addition the files are untagged. You can use\nthis macro only once per menu file entry or extension file entry,  because  next  time\nthere will be no tagged files.\n\n%s and %S\nThe selected files: The tagged files if there are any. Otherwise the current file.\n\nFeel free to edit this files, if you need.  Here is a sample external script:\n\nl       comment selection\nTMPFILE=`mktemp ${MCTMPDIR:-/tmp}/up.XXXXXX` || exit 1\necho #if 0 > $TMPFILE\ncat %b >> $TMPFILE\necho #endif >> $TMPFILE\ncat $TMPFILE > %b\nrm -f $TMPFILE\n\nIf some keys don't work, you can use Learn Keys in the Options menu.\n",
            "subsections": []
        },
        "CODE NAVIGATION": {
            "content": "mcedit can be used for navigation through code with tags files created by etags or ctags com‐\nmands. If there is no TAGS file code navigation will not work.  For example, in case of  exu‐\nberant-ctags for C language command will be:\n\nctags -e --language-force=C -R ./\n\nMeta-Enter  shows list box to select item under cursor (cursor should stand at the end of the\nword).\n\nMeta-Minus where minus is symbol \"-\" goes to  previous  function  in  navigation  list  (like\nbrowser's Back button).\n\nMeta-Equal where equal is symbol \"=\" goes to next function in navigation list (like browser's\nForward button).\n",
            "subsections": []
        },
        "SYNTAX HIGHLIGHTING": {
            "content": "mcedit supports syntax highlighting.  This means that keywords and contexts (like C comments,\nstring  constants,  etc) are highlighted in different colors.  The following section explains\nthe format of the file ~/.config/mc/mcedit/Syntax.  If  this  file  is  missing,  system-wide\n/usr/share/mc/syntax/Syntax  is  used.   The  file ~/.config/mc/mcedit/Syntax is rescanned on\nopening of every new editor file.  The file contains rules for highlighting, each of which is\ngiven on a separate line, and define which keywords will be highlighted with what color.\n\nThe  file  is  divided  into sections, each beginning with a line with the file command.  The\nsections are normally put into separate files using the include command.\n\nThe file command has three arguments.  The first argument is a regular expression that is ap‐\nplied to the file name to determine if the following section applies to the file.  The second\nargument is the description of the file type.  It is used in  cooledit;  future  versions  of\nmcedit  may use it as well.  The third optional argument is a regular expression to match the\nfirst line of text of the file.  The rules in the following section apply if either the  file\nname or the first line of text matches.\n\nA section ends with the start of another section.  Each section is divided into contexts, and\neach context contains rules.  A context is a scope within the text that a particular  set  of\nrules  belongs  to.  For instance, the text within a C style comment (i.e. between /* and */)\nhas its own color.  This is a context, although it has no further  rules  inside  it  because\nthere is probably nothing that we want highlighted within a C comment.\n\nA trivial C programming section might look like this:\n\nfile .\\*\\\\.c C\\sProgram\\sFile (#include|/\\\\\\*)\n\nwholechars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n\n# default colors\ndefine  comment   brown\ncontext default\nkeyword  whole  if       yellow\nkeyword  whole  else     yellow\nkeyword  whole  for      yellow\nkeyword  whole  while    yellow\nkeyword  whole  do       yellow\nkeyword  whole  switch   yellow\nkeyword  whole  case     yellow\nkeyword  whole  static   yellow\nkeyword  whole  extern   yellow\nkeyword         {        brightcyan\nkeyword         }        brightcyan\nkeyword         '*'      green\n\n# C comments\ncontext /\\* \\*/ comment\n\n# C preprocessor directives\ncontext linestart # \\n red\nkeyword  \\\\\\n  brightred\n\n# C string constants\ncontext \" \" green\nkeyword  %d    brightgreen\nkeyword  %s    brightgreen\nkeyword  %c    brightgreen\nkeyword  \\\\\"   brightgreen\n\nEach context starts with a line of the form:\n\ncontext  [exclusive]  [whole|wholeright|wholeleft] [linestart] delim [linestart] delim [fore‐\nground] [background] [attributes]\n\nThe first context is an exception.  It must start with the command\n\ncontext default [foreground] [background] [attributes]\n\notherwise mcedit will report an error.  The linestart option specifies that delim must  start\nat  the  beginning  of  a  line.  The whole option tells that delim must be a whole word.  To\nspecify that a word must begin on the word boundary only on the left side, you  can  use  the\nwholeleft  option,  and  similarly  a word that must end on the word boundary is specified by\nwholeright.\n\nThe set of characters that constitute a whole word can be changed at any point  in  the  file\nwith the wholechars command.  The left and right set of characters can be set separately with\n\nwholechars [left|right] characters\n\nThe  exclusive  option  causes the text between the delimiters to be highlighted, but not the\ndelimiters themselves.\n\nEach rule is a line of the form:\n\nkeyword [whole|wholeright|wholeleft] [linestart] string foreground [background] [attributes]\n\nContext or keyword strings are interpreted, so that you can include tabs and spaces with  the\nsequences  \\t  and  \\s.   Newlines and backslashes are specified with \\n and \\\\ respectively.\nSince whitespace is used as a separator, it may not be used as is.  Also, \\* must be used  to\nspecify  an asterisk.  The * itself is a wildcard that matches any length of characters.  For\nexample,\n\nkeyword         '*'      green\n\ncolors all C single character constants green.  You also could use\n\nkeyword         \"*\"      green\n\nto color string constants, but the matched string would not be allowed to span across  multi‐\nple  newlines.   The  wildcard  may be used within context delimiters as well, but you cannot\nhave a wildcard as the last or first character.\n\nImportant to note is the line\n\nkeyword  \\\\\\n  brightgreen\n\nThis line defines a keyword containing the backslash and newline characters.  Since the  key‐\nwords  are matched before the context delimiters, this keyword prevents the context from end‐\ning at the end of the lines that end in a backslash, thus allowing C  preprocessor  directive\nto continue across multiple lines.\n\nThe  possible  colors  are:  black,  gray, red, brightred, green, brightgreen, brown, yellow,\nblue, brightblue, magenta, brightmagenta, cyan, brightcyan, lightgray and white. The  special\nkeyword  \"default\"  means  the  terminal's default. Another special keyword \"base\" means mc's\nmain colors, it is useful as a placeholder if you want to specify attributes without  modify‐\ning  the  background  color.  When  256 colors are available, they can be specified either as\ncolor16 to color255, or as rgb000 to rgb555 and gray0 to gray23.\n\nIf the syntax file is shared with cooledit, it is possible to specify  different  colors  for\nmcedit and cooledit by separating them with a slash, e.g.\n\nkeyword  #include  red/Orange\n\nmcedit uses the color before the slash.  See cooledit(1) for supported cooledit colors.\n\nAttributes  can be any of bold, italic, underline, reverse and blink, appended by a plus sign\nif more than one are desired.\n\nComments may be put on a separate line starting with the hash sign (#).\n\nIf you are describing case insensitive language you need to use caseinsensitive directive. It\nshould be specified at the beginning of syntax file.\n\nBecause of the simplicity of the implementation, there are a few intricacies that will not be\ndealt with correctly but these are a minor irritation.  On the whole,  a  broad  spectrum  of\nquite  complicated situations are handled with these simple rules.  It is a good idea to take\na look at the syntax file to see some of the nifty tricks you can do with a  little  imagina‐\ntion.   If  you cannot get by with the rules I have coded, and you think you have a rule that\nwould be useful, please email me with your request.  However, do not ask for regular  expres‐\nsion support, because this is flatly impossible.\n\nA  useful hint is to work with as much as possible with the things you can do rather than try\nto do things that this implementation cannot deal with.  Also remember that the aim of syntax\nhighlighting is to make programming less prone to error, not to make code look pretty.\n\nThe syntax highlighting can be toggled using Ctrl-s shortcut.\n",
            "subsections": []
        },
        "COLORS": {
            "content": "The  default  colors  may be changed by appending to the MCCOLORTABLE environment variable.\nForeground and background colors pairs may be specified for example with:\n\nMCCOLORTABLE=\"$MCCOLORTABLE:\\\neditnormal=lightgray,black:\\\neditbold=yellow,black:\\\neditmarked=black,cyan\"\n",
            "subsections": []
        },
        "MISCELLANEOUS": {
            "content": "The editor also displays non-us characters (160+).  When editing binary files, you should set\ndisplay bits to 7 bits in Midnight Commander's options menu to keep the spacing clean.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/usr/share/mc/help/mc.hlp\n\nThe help file for the program.\n\n/usr/share/mc/mc.ini\n\nThe  default system-wide setup for GNU Midnight Commander, used only if the user's own\n~/.config/mc/ini file is missing.\n\n/usr/share/mc/mc.lib\n\nGlobal settings for Midnight Commander.  Settings  in  this  file  affect  all  users,\nwhether they have ~/.config/mc/ini or not.\n\n/usr/share/mc/syntax/*\n\nThe default system-wide syntax files for mcedit, used only if the corresponding user's\nown ~/.local/share/mc/mcedit/ file is missing.\n\n~/.config/mc/ini\n\nUser's own setup.  If this file is present then the setup is loaded from here  instead\nof the system-wide setup file.\n\n~/.local/share/mc/mcedit/\n\nUser's  own directory where block commands are processed and saved and user's own syn‐\ntax files are located.\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "This program is distributed under the terms of the GNU General Public License as published by\nthe Free Software Foundation.  See the built-in help of Midnight Commander for details on the\nLicense and the lack of warranty.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "The latest version of this program can be found at http://ftp.midnight-commander.org/.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "cooledit(1), mc(1), gpm(1), terminfo(1), scanf(3).\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Paul Sheer (psheer@obsidian.co.za) is the original author of  Midnight  Commander's  internal\neditor.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Bugs should be reported to http://www.midnight-commander.org/.\n\n\n\nMC Version 4.8.27                           October 2021                                   MCEDIT(1)",
            "subsections": []
        }
    },
    "summary": "mcedit - Internal file editor of GNU Midnight Commander.",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "cooledit",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/cooledit/1/json"
        },
        {
            "name": "mc",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/mc/1/json"
        },
        {
            "name": "gpm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/gpm/1/json"
        },
        {
            "name": "terminfo",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/terminfo/1/json"
        },
        {
            "name": "scanf",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/scanf/3/json"
        }
    ]
}