2 minute read Published:

Vim, A Quick Reminder

When trying to add a new vim feature into my daily workflow, I run into problems. Normally what I do when learning something new (or relearning), is to write some notes on a piece of paper, or store it on a file. The issue is, when needing that refresher, I’ve either misplaced the paper or forgotten what random file the info was in. The real issue, however, is I don’t want to break out of my flow. There is nothing worse than losing your train of thought.

One solution would be to pick up one of the many Vim Plugins written to take notes. This seemed heavy handed. I just need a reminder, something quick that won’t distract me too much.

Here is what I came up with. It’s a small function you can put in your vimrc that shows a popup for a few seconds.

func! Reminder()
  let it = readfile('/home/kevino/projects/dotfiles/vim/reminder.txt')
  call popup_notification(it, #{ line: 2, col: 20, highlight: 'PmenuSel', time: 3000} )

Then map it:

nnoremap ,b <CR>:call Reminder()<CR>

Now the next time you need to remember some rarely used feature it’s a just a keystroke away. Popup time (3s) is just short enough to get the reminder and let you right back into the flow.

Here is what it looks like: