Atsushi Yamamoto

Vim as a journal

There are many schools of thought on which medium to record your journals in (e.g., physical journal, audio recordings, etc). I like using text files for a couple of reasons:

The biggest draw for me is the writing experience. As I’m already fairly experienced with vim text manipulation, I can write my journals swiftly. It ultimately lowers the barrier for me to write consistently.

While Vim excels at the editing experience, it lacks built-in organization features. This is where vim-wiki comes in. Here’s an overview of the features:

With VimWiki, you can:

  • Organize notes and ideas
  • Manage to-do lists
  • Write documentation
  • Maintain a diary
  • Export everything to HTML

There are three features I use the most:

Using a template

I use a template.md file as a journal template. The following vimscript achieves three tasks:

function! LoadVocab()
  return systemlist('shuf -n 1 ~/Dropbox/wiki/diary/vocab.txt')
endfunction
function! JournalHeader()
  return "# " . strftime('%a') . " " . strftime('%m/%d') . " @"
endfunction
nmap <Space>l :r ~/Dropbox/wiki/diary/template.md<CR>gg"=JournalHeader()<C-M>p2j"=LoadVocab()<C-M>pgg

Writing plugins

Here are other plugins that help me write better in vim (h/t to @reedes on GitHub):

Do you also write a lot in vim? Feel free to reach out with your tips & tricks!