vim tip-o-rama
On Sat, May 05, 2001 at 11:01:11AM -0700, Karsten M. Self wrote:
> on Sat, May 05, 2001 at 08:27:19AM -0400, MaD dUCK (madduck@madduck.net) wrote:
> > also sprach mdevin (on Sat, 05 May 2001 09:20:15PM +1000):
> > > How do you stop this from happening?
> >
> > actually, set noautoindent won't cut it if you have smartindent or
> > cindent set. however, vim has a feature:
> >
> > :set paste
> >
> > then paste your text, then
> >
> > :set nopaste
>
> Cool! That I did not know.
>
> ...now, what's a useful key to bind that to....
opportunity missed! the one tip i could have given to karsten,
and come off looking like i was knowledgeable, and it's all under
the bridge now... dang!
:}
hmm... maybe there's others you've not seen -- how about
:opt
to change or view vim settings?
then there's modelines, where you can include some vim settings
INSIDE your source file:
#!/usr/bin/perl
# vim:ts=6 ft=html
use strict;
...
which you can learn about via
:help modeline
how about that? hmm? okay, i'm sure there's something... wait,
then there's
gqip
to reformat any paragraph, INCLUDING correctly interpreting
quoted email chunks like
> here you said
> > someone else quoth
> > > dontcha hate those poorly-wrapped lines from
> > > forwarded
> > > emails where the slob who forwards it doesn't
> > > care
> > > how stupid it makes her look?
> >
> > you betcha by golly, i sure
> > do
>
> well okay then
edit this message and try 'gqip' there, you'll like it (a lot)...
ah. then say you're editing a perl script that's loaded with tops
of sql -- you can change the syntax highlighting to sql via
:set ft=sql
or when you resume editing a message in mutt -- the filename of a
resumed message doesn't match the 'email' pattern vim looks for
so the syntax highlighting is gaflooey... you can fix it via
:set ft=mail
didja know that?
hmm. i'm sure there's SOMETHING i could impart, waitaminit...
--
DEBIAN NEWBIE TIP #15 from Will Trillich <will@serensoft.com>
:
Is there a good place to learn snarky PERL TECHNIQUES? One of
my favorites is http://webtechniques.com, where Randall Schwartz
contributes a monthly sample, explaining line-by-line what his
code does, and why. (Look under "Programming with Perl" in the
archives.)
Also see http://newbieDoc.sourceForge.net/ ...
Reply to: