deleted "prehistoric" string...
[midnight-commander.git] / lib / cedit.menu
blobababc3d9c37a10ca2d8c927dfd038578f5df78c4
1 shell_patterns=0    # expression type
3 # The macros are:
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.
24
25 # %% The % character
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
36         unset LANG
37         unset LANGUAGE
38         LC_ALL=
39         AUTHOR="`awk -F: /^\`id -un\`:/'{print($5)}' /etc/passwd`"
40         cat >>%b <<EOF
41         #----------------------------------------------------------------------
42         # Description:
43         # Author: $AUTHOR <$REPLYTO>
44         # Created at: `date`
45         # Computer: `uname -n` 
46         # System: `uname -sr` on `uname -m`
47         #    
48         # Copyright (c) `date +%%Y` $AUTHOR  All rights reserved.
49         #
50         #----------------------------------------------------------------------
51         # Configure section:
52         
53         #----------------------------------------------------------------------
54         #
55         # main()
56         
57         EOF
59 + y Perl\ Program | f \.pl$
60 2       while ()
61         cat <<EOF > %b
62         %iwhile() {
63         %i}
64         EOF
66 + y Perl\ Program | f \.pl$
67 3       for ()
68         cat <<EOF > %b
69         %ifor ($i =  ; $i <  ; $i++) {
70         %i}
71         EOF
73 + y Perl\ Program | f \.pl$
74 4       foreach ()
75         cat <<EOF > %b
76         %iforeach ($ ) {
77         %i}
78         EOF
80 + y Perl\ Program | f \.pl$
81 5       if ()
82         cat <<EOF > %b
83         %iif () {
84         %i}
85         EOF
86                 
87 + y Perl\ Program | f \.pl$
88 6       if () else
89         cat <<EOF > %b
90         %iif () {
91         %i} else {
92         %i}
93         EOF
95 + y Perl\ Program | f \.pl$
96 7       if () elsif ()
97         cat <<EOF > %b
98         %iif () {
99         %i} elsif () {
100         %i}
101         EOF
103 + y Perl\ Program | f \.pl$
104 8       substr ()
105         echo "%i$ = substr(\$str, \$off, \$cnt);" >%b
107 + y Perl\ Program | f \.pl$
108 9       opendir ()
109         cat <<EOF > %b
110         %iopendir(DIR, \$dir) || die("\$0: can't open \$dir\n");
111         EOF
113 + y Perl\ Program | f \.pl$
114 a       sub ()
115         NAME=%{ Enter name of subroutine: }
116         cat <<EOF > %b
117         sub
118         $NAME ()
119         {
120         } # end of $NAME()        
121         EOF
122 #----------------------- End [perl] language template -------------------------
124 #---------------------- Begin [shell] language template -----------------------
125 + y Shell\ Script | f \.sh$
126 1       Author description header
127         unset LANG
128         unset LANGUAGE
129         LC_ALL=
130         AUTHOR="`awk -F: /^\`id -un\`:/'{print($5)}' /etc/passwd`"
131         cat >>%b <<EOF
132         #----------------------------------------------------------------------
133         # Description:
134         # Author: $AUTHOR <$REPLYTO>
135         # Created at: `date`
136         # Computer: `uname -n`
137         # System: `uname -sr` on `uname -m`
138         #    
139         # Copyright (c) `date +%%Y` $AUTHOR  All rights reserved.
140         #
141         #----------------------------------------------------------------------
142         # Configure section:
143         
144         #----------------------------------------------------------------------
145         #
146         # main()
147         
148         EOF
150 + y Shell\ Script | f \.sh$
151 3       for
152         cat <<EOF > %b
153         %ifor i in \$
154         %ido
155         %idone
156         EOF
158 + y Shell\ Script | f \.sh$
159 4       while
160         cat <<EOF > %b
161         %iwhile
162         %ido
163         %idone
164         EOF
166 + y Shell\ Script | f \.sh$
167 5       if [] then else
168         cat <<EOF >> %b
169         %iif [ ];then
170         %ielse
171         %ifi
172         EOF
174 + y Shell\ Script | f \.sh$
175 6       case
176         NUMBER=%{ Enter number elements of case:}
177         cat <<EOF > %b
178         %icase "\$" in
179         EOF
180         while [ "$NUMBER" -gt 0 ]
181         do
182         cat <<EOF >> %b
183         %i)
184         %i    ;;
185         EOF
186         let NUMBER=$NUMBER-1    
187         done
188         cat <<EOF >> %b
189         %i*)
190         %iesac
191         EOF
193 + y Shell\ Script | f \.sh$
194 7       function
195         NAME=%{ Enter name of function:}
196         cat <<EOF >> %b
197         $NAME() {
198         } # end of $NAME()
199         EOF
200                 
201 + y Shell\ Script | f \.sh$
202 8       select of bash
203         cat <<EOF >> %b
204         %iselect i in \$l
205         %ido
206         %i    if [ -n "\$i" ];then
207         %i       break
208         %i    else
209         %i       continue
210         %i    fi        
211         %idone
212         EOF
213         
214 #----------------------- End [shell] language template ------------------------
216 #------------------------- Begin [c] language template ------------------------
217 + f \.h$ | f \.c$ | f \.cc$
218 1       Author description header
219         unset LANG
220         unset LANGUAGE
221         LC_ALL=
222         AUTHOR="`awk -F: /^\`id -un\`:/'{print($5)}' /etc/passwd`"
223         cat >> %b <<EOF
224         /********************************************************************
225         * Description:
226         * Author: $AUTHOR <$REPLYTO>
227         * Created at: `date`
228         * Computer: `uname -n` 
229         * System: `uname -sr` on `uname -m`
230         *    
231         * Copyright (c) `date +%%Y` $AUTHOR  All rights reserved.
232         *
233         ********************************************************************/
234         EOF
236 + f \.h$ | f \.c$ | f \.cc$
237 2       GPL description header
238         cat >>%b <<EOF
239         /*
240         * This program is free software; you can redistribute it and/or modify
241         * it under the terms of the GNU General Public License as published by
242         * the Free Software Foundation; either version 2 of the License, or
243         * (at your option) any later version.
244         *
245         * This program is distributed in the hope that it will be useful,
246         * but WITHOUT ANY WARRANTY; without even the implied warranty of
247         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
248         * GNU General Public License for more details.
249         *
250         * You should have received a copy of the GNU General Public License
251         * along with this program; if not, write to the Free Software
252         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
253         */
254         EOF
256 + f \.c$ | f \.cc$
257 3       if ()
258         cat <<EOF > %b
259         %iif () {
260         %i}
261         EOF
262                 
263 + f \.c$ | f \.cc$
264 4       if () else
265         cat <<EOF > %b
266         %iif () {
267         %i} else {
268         %i}
269         EOF
271 + f \.c$ | f \.cc$
272 5       if () else if ()
273         cat <<EOF > %b
274         %iif ( ) {
275         %i} else if ( ) {
276         %i}
277         EOF
279 + f \.c$ | f \.cc$
280 6       switch ()
281         NUMBER=%{ Enter number elements of switch:}
282         echo "%iswitch () {" >%b
283         while [ "$NUMBER" -gt 0 ]
284         do
285             echo "%icase '':" >>%b
286             echo "%i      break;" >>%b
287             let NUMBER=$NUMBER-1    
288         done
289         echo "%i      default:" >>%b
290         echo "%i}" >>%b
291         
292 + f \.c$ | f \.cc$
293 7       for ()
294         cat <<EOF > %b
295         %ifor (i =  ; i <  ; i++) {
296         %i}
297         EOF
298         
299 + f \.c$ | f \.cc$
300 8       while ()               
301         cat <<EOF > %b
302         %iwhile () {
303         %i}
304         EOF
306 + f \.c$ | f \.cc$
307 9       do {} while ()               
308         cat <<EOF > %b
309         %ido {
310         %i} while ()
311         EOF
312         
313 + f \.c$ | f \.cc$
314 a       array
315         cat <<EOF > %b
316         %ichar const x[] = {
317         %i, ,
318         %i};
319         EOF
320         
321 + f \.c$ | f \.cc$
322 b       enum
323         cat <<EOF > %b
324         %ienum x {
325         %i, ,
326         %i};
327         EOF
328         
329 + f \.c$ | f \.cc$
330 c       struct
331         cat <<EOF > %b
332         %istruct ? {
333         %i;
334         %i};
335         EOF
336         
337 + f \.c$ | f \.cc$
338 d       union
339         cat <<EOF > %b
340         %iunion ? {
341         %i;
342         %i};
343         EOF
344         
345 + f \.c$ | f \.cc$
346 e       typedef struct
347         cat <<EOF > %b
348         %itypedef struct {
349         %i;
350         %i} ?;
351         EOF
353 + f \.c$ | f \.cc$
354 f       function
355         NAME=%{ Enter name of function:}
356         cat <<EOF >> %b
357         $NAME()
358         {
359         } /* end of $NAME() */
360         EOF
362 + f \.c$ | f \.h$ | f \.cc$
363 g       #include
364         INC=%{ Enter include name: }
365         if [ -r "$INC" ];then
366             echo \#include \"$INC\" >%b
367         else
368             echo \#include \<$INC\> >%b
369         fi
371 + f \.c$ | f \.h$ | f \.cc$
372 d       #define
373         echo "#define " >%b
375 + f \.c$ | f \.h$ | f \.cc$
376 d       #ifdef
377         cat <<EOF > %b
378         #ifdef
379         #else
380         #endif
381         EOF
383 + f \.c$ | f \.h$ | f \.cc$
384 ...............................................................................
386 + f \.c$ | f \.h$ | f \.cc$
387 h       View all *.h into current directory
388         cat *.h |less
390 + f \.c$ | f \.cc$
391 d       Run gdb for current file
392         [ -x "./%n" ] && gdb ./%n
394 = f \.c$ | f \.cc$
395 + f \.c$ | f \.cc$
396 c       Compile, link and run the current .c file
397         export CFLAGS="-g -Wall -O2"
398         make || make %n || cc $CFLAGS -o %n %f
399         [ -r "%n" ] && (echo "*** press any key for run... ***"; read)
400         [ -x "%n" ] && ./%n
401         (echo -ne "\n--- Press any key for return to edit. ---"; read)
403 + f \.c$ | f \.h$
404 t       Indent `C' formatter
405         indent -kr -pcs %b 1>/dev/null 2> %e
407 #--------------------- End [c/c++] language template --------------------------
409 #------------------------- Begin unknown template -----------------------------
410 + y unknown & t r
411 s       #! /bin/sh
412         echo "#! /bin/sh" >%b
414 + y unknown & t r
415 p       #! /usr/bin/perl
416         echo "#! /usr/bin/perl" >%b
418 + y unknown & t r
419 a       Author description header
420         unset LANG
421         unset LANGUAGE
422         LC_ALL=
423         AUTHOR="`awk -F: /^\`id -un\`:/'{print($5)}' /etc/passwd`"
424         cat >>%b <<EOF
425         ----------------------------------------------------------------------
426         Description:
427         Author: $AUTHOR <$REPLYTO>
428         Created at: `date`
429         Computer: `uname -n` 
430         System: `uname -sr` on `uname -m`
431         
432         Copyright (c) `date +%%Y` $AUTHOR  All rights reserved.
433         ----------------------------------------------------------------------
434                 
435         EOF
436 #--------------------------- End unknown template -----------------------------
438 -------------------------------------------------------------------------------
440 #----------------------- Begin common section ---------------------------------
441 I       Insert `Changelog' string
442         DATE="`date +%%Y-%%m-%%d`"
443         AUTHOR="`awk -F: /^\`id -un\`:/'{print($5)}' /etc/passwd`"
444         EMAIL="<$REPLYTO>"
445         echo "$DATE  $AUTHOR  $EMAIL" >%b
447 s       Invoke `shell'
448         sh
450 m       view `man'
451         MAN=%{Enter name of man:}
452         TMPFILE=/tmp/mcview.$MAN.$$
453         man -Pcat $MAN >$TMPFILE
454         mcview $TMPFILE
455         rm -f $TMPFILE
456                 
457 i       Insert a out of command to cursor.
458         CMD=%{ Enter command: }
459         eval $CMD > %b
461 o       Open bash to next free console
462         open -s -- /bin/bash
463 #-------------------------- End of common section -----------------------------