2022-01-23

Thunderlinks were durable Thunderbird client hyperlinks to specific email messages that stopped functioning with a new API in version 68. Recently, I have found a similar add-on that provides comparable features. In this blogpost, I am going to describe how I have customised it for my Windows pc and how I open cbthunderlink in Vim.

Cbthunderlink extension can be installed directly from Thunderbird Add-ons browser.

From the Add-ons Manager (click the spanner icon on the top-right corner), I have changed the Open Mode option to new tab.

Filter out NoReply

It seems that the add-on has some issues when the message sender contains noreply. I have created a new folder (NoReply) and then applied the following filter to remove them from my default InBox.

Vim

To open a cbthunderlink I use a separated executable that opens the Thunderbird client and mimics the default CTRL-ALT-0 keyboard shortcut. The following code block, included in my .vimrc, allows opening the link under the cursor when I press ALT-0.

     " open cb_thunrdelink
    nnoremap <silent> <M-0> <esc> :call Open_cb_thunderlink()<CR>
    fun! Open_cb_thunderlink()
        let w = expand('<cWORD>')
        " check if a proper formatted cb_thunrdelink
        if w =~ '^\(cbthunderlink\|thunderlink\)://.\{-}[[:punct:]]$'
            echo 'Open '.w
            call setreg('*',w)
            execute dispatch#start_command(0,g:homedirw32.'\bin\open_cbthunderlink.exe',0,0)  
        endif
    endfun
    

It requires dispatch.vim plugin.

Compile the add-on with MINGW64

I removed the included python script from the add-on since it is unnecessary for my workflow. First, I installed the compression utility 7zip from the MINGW64 command line:

  $  pacman -S p7zip

then I cloned the repository locally and created the add-on with the following shell script:

    #!/usr/bin/env bash
    cd mail_extension
    7z a cb_thunderlink.xpi @files_in_xpi.lst
    cd ..
    

the add-on can then be installed from the cb_thunderlink.xpi file.

Presently, I mostly need to include links to emails in my notes and this approach is sufficient to cover this use case. If you need a dedicated VIM plugin or a similar executable for a different text editor, you can DM me on Twitter/Fosstodon @seve_py or fill out this request form.