vim abbreviations, sqlite2

statico on 2004-12-02T23:39:13

During my tutorials I found myself creating handfuls of scripts, all of which starting with the warning and strict pragmas. Following Damian Conway's example, I set up a Vim abbreviation:

:iab uw; use warnings;use strict;


I would really like it to only expand if I hit Enter after the abbreviation. I tried appending a \r, \n and , but no luck.

Also, Marty pointed out that I should be using DBD::SQLite2 instead of DBD::SQLite because of backward-incompatabilities in the newer SQLite libraries. That clears things up!


uw;

rjbs on 2004-12-03T00:07:18

You can't do what you want with an abbr, unless I'm wrong. Instead, you can do this: :imap uw; use warnings;use strict;

It's not as pretty, because if you type "uw; foo" you won't see the uw; displayed until the space. Still, it works.

preview, preview, preview

rjbs on 2004-12-03T00:08:12

I should've. Insert <CR> in the right places in there.

Re:preview, preview, preview

statico on 2004-12-03T03:46:59

Interesting.... This has the strange side effect of not advancing the cursor until (a) I complete the mapping or (b) a time delay, the former of which throws me off a bit. I'll try out both. Thanks!