Mailinglist Archive: opensuse (2835 mails)

< Previous Next >
Re: [opensuse] article about Midnight Commander
  • From: "Mark Goldstein" <goldstein.mark@xxxxxxxxx>
  • Date: Tue, 5 Dec 2006 21:47:49 +0200
  • Message-id: <1d8633230612051147m16acb7e5xe3980be972d7cae2@xxxxxxxxxxxxxx>
On 12/5/06, James Oakley <jfunk@xxxxxxxxxxxxxx> wrote:
On Tuesday 05 December 2006 8:17 am, Mark Goldstein wrote:
> On 12/5/06, Lev Lafayette <lev@xxxxxxxxxxxxxxxx> wrote:
> > Midnight Commander is a *great* interface. For those old MS-DOS heads
> > from the eighties, it's like Xtree Pro/Gold, but *better*.
>
> Well, Norton Commander is closer to MC than Xtree.
>
> One very powerful feature of MC is "macro" parameters. I'm using it quite
> often. E.g. I have different releases in 2 directories and I want to check
> differences between files one by one. I'm opening these directories in 2
> panels and use command
>
> diff %f %D/%f (compare file under cursor in the current panel with
> file with the same name in the other panel).

I do this in the edit menu, so I can simply hit F2, then d or D (I commented
the default d and D entries). I also colourised the output to make the changes
stand out, like when you open up a patch file in mcedit:

+ t r & ! t t
d Diff against file of same name in other directory
if [ "%d" = "%D" ]; then
echo "The two directores must be different"
exit 1
fi
if [ -f %D/%f ]; then # if two of them, then
diff -up %f %D/%f | sed -e 's/\(^-.*\)/\x1b[1;31m\1\x1b[0m/g' \
-e 's/\(^\+.*\)/\x1b[1;32m\1\x1b[0m/g' \
-e 's/\(^@.*\)/\x1b[36m\1\x1b[0m/g' | less -R
else
echo %f: No copy in %D/%f
fi

D Diff current directory against other directory
if [ "%d" = "%D" ]; then
echo "The two directores must be different"
exit 1
fi
diff -up %d %D | sed -e 's/\(^-.*\)/\x1b[1;31m\1\x1b[0m/g' \
-e 's/\(^\+.*\)/\x1b[1;32m\1\x1b[0m/g' \
-e 's/\(^@.*\)/\x1b[36m\1\x1b[0m/g' | less -R
fi

To edit your menu file, go to "Command" | "Edit Menu File" and select "Home".

--

That's profi level! Will try it. Thanks.
--
Mark Goldstein
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >