mirror of https://github.com/MidnightCommander/mc
added examples
added rules for misc/macros.d/*. in the process of installation, example scripts will be copied into share/mc/examples/macros.d Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
parent
b642e2e1e1
commit
04d54931d0
|
@ -529,6 +529,7 @@ contrib/dist/prototype
|
||||||
|
|
||||||
misc/Makefile
|
misc/Makefile
|
||||||
misc/skins/Makefile
|
misc/skins/Makefile
|
||||||
|
misc/macros.d/Makefile
|
||||||
misc/mc.ext
|
misc/mc.ext
|
||||||
|
|
||||||
src/Makefile
|
src/Makefile
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
## Process this file with automake to create Makefile.in.
|
## Process this file with automake to create Makefile.in.
|
||||||
|
|
||||||
SUBDIRS = skins syntax
|
SUBDIRS = macros.d skins syntax
|
||||||
|
|
||||||
LIBFILES_OUT = mc.ext
|
LIBFILES_OUT = mc.ext
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ LIBFILES_CONST = \
|
||||||
mc.menu \
|
mc.menu \
|
||||||
mc.menu.sr
|
mc.menu.sr
|
||||||
|
|
||||||
|
|
||||||
CLEANFILES = $(SCRIPTS_OUT)
|
CLEANFILES = $(SCRIPTS_OUT)
|
||||||
|
|
||||||
cfgdir = $(sysconfdir)/@PACKAGE@
|
cfgdir = $(sysconfdir)/@PACKAGE@
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
macrodir = $(pkgdatadir)/examples/macros.d
|
||||||
|
|
||||||
|
macro_DATA = \
|
||||||
|
macro.0.sh \
|
||||||
|
macro.1.sh \
|
||||||
|
macro.3.sh \
|
||||||
|
macro.4.sh \
|
||||||
|
macro.5.sh
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
$(macro_DATA)
|
|
@ -0,0 +1,6 @@
|
||||||
|
#interactive
|
||||||
|
m make
|
||||||
|
TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
|
||||||
|
make 2> $TMPFILE
|
||||||
|
mcedit $TMPFILE
|
||||||
|
rm $TMPFILE
|
|
@ -0,0 +1,5 @@
|
||||||
|
u Upper case selection
|
||||||
|
TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
|
||||||
|
cat %b > $TMPFILE
|
||||||
|
cat $TMPFILE| sed 's/\(.*\)/\U\1/' >%b
|
||||||
|
rm -f $TMPFILE
|
|
@ -0,0 +1,5 @@
|
||||||
|
l Lower case selection
|
||||||
|
TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
|
||||||
|
cat %b > $TMPFILE
|
||||||
|
cat $TMPFILE| sed 's/\(.*\)/\L\1/' >%b
|
||||||
|
rm -f $TMPFILE
|
|
@ -0,0 +1,5 @@
|
||||||
|
S Sort selection
|
||||||
|
TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
|
||||||
|
cat %b > $TMPFILE
|
||||||
|
cat $TMPFILE| sort >%b
|
||||||
|
rm -f $TMPFILE
|
|
@ -0,0 +1,2 @@
|
||||||
|
t Indent `C' formatter
|
||||||
|
indent -gnu -fc1 -i4 -bli0 -nut -bap -l100 %b 1>/dev/null 2> %e
|
|
@ -0,0 +1,41 @@
|
||||||
|
s snippets
|
||||||
|
a=`cat %b`
|
||||||
|
if [ "$a" = "fori" ]; then
|
||||||
|
echo "for (i = 0; i _; i++)" > %b
|
||||||
|
fi
|
||||||
|
if [ "$a" = "ife" ]; then
|
||||||
|
cat <<EOF > %b
|
||||||
|
if ( )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
if [ "$a" = "GPL" ]; then
|
||||||
|
cat >>%b <<EOF
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
if [ "$a" = "type" ]; then
|
||||||
|
cat <<EOF > %b
|
||||||
|
typedef struct {
|
||||||
|
;
|
||||||
|
} ?;
|
||||||
|
EOF
|
||||||
|
fi
|
|
@ -0,0 +1,9 @@
|
||||||
|
#see ./macros.d/*
|
||||||
|
[editor]
|
||||||
|
#autocomplete "ife", "GPL", "fori"
|
||||||
|
ctrl-space=EditWordLeftHighlight:-1;EditPipeBlock:5;EditUnmark:-1;
|
||||||
|
#run make
|
||||||
|
ctrl-f9=EditPipeBlock:0;
|
||||||
|
#indent current selection
|
||||||
|
meta-ctrl-F=EditPipeBlock:4;
|
||||||
|
|
Loading…
Reference in New Issue