The writings of Peter Stuifzand

Archive for July 2009

Since a few months you are able to move from Hotmail to Gmail. The biggest problem was that you couldn't take you old emails with you to Gmail.

The other big problem was that you have to everybody about your new email address. Switching has a big cost. The way this works is that you don't have change your email address, because even the new emails that arrive after you move will come into your new Gmail inbox.

To enable the retrieving of you Hotmail to your new Gmail account you have to follow a few simple steps.

1. Create a Gmail account

Creating a Gmail is not hard. Just go to Gmail and follow the instructions on the page.

2. Enable POP3 downloading

First click Settings in the upper right corner in your Gmail inbox. It's next to you email address. Then click Accounts. This will show the following page.

Gmail settings

On that page click Add a mail account you own. This will open the following small window.

Email address

Enter your email address into this window. This will help Gmail find out how to get to your email. Type your email address there. Then click Next step. This will open a new window.

Account information

This window asks about the login information for your account. Fill in the missing information and click Add account.

3. Wait for Gmail to download your email

Depending on the number of emails in your inbox, Gmail will take a few minutes to a few hours to download all the emails in your account. As soon as a few messages are downloaded, they will appear in your Gmail inbox.

After I changed to Gmail and downloaded my Hotmail email I've never looked back. It's great to have all your email in one place.

You would like to add an automatically updated timestamp in your text files. You can do that by adding 6 lines of code to your .vimrc.

The following command will call the function LastMod() whenever a buffer of file is written.

autocmd BufWritePre,FileWritePre *.html   call LastMod()

The following function will find all files containing 'Last modified:' and replace them with the current date and time.

fun LastMod()
  exe "%g/Last modified: /s/Last modified: .*/Last modified: " . strftime("%Y-%m-%d %T")
endfun

The biggest problem with this function is that using the :substitute function will move the cursor to the beginning of the line. This will even happen when nothing gets replaced. This is extremely annoying.

This can be fixed by remembering the current column and setting the cursor back to that after the command. Remembering the cursor position is easy.

let save_cursor = getpos(".")

And restoring it is not much harder.

call setpos('.', save_cursor)

I added . "/e" to the and of the regex to catch errors. Without the e flag an error will happen when there is no line matching the regex.

With all these changes the code now looks like this:

fun LastMod()
    let save_cursor = getpos(".")
    exe "%s/Last modified: .*/Last modified: " . strftime("%Y-%b-%d %X") . "/e"
    call setpos('.', save_cursor)
endfun

Vim outliner is an outliner tool. As the name implies you can write outlines with it, but with this particular one you can also create todo lists. A todo list can be created without much effort.

First open your todo file, todo.otl for example. By using the otl extension, Vim outliner will be loaded automatically.

Next, type a task you have to do in the future. This could something like write blog post about Vim outliner. Remember, because this is Vim, you have to type i to start insert mode.

write blog post about Vim outliner

Then type ,,cb this will insert a checkbox in front the current line. Which will make the line look like this:

[_] write blog post about Vim outliner

So now you start writing the blog post. When you're done after a few minutes (about 30min). You can check of the item on the list. Do this by typing ,,cx. Your file will look like this now:

[X] write blog post about Vim outliner

And this concludes this first How To blog post about Vim outliner.

Summary

Add a checkbox,,cb
Check a checkbox,,cx

Why don't we use words as tags? Search engines already know that words are tags. Why do we need to put an extra character (#) in front of a word to make it special? Here are two reasons I can think of.

The first reason is, that by using an extra character a website can make a link from the word that links to a search page or a special page for the tag. The problem is that if the post wasn't tagged then there would be no link. How can you find words that weren't tagged with the character? You would need an extra search interface for those words. But if you have that search interface you don't need to tag posts in the first place. Every word is a tag.

Second, the character also shows that the person writing the post actually meant for this word to be a tag. It's very specific. But there is no need to be this specific. As every word is a tag, you can still find a post if the words are written in there.

I think we don't need to use hashtags for tagging, just writing the words should be enough to help us find the posts we're looking for.

View archived entries