News | About | Get Frugalware | Packages | Documentation | Discussion Forums | Bug Tracker | Wiki | Community | Development

MCedit

From FrugalWiki

Jump to: navigation, search


Contents

MCEdit

Mc-logo.png

Not a standalone program, it is the built-in text editor of Midnight Commander. Can be invoked from Midnight Commander with the Edit command ( F4 ) or directly from the command line with mc -e or mcedit symlink to mc.

MCEdit about info

Features

  • MCEdit syntax highlighting sample
    Syntax highlighting ( own simple rules )
  • User commands ( shell script snippets )
  • User defined key bindings

Installation

Root terminal 48px.png
# pacman-g2 -S mc


Documentation

  • Built-in help system
  • Cheatsheet with default key bindings MCEdit default key bindings

User menu commands

File > User menu

The User menu ( F11 ) contains commands described in the first found menu file :

  • .cedit.menu ( local )
  • ~/.mc/cedit/menu ( user )
  • /etc/mc/cedit.menu ( global )
Comment / uncomment block
/       Comment / Uncomment
        declare -A cl=( ['c']='//' ['h']='//' ['pas']='//' ['sql']='--' ['lua']='--' )
        c="${cl[%x]:-#}"
        read s < '%b' 
        [[ "${s:0:${#c}}" == "$c" ]] && e="s,^$c,," || e="s,^,$c,"
        sed -i "$e" '%b' 
Trim trailing whitespaces
t       Trim Trailing Whitespaces
        sed -r -i 's/\s+$//' '%b' 
To lowercase
l       To Lowercase
        perl -pi -e '$_=lc' '%b' 

Links

No dedicated site, the following links refer to Midnight Commander itself :

Personal tools
Namespaces
Variants
Actions