1 shell_patterns=0 # expression type
5 # %c The cursor column position number. For edit menu only.
6 # %i The indent of blank space, equal the cursor column
7 # position. For edit menu only.
8 # %y The syntax type of current file. For edit menu only.
9 # %b The block file name.
10 # %f The current file name.
11 # %n Only the current file name without extension.
12 # %x The extension of current file name.
13 # %d The current directory name.
14 # %F The current file in the unselected panel.
15 # %D The directory name of the unselected panel.
16 # %t The currently tagged files.
17 # %T The tagged files in the unselected panel.
18 # %u and %U Similar to the %t and %T macros, but in
19 # addition the files are untagged. You can use this macro
20 # only once per menu file entry or extension file entry,
21 # because next time there will be no tagged files.
22 # %s and %S The selected files: The tagged files if
23 # there are any. Otherwise the current file.
27 # %{some text} Prompt for the substitution. An input box
28 # is shown and the text inside the braces is used as a
29 # prompt. The macro is substituted by the text typed by the
30 # user. The user can press ESC or F10 to cancel. This macro
31 # doesn't work on the command line yet.
33 #----------------------- Begin [perl] language template -----------------------
34 + y Perl\ Program | f \.pl$
35 1 Author description header
39 MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
40 AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
42 #----------------------------------------------------------------------
44 # Author: $AUTHOR <$REPLYTO>
46 # Computer: `uname -n`
47 # System: `uname -sr` on `uname -m`
49 # Copyright (c) `date +%%Y` $AUTHOR All rights reserved.
51 #----------------------------------------------------------------------
54 #----------------------------------------------------------------------
60 + y Perl\ Program | f \.pl$
67 + y Perl\ Program | f \.pl$
70 %ifor ($i = ; $i < ; $i++) {
74 + y Perl\ Program | f \.pl$
81 + y Perl\ Program | f \.pl$
88 + y Perl\ Program | f \.pl$
96 + y Perl\ Program | f \.pl$
104 + y Perl\ Program | f \.pl$
106 echo "%i$ = substr(\$str, \$off, \$cnt);" >%b
108 + y Perl\ Program | f \.pl$
111 %iopendir(DIR, \$dir) || die("\$0: can't open \$dir\n");
114 + y Perl\ Program | f \.pl$
116 NAME=%{ Enter name of subroutine: }
123 #----------------------- End [perl] language template -------------------------
125 #---------------------- Begin [shell] language template -----------------------
126 + y Shell\ Script | f \.sh$
127 1 Author description header
131 MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
132 AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
134 #----------------------------------------------------------------------
136 # Author: $AUTHOR <$REPLYTO>
138 # Computer: `uname -n`
139 # System: `uname -sr` on `uname -m`
141 # Copyright (c) `date +%%Y` $AUTHOR All rights reserved.
143 #----------------------------------------------------------------------
146 #----------------------------------------------------------------------
152 + y Shell\ Script | f \.sh$
160 + y Shell\ Script | f \.sh$
168 + y Shell\ Script | f \.sh$
176 + y Shell\ Script | f \.sh$
178 NUMBER=%{ Enter number elements of case:}
182 while [ "$NUMBER" -gt 0 ]
195 + y Shell\ Script | f \.sh$
197 NAME=%{ Enter name of function:}
203 + y Shell\ Script | f \.sh$
208 %i if [ -n "\$i" ];then
216 #----------------------- End [shell] language template ------------------------
218 #------------------------- Begin [c] language template ------------------------
219 + f \.h$ | f \.c$ | f \.cc$
220 1 Author description header
224 MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
225 AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
227 /********************************************************************
229 * Author: $AUTHOR <$REPLYTO>
231 * Computer: `uname -n`
232 * System: `uname -sr` on `uname -m`
234 * Copyright (c) `date +%%Y` $AUTHOR All rights reserved.
236 ********************************************************************/
239 + f \.h$ | f \.c$ | f \.cc$
240 2 GPL description header
243 * This program is free software: you can redistribute it and/or modify
244 * it under the terms of the GNU General Public License as published by
245 * the Free Software Foundation, either version 3 of the License, or
246 * (at your option) any later version.
248 * This program is distributed in the hope that it will be useful,
249 * but WITHOUT ANY WARRANTY; without even the implied warranty of
250 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
251 * GNU General Public License for more details.
253 * You should have received a copy of the GNU General Public License
254 * along with this program. If not, see <http://www.gnu.org/licenses/>.
283 NUMBER=%{ Enter number elements of switch:}
284 echo "%iswitch () {" >%b
285 while [ "$NUMBER" -gt 0 ]
287 echo "%icase '':" >>%b
288 echo "%i break;" >>%b
291 echo "%i default:" >>%b
297 %ifor (i = ; i < ; i++) {
357 NAME=%{ Enter name of function:}
361 } /* end of $NAME() */
364 + f \.c$ | f \.h$ | f \.cc$
366 INC=%{ Enter include name: }
367 if [ -r "$INC" ];then
368 echo \#include \"$INC\" >%b
370 echo \#include \<$INC\> >%b
373 + f \.c$ | f \.h$ | f \.cc$
377 + f \.c$ | f \.h$ | f \.cc$
385 + f \.c$ | f \.h$ | f \.cc$
386 ...............................................................................
388 + f \.c$ | f \.h$ | f \.cc$
389 h View all *.h into current directory
393 d Run gdb for current file
394 [ -x "./%n" ] && gdb ./%n
398 c Compile, link and run the current .c file
399 export CFLAGS="-g -Wall -O2"
400 make || make %n || cc $CFLAGS -o %n %f
401 [ -r "%n" ] && (echo "*** press any key for run... ***"; read)
403 (echo -ne "\n--- Press any key for return to edit. ---"; read)
406 t Indent `C' formatter
407 indent -kr -pcs %b 1>/dev/null 2> %e
409 #--------------------- End [c/c++] language template --------------------------
411 #------------------------- Begin unknown template -----------------------------
414 echo "#! /bin/sh" >%b
418 echo "#! /usr/bin/perl" >%b
421 a Author description header
425 MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
426 AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
428 ----------------------------------------------------------------------
430 Author: $AUTHOR <$REPLYTO>
433 System: `uname -sr` on `uname -m`
435 Copyright (c) `date +%%Y` $AUTHOR All rights reserved.
436 ----------------------------------------------------------------------
439 #--------------------------- End unknown template -----------------------------
441 -------------------------------------------------------------------------------
443 #----------------------- Begin common section ---------------------------------
445 TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
447 cat $TMPFILE| sort >%b
450 I Insert `Changelog' string
451 DATE="`date +%%Y-%%m-%%d`"
452 MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
453 AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
455 echo "$DATE $AUTHOR $EMAIL" >%b
461 MAN=%{Enter name of man:}
462 %view{ascii,nroff} MANROFFOPT='@MAN_FLAGS@' MAN_KEEP_FORMATTING=1 man -P cat $MAN
464 i Insert output of command to cursor
465 CMD=%{ Enter command: }
468 o Open bash to next free console
471 u Upper case selection
472 TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
474 sed 's/\(.*\)/\U\1/' $TMPFILE >%b
477 l Lower case selection
478 TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
480 sed 's/\(.*\)/\L\1/' $TMPFILE >%b
483 #-------------------------- End of common section -----------------------------