Vim helpers to speed-up adding protip.

As you might know, a few weeks ago I started the 15-minute share challenge. The idea is to share a single tip (or a protip) within 15 minutes. It is possible, even for lazy programmers. See my recent protips.

The time interval is challenging, so in order to fit as much knowlege as I can, some things can be automated. Below you can find a function that creates a jekyll-seo-friendly URL.

Simple example (let’s take this post first para).

" cursor in on the line below
*Vim* helpers to speed-up adding *protip*.

" call function
:call MakeProtipUrl()

" after
" 2016-04-26-vim-helpers-to-speed-up-adding-protip-protip.md

The function itself:

set nohlsearch
normal yyp
normal guu
substitute/[\*\`\.\?\:]*//g
substitute/[~ ]/-/g
exe "normal I" . strftime("%Y-%m-%d") . "-"
normal A-protip.md
delete t

Wanna join the challenge?