[vox-tech] serendipity with vim

Ken Bloom vox-tech@lists.lugod.org
Fri, 2 Apr 2004 07:53:04 -0800


--ew6BAiZeqk4r7MaW
Content-Type: text/plain; Format=Flowed; DelSp=Yes; charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Run gvim - there's a whole menu with the fold commands they work in vim, =
=20
but it will be easier to learn them by looking at the menu.

If you :set foldmethod=3Dindent, then you can just open and close predefine=
d =20
folds that correspond roughly to your syntax (assuming you indent =20
properly). I haven't gotten foldmethod=3Dsyntax to work though.

On 2004.04.02 06:16, Peter Jay Salzman wrote:
> heh.  at 6:15 in the morning, it blew my mind.  it took a few seconds to
> register what was going on.
>=20
> if anybody has any vim tips they'd like to share, i'd love to see a
> thread of people's favorite vim tricks.
>=20
> here's another one i learned just recently:
>=20
>=20
> 1 one
> 2 two
> 3 three
> 4 four
> 5 five
> 6 six
> 7 seven
> 8 eight
> 9 nine
>=20
> use line highlighting (shift v) and highlight lines 4, 5, and 6.
> type "zf".
> you've now "folded" lines 2, 3, 4, 5, and 6:
>=20
> 1 one
> +--  5 lines: 2----------------------------------------------------
> 7 seven
> 8 eight
> 9 nine
>=20
> now use line highlighting to to highlight the first 4 lines.
> type "zf"
> you've now folded the first four line:
>=20
> +--  8 lines: 1----------------------------------------------------
> 9 nine
>=20
> place the cursor somewhere on the fold.
> type "zo" to unfold:
>=20
> 1 one
> +--  5 lines: 2----------------------------------------------------
> 7 seven
> 8 eight
> 9 nine
>=20
> place the cursor somewhere on the fold.
> type "zo" to unfold again:
>=20
> 1 one
> 2 two
> 3 three
> 4 four
> 5 five
> 6 six
> 7 seven
> 8 eight
> 9 nine
>=20
>=20
> really great for programming.  one of the uses is when i'm editing a
> function and need to see another function that's way down in the source
> file.  i can bring them "close together" by folding.
>=20
> previously, i either moved the functions using block cut and copy (ick)
> or by using vim's marks (better, but still ick).
>=20
>=20
> zf: fold the highlighted selection.  it can take movement commands too,
>    like "zf}" to fold the next paragraph.
>=20
> zo: open a fold.  the cursor must be on top of the proper fold.
>=20
> zc: refold the last fold.
>=20
> what would be nice is if we could have "named folds", like named
> registers or named marks.
>=20
>=20
> wouldn't mind hearing other people's tips....   :-)
>=20
> pete
>=20
>=20
>=20
> On Fri 02 Apr 04,  4:43 AM, Issac Trotts <ijtrotts@ucdavis.edu> said:
> > On Fri, Apr 02, 2004 at 03:18:36AM -0800, Peter Jay Salzman wrote:
> > > it turns out that vim knows what an URL is, and will download the =20
> file
> > > pointed to by that URL.  another vim coolity.
> >
> > Thanks for the tip!
> >
> > --
> > Issac Trotts
> > http://mallorn.ucdavis.edu/~ijtrotts
> > (w) 530-757-8789
> >
> > _______________________________________________
> > vox-tech mailing list
> > vox-tech@lists.lugod.org
> > http://lists.lugod.org/mailman/listinfo/vox-tech
>=20
> --
> Make everything as simple as possible, but no simpler.  -- Albert =20
> Einstein
> GPG Instructions: http://www.dirac.org/linux/gpg
> GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
>

--=20
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.
My key was last signed 10/14/2003. If you use GPG *please* see me about
signing the key. ***** My computer can't give you viruses by email. ***

--ew6BAiZeqk4r7MaW
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBAbYxglHapveKyytERAmf/AJkBFgGd+CM1aNhtcU57D3qwQBFQBQCfdmCv
3P8lI/Lu7GDmu82XzAgyYwI=
=j8GW
-----END PGP SIGNATURE-----

--ew6BAiZeqk4r7MaW--