VI lets you use buffers to quickly copy and save chunks of text. You can think of them as being sort of like the clipboard that you copy to when you highlight some text in Word or other such programs - except that you have many, many more clipboards at your disposal. Here's how it works. In VI, highlight some text that you want to copy - hit v and then move the cursor around to highlight the text. Then decide what buffer you want to copy it to. The buffers are identified by a letter - so let's say you wanted to copy some text to the "h" buffer - you would type the following (with the text highlighted) "hy which "yanks" that text into the buffer. You could then paste the contents of that buffer with "hp The contents of the buffers persist until something replaces them - which makes them a great place to store those little snippets of text you use a lot. And in reference to my earlier post about using macros , you can even use buffers within a mac...
A repository of handy little tips I'm building for the benefit of my fellow web developers.