BenV's notes

Archive for March, 2010

Vim tricks with multiple cut/paste buffers

by on Mar.27, 2010, under Software

Ever find yourself in vi(m) with a piece of code that needs some editing, but to preserve your paste buffer you keep limping around first deleting the first part and pasting it through the file, and later doing it again but now for the second block of code?
Let’s use an example. Imagine this very simple piece of html:

Register example on some html text

Some text

Some more text

Je moeder is een texthoer

Now imagine we want to make it a bit more fancy, and want to add a hyperlink to a dictionary or something for all occurrences of the word ‘text’. Since we’re lazy, we only want to type the code for the link once.

Step by step:

  • Add the link code on the first occurrence of the link, you’ll have to type it once anyway 😉
  • We are going to use register ‘a’ for the first part of the link, the a href=”blabla” part. The end we put in buffer ‘e’. To yank the first bit into buffer a, yank as you always would, but start off by typing “a. So the total command could look like “ay/< to yank right from where your cursor is to the start of the next tag.
  • Next, to make things fancy, we do the same with the end tag, except we yank to register b by using something like “b/< to yank.
  • To make sure you yanked the correct stuff, type :reg to see the contents of your registers.
  • Now paste the appropiate register at the right spots by using “ap and “bp. Isn’t that great? 😉

    So summarized:

    Show your what’s in vims buffers / registers:

    :reg

    Delete a line into buffer ‘a’:

    "add

    Paste buffer q:

    "qp

    Some more advanced tricks:

    Add something to a buffer by using the capitalized register name. :

    "Add

    Editing register a manually:

    :let @a = "this text is now the new buffer content. Hihi."

    Search and destroy using a regexp to replace stuff with the contents of your register:

    :%s/je moeder/\=@a/g

    Have fun 🙂

Leave a Comment : more...

Windows Default Tools installation – Ninite

by on Mar.10, 2010, under Software

Windows and Ninite

So after the Adobe Cancer experience yesterday I still had to install a bunch of other things for the helpless windows user.
After I was done with most of that (of course, the good stuff always comes too late) I ran into this tool: Ninite.
They call it “The easiest way to get apps”. Well, from the screenshots it certainly looks that way. No cruft like toolbars and updaters and junk installed, just the application. (continue reading…)

Leave a Comment :, , , , more...

The Adobe Cancer

by on Mar.09, 2010, under Morons, Software

They’ve managed to piss me off once more.
I had to do a windows reinstall (XP of course) for some idiots that fubar-ed their machine, so after the usual install, 5 million windows updates, service packs, reboots and firefox install I figured I should probably install flash for them.
How hard can it be to install Adobe Flash? (continue reading…)

2 Comments :, , more...

Archives

  • 2018 (1)
  • 2016 (1)
  • 2015 (7)
  • 2014 (4)
  • 2013 (11)
  • 2012 (27)
  • 2011 (26)
  • 2010 (25)
  • 2009 (68)