changed mcedit.1.in

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Ilia Maslakov 2011-01-28 11:59:18 +03:00
parent b58e7e64fc
commit 4438117628

View File

@ -97,38 +97,113 @@ or
.BR "Escape Tab" ) .BR "Escape Tab" )
completes the word under the cursor using the words used earlier in the completes the word under the cursor using the words used earlier in the
file. file.
.SH MACRO
.PP .PP
To define a macro, press To define a macro, press
.B Ctrl\-R .B Ctrl\-R
and then type out the keys you want to be executed. Press and then type out the keys you want to be executed. Press
.B Ctrl\-R .B Ctrl\-R
again when finished. You can then assign the macro to any key you like again when finished. The macro can be assigned to any key by pressing that key.
by pressing that key. The macro is executed when you press The macro is executed when you press the assigned key.
.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. The macro commands are stored in the file
.BR ~/.local/share/mc/mcedit/mcedit.macros .
Do NOT edit this file if you are 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.
.P
.B F19
will format C, C++, Java or HTML code when it is highlighted. An executable
file called
.B ~/.local/share/mc/mcedit/edit.indent.rc
will be created for you from the default template. Feel free to edit it
if you need.
.PP .PP
.B C\-p The macro commands are stored in section
will run ispell on a block of text in a similar way. The script file .B [editor]
will be called it the file
.BR ~/.local/share/mc/mcedit/edit.spell.rc . .BR ~/.local/share/mc/mc.macros .
.PP
External scripts (filters) can be assigned into the any hotkey by edit
.B mc.macros
like following:
.PP
.nf
[editor]
ctrl\-W=EditPipeBlock:25;
.fi
.PP
This means that ctrl\-W hotkey initiates the
.I EditPipeBlock(25)
action, next the editor handler translates this into execution of
.B ~/.local/share/mc/mcedit/macros.d/macro.25.sh
shell script.
.PP
External scripts stored into
.B ~/.local/share/mc/mcedit/macros.d/
directory and must named
.B macro.XXXX.sh
where
.B XXXX
is the number from 0 to 9999.
See
.B Menu File Edit
for more detail about format of the script.
.PP
Next macro definition can be used:
.TP
.I %c
The cursor column position number.
.TP
.I %i
The indent of blank space, equal the cursor column.
.TP
.I %y
The syntax type of current file.
.TP
.I %b
The block file name.
.TP
.I %f
The current file name.
.TP
.I %n
Only the current file name without extension.
.TP
.I %x
The extension of current file name.
.TP
.I %d
The current directory name.
.TP
.I %F
The current file in the unselected panel.
.TP
.I %D
The directory name of the unselected panel.
.TP
.I %t
The currently tagged files.
.TP
.I %T
The tagged files in the unselected panel.
.TP
.I %u
and
.I %U
Similar to the
.I %t
and
.I %T
macros, but in addition the files are untagged. You can use this macro
only once per menu file entry or extension file entry, because next time
there will be no tagged files.
.TP
.I %s
and
.I %S
The selected files: The tagged files if there are any. Otherwise the
current file.
.PP
Feel free to edit this files, if you need.
Here is a sample external script:
.PP
.nf
l comment selection
TMPFILE=`mktemp ${MC_TMPDIR:\-/tmp}/up.XXXXXX` || exit 1
echo #if 0 > $TMPFILE
cat %b >> $TMPFILE
echo #endif >> $TMPFILE
cat $TMPFILE > %b
rm \-f $TMPFILE
.fi
.PP .PP
If some keys don't work, you can use If some keys don't work, you can use
.B Learn Keys .B Learn Keys