sponsor Vim development Vim logo Vim Book Ad

logpad-plus-duration : Emulate Windows Notepad logging feature, and log duration of each entry

 script karma  Rating 0/0, Downloaded by 668  Comments, bugs, improvements  Vim wiki

created by
Talha Mansoor
script type

This plugin is a fork of logpad plugin by Sven Knurr <der_tuxman@arcor.de> available at: http://vim.sourceforge.net/scripts/script.php?script_id=2775


It is suggested to keep a daily log to stay focused on productivity. Life Hacker did [an article](http://lifehacker.com/5582372/use-a-daily-log-to-keep-yourself-focused-on-productivity) on it. I looked for plugin to have similar feature in Vim and that landed me on Logpad plugin.

Wouldn't it be nice if besides logging, we can also see how much time was spent on the latest activity? This is exactly what this plugin attempts to do. If you enable it, it will calculate the time elapsed and insert it in the file.

With this plugin you get all the features of Logpad plugin plus log duration feature.

How to use it

Create a new file, write .LOG as the first line and save it. Every time you reopen the file, a new line with the current timestamp is added, so you can easily maintain a chronologic log of your tasks.


By default, this plugin works the same way as the original Notepad. You can modify certain aspects of it by setting the following variables:

let LogpadEnabled = 1

    enables/disables logpad
    available values : [0, 1]
    default value: 1

let LogpadInsert = 0

    automatically enables insert mode when a new log entry is created
    available values : [0, 1]
    default value: 0

let LogpadLineBreak = 0

    adds an empty line before a new log entry
    available values : [0, 1]
    default value: 0 (Windows Notepad behavior)

let LogpadIgnoreNotes = 0

    allows adding notes before the first log entry
    available values : [0, 1]
    default value: 0

let LogpadIgnoreReadOnly = 0

    allows logpad to ignore a file's read-only flag
    available values : [0, 1]
    default value: 0

let LogpadLogDuration = 1

    adds the time elapsed since last timestamp under the new timestamp
    available values : [0 ,1]
    default value: 0

Example (without LogpadLogDuration)

Sun Jul 14 17:38:44 2013
First entry of the day
Sun Jul 14 17:46:11 2013
Replied to customer emails.
Sun Jul 14 18:41:43 2013
Skype session with remote team.

Example (with LogpadLogDuration)

If LogpadLogDuration is set then time elapsed since last event will also be added.

Sun Jul 14 17:38:44 2013
First entry of the day
Sun Jul 14 17:46:11 2013
Time elapsed: 7 min 27 sec
Replied to customer emails.
Sun Jul 14 18:41:43 2013
Time elapsed: 55 min 32 sec
Skype session with remote team.

Now you can see that your Skype session took 55 min. Your replied to emails within 7 min. Without this feature, you will have to do mental maths to calculate the time it took you to do a work.

Source Code


Bug Reports/Feature Requests

install details
Download the logpad.vim file. Put it into your plugins directory.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
logpad.vim 1.0 2013-08-08 6.0 Talha Mansoor Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.