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 2 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, write to the Free Software
255 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
284 NUMBER=%{ Enter number elements of switch:}
285 echo "%iswitch () {" >%b
286 while [ "$NUMBER" -gt 0 ]
288 echo "%icase '':" >>%b
289 echo "%i break;" >>%b
292 echo "%i default:" >>%b
298 %ifor (i = ; i < ; i++) {
358 NAME=%{ Enter name of function:}
362 } /* end of $NAME() */
365 + f \.c$ | f \.h$ | f \.cc$
367 INC=%{ Enter include name: }
368 if [ -r "$INC" ];then
369 echo \#include \"$INC\" >%b
371 echo \#include \<$INC\> >%b
374 + f \.c$ | f \.h$ | f \.cc$
378 + f \.c$ | f \.h$ | f \.cc$
386 + f \.c$ | f \.h$ | f \.cc$
387 ...............................................................................
389 + f \.c$ | f \.h$ | f \.cc$
390 h View all *.h into current directory
394 d Run gdb for current file
395 [ -x "./%n" ] && gdb ./%n
399 c Compile, link and run the current .c file
400 export CFLAGS="-g -Wall -O2"
401 make || make %n || cc $CFLAGS -o %n %f
402 [ -r "%n" ] && (echo "*** press any key for run... ***"; read)
404 (echo -ne "\n--- Press any key for return to edit. ---"; read)
407 t Indent `C' formatter
408 indent -kr -pcs %b 1>/dev/null 2> %e
410 #--------------------- End [c/c++] language template --------------------------
412 #------------------------- Begin unknown template -----------------------------
415 echo "#! /bin/sh" >%b
419 echo "#! /usr/bin/perl" >%b
422 a Author description header
426 MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
427 AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
429 ----------------------------------------------------------------------
431 Author: $AUTHOR <$REPLYTO>
434 System: `uname -sr` on `uname -m`
436 Copyright (c) `date +%%Y` $AUTHOR All rights reserved.
437 ----------------------------------------------------------------------
440 #--------------------------- End unknown template -----------------------------
442 -------------------------------------------------------------------------------
444 #----------------------- Begin common section ---------------------------------
445 I Insert `Changelog' string
446 DATE="`date +%%Y-%%m-%%d`"
447 MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
448 AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
450 echo "$DATE $AUTHOR $EMAIL" >%b
456 MAN=%{Enter name of man:}
457 TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/mcview.$MAN.XXXXXX` || exit 1
458 man -Pcat $MAN >$TMPFILE
462 i Insert a out of command to cursor.
463 CMD=%{ Enter command: }
466 o Open bash to next free console
468 #-------------------------- End of common section -----------------------------